After installing the NVIDIA GPU Computing Toolkit v13, the gen_eth and gen_trx projects started producing an error:
ImportError: DLL load failed while importing _driver: DLL load failed
The reason is that pycuda
is trying to load the CUDA DLL from the bin
directory:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin
I am using the latest version of pycuda
available at the moment: v2025.1.2.
pycuda\driver.py
:
def _add_cuda_libdir_to_dll_path():
from os.path import dirname, join
text
cuda_path = os.environ.get("CUDA_PATH")
if cuda_path is not None:
os.add_dll_directory(join(cuda_path, "bin"))
return
However, in version v13 of the NVIDIA GPU Computing Toolkit, the DLLs are located in the bin\x64
directory:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin\x64
To solve this problem, a new setting CUDA_DLL_PATH has been added to settings.ini, which contains the full path to the CUDA DLL.
settings.ini
:
[settings]
CL_PATH=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64
CUDA_DLL_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v13.0\bin\x64
The latest versions of gen_eth and gen_trx are available on GitHub:
PS. If the following error occurs:
pycuda._driver.LogicError: cuModuleLoadDataEx failed: device kernel image is invalid
then you need to update the NVIDIA video driver: https://www.nvidia.com/en-us/drivers/