Skip to content

Commit 9390c85

Browse files
committed
Fix misunderstanding: RuntimeError is raised only from inner_nvjitlink._inspect_function_pointer()
1 parent 9ad6bcd commit 9390c85

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cuda_core/cuda/core/experimental/_linker.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,16 @@ def libname():
4949
_nvjitlink = importlib.import_module("cuda.bindings.nvjitlink")
5050
except ModuleNotFoundError:
5151
problem = "cuda.bindings.nvjitlink is not available, therefore"
52-
except RuntimeError:
53-
problem = libname() + " is not available" + therefore_not_usable
5452
else:
5553
from cuda.bindings._internal import nvjitlink as inner_nvjitlink
5654

57-
if inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion"):
58-
return False # Use nvjitlink
59-
60-
problem = libname() + " is is too old (<12.3)" + therefore_not_usable
55+
try:
56+
if inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion"):
57+
return False # Use nvjitlink
58+
except RuntimeError:
59+
problem = libname() + " is not available" + therefore_not_usable
60+
else:
61+
problem = libname() + " is is too old (<12.3)" + therefore_not_usable
6162
_nvjitlink = None
6263

6364
warn(

0 commit comments

Comments
 (0)