Skip to content

Commit d4ad29f

Browse files
committed
Fix check
1 parent 1f4d738 commit d4ad29f

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

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

+11-5
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,29 @@ cdef int cuPythonInit() except -1 nogil:
4545
with gil:
4646
# First check if the DLL has been loaded by 3rd parties
4747
try:
48-
handle = win32api.LoadLibraryEx("nvrtc64_112_0.dll", 0, LOAD_LIBRARY_SAFE_CURRENT_DIRS)
48+
handle = win32api.GetModuleHandle("nvrtc64_112_0.dll")
4949
except:
5050
try:
51-
handle = win32api.LoadLibraryEx("nvrtc64_111_0.dll", 0, LOAD_LIBRARY_SAFE_CURRENT_DIRS)
51+
handle = win32api.GetModuleHandle("nvrtc64_111_0.dll")
5252
except:
5353
try:
54-
handle = win32api.LoadLibraryEx("nvrtc64_110_0.dll", 0, LOAD_LIBRARY_SAFE_CURRENT_DIRS)
54+
handle = win32api.GetModuleHandle("nvrtc64_110_0.dll")
5555
except:
5656
handle = None
5757

5858
# Else try default search
5959
if not handle:
6060
LOAD_LIBRARY_SAFE_CURRENT_DIRS = 0x00002000
6161
try:
62-
handle = win32api.LoadLibraryEx("nvrtc64_120_0.dll", 0, LOAD_LIBRARY_SAFE_CURRENT_DIRS)
62+
handle = win32api.LoadLibraryEx("nvrtc64_112_0.dll", 0, LOAD_LIBRARY_SAFE_CURRENT_DIRS)
6363
except:
64-
pass
64+
try:
65+
handle = win32api.LoadLibraryEx("nvrtc64_111_0.dll", 0, LOAD_LIBRARY_SAFE_CURRENT_DIRS)
66+
except:
67+
try:
68+
handle = win32api.LoadLibraryEx("nvrtc64_110_0.dll", 0, LOAD_LIBRARY_SAFE_CURRENT_DIRS)
69+
except:
70+
pass
6571

6672
# Final check if DLLs can be found within pip installations
6773
if not handle:

0 commit comments

Comments
 (0)