gprmax cuda的问题解决

为了方便下次又出现这个问题,特意记录一下...

1. 查找 CUDA 安装路径

        首先,确认 CUDA 被安装在什么地方。通常,CUDA 被安装在 /usr/local/cuda/ 目录下,但是可以通过以下命令来确认 CUDA 是否安装,以及其安装路径:

bash

which nvcc

如果安装了 CUDA,运行该命令后,它会返回类似于 /usr/local/cuda/bin/nvcc 的路径。如果没有返回路径,说明 nvcc 没有在系统的环境变量中。

【这步我输入了什么都没有】

2. 编辑.bashrc 或 .bash_profile 文件

        根据你使用的 shell 类型,通常会使用 ~/.bashrc

(gprMaxenv) D:\2025Spring\sx\py3_10gprMax\gprMax-v.3.1.7>python -m gprMax user_models/cylinder_Ascan_2D.in -gpu === Electromagnetic modelling software based on the Finite-Difference Time-Domain (FDTD) method === www.gprmax.com __ __ __ _ _ __ _ __| \/ | __ ___ __ / _` | '_ \| '__| |\/| |/ _` \ \/ / | (_| | |_) | | | | | | (_| |> < \__, | .__/|_| |_| |_|\__,_/_/\_\ |___/|_| v3.1.6 (Big Smoke) Copyright (C) 2015-2023: The University of Edinburgh Authors: Craig Warren and Antonis Giannopoulos gprMax is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. gprMax is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with gprMax. If not, see www.gnu.org/licenses. Host: LAPTOP-UVIB8C5I | LENOVO 82JQ | 0 x unknown (8 cores, 16 cores with Hyper-Threading) | 15.9GiB RAM | Windows 10 (64-bit) Traceback (most recent call last): File "D:\2025Spring\sx\py3_10gprMax\gprMax-v.3.1.7\gprMax\utilities.py", line 380, in detect_check_gpus import pycuda.driver as drv File "D:\ProgramData\anaconda3\envs\gprMaxenv\lib\site-packages\pycuda\driver.py", line 66, in <module> from pycuda._driver import * # noqa ImportError: DLL load failed while importing _driver: %1 不是有效的 Win32 应用程序。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "D:\ProgramData\anaconda3\envs\gprMaxenv\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\ProgramData\anaconda3\envs\gprMaxenv\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "D:\2025Spring\sx\py3_10gprMax\gprMax-v.3.1.7\gprMax\__main__.py", line 6, in <module> gprMax.gprMax.main() File "D:\2025Spring\sx\py3_10gprMax\gprMax-v.3.1.7\gprMax\gprMax.py", line 69, in main run_main(args) File "D:\2025Spring\sx\py3_10gprMax\gprMax-v.3.1.7\gprMax\gprMax.py", line 136, in run_main gpus, allgpustext = detect_check_gpus(args.gpu) File "D:\2025Spring\sx\py3_10gprMax\gprMax-v.3.1.7\gprMax\utilities.py", line 382, in detect_check_gpus raise ImportError('To use gprMax in GPU mode the pycuda package must be installed, and you must have a NVIDIA CUDA-Enabled GPU (https://developer.nvidia.com/cuda-gpus).') ImportError: To use gprMax in GPU mode the pycuda package must be installed, and you must have a NVIDIA CUDA-Enabled GPU (https://developer.nvidia.com/cuda-gpus).
最新发布
07-27
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值