Skip to content

Commit 21a7fb4

Browse files
committed
fix path loop & dll name
1 parent a14d95e commit 21a7fb4

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

cuda_bindings/cuda/bindings/_bindings/cynvrtc.pyx.in

+3-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ cdef int cuPythonInit() except -1 nogil:
7575
mod_path = os.path.join(sp, "nvidia", "cuda_nvrtc", "bin")
7676
if not os.path.isdir(mod_path):
7777
continue
78-
os.add_dll_directory(mod_path)
78+
else:
79+
os.add_dll_directory(mod_path)
80+
break
7981
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS = 0x00001000
8082
LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR = 0x00000100
8183
try:

cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ cdef load_library(const int driver_ver):
6767
mod_path = os.path.join(sp, "nvidia", "nvJitLink", "bin")
6868
if not os.path.isdir(mod_path):
6969
continue
70-
os.add_dll_directory(mod_path)
70+
else:
71+
os.add_dll_directory(mod_path)
72+
break
7173
try:
7274
handle = win32api.LoadLibraryEx(
7375
# Note: LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR needs an abs path...

cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx

+4-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ cdef load_library(const int driver_ver):
5050
for suffix in get_nvvm_dso_version_suffix(driver_ver):
5151
if len(suffix) == 0:
5252
continue
53-
dll_name = "nvvm64_40_0"
53+
dll_name = "nvvm64_40_0.dll"
5454

5555
# First check if the DLL has been loaded by 3rd parties
5656
try:
@@ -69,7 +69,9 @@ cdef load_library(const int driver_ver):
6969
mod_path = os.path.join(sp, "nvidia", "cuda_nvcc", "nvvm", "bin")
7070
if not os.path.isdir(mod_path):
7171
continue
72-
os.add_dll_directory(mod_path)
72+
else:
73+
os.add_dll_directory(mod_path)
74+
break
7375
try:
7476
handle = win32api.LoadLibraryEx(
7577
# Note: LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR needs an abs path...

0 commit comments

Comments
 (0)