Skip to content

Commit 8a9941a

Browse files
committed
Fix Windows
1 parent 495ffb9 commit 8a9941a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cuda_bindings/cuda/bindings/cyruntime.pyx.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,10 +1901,11 @@ cdef cudaError_t getLocalRuntimeVersion(int* runtimeVersion) except ?cudaErrorCa
19011901
handle = <void *><uintptr_t>lib._handle_uint
19021902

19031903
{{if 'Windows' == platform.system()}}
1904-
try:
1905-
__cudaRuntimeGetVersion = <void*><unsigned long long>win32api.GetProcAddress(<uintptr_t>handle, 'cudaRuntimeGetVersion')
1906-
except:
1907-
pass
1904+
with gil:
1905+
try:
1906+
__cudaRuntimeGetVersion = <void*><unsigned long long>win32api.GetProcAddress(<uintptr_t>handle, 'cudaRuntimeGetVersion')
1907+
except:
1908+
pass
19081909
{{else}}
19091910
__cudaRuntimeGetVersion = dlfcn.dlsym(handle, 'cudaRuntimeGetVersion')
19101911
{{endif}}

0 commit comments

Comments
 (0)