File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
cuda_bindings/cuda/bindings/_bindings Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ cdef bint __cuPythonInit = False
4646{{if 'nvrtcSetFlowCallback' in found_functions}}cdef void *__nvrtcSetFlowCallback = NULL{{endif}}
4747
4848cdef int cuPythonInit() except -1 nogil:
49+ {{if 'Windows' != platform.system()}}
50+ cdef char* err_msg
51+ {{endif}}
52+
4953 global __cuPythonInit
5054 if __cuPythonInit:
5155 return 0
@@ -97,7 +101,12 @@ cdef int cuPythonInit() except -1 nogil:
97101 handle = dlfcn.dlopen('libnvrtc.so.12', dlfcn.RTLD_NOW)
98102 if handle == NULL:
99103 with gil:
100- raise RuntimeError('Failed to dlopen libnvrtc.so.12')
104+ err_msg = dlfcn.dlerror()
105+ if err_msg == NULL:
106+ err_msg_str = 'Unknown error'
107+ else:
108+ err_msg_str = err_msg.decode('utf-8', errors='backslashreplace')
109+ raise RuntimeError(f'Failed to dlopen libnvrtc.so.12: {err_msg_str}')
101110 {{endif}}
102111
103112
You can’t perform that action at this time.
0 commit comments