Skip to content

Commit 746cee0

Browse files
committed
Fix another os.path.exists(None) issue:
``` ______________________ ERROR collecting test_nvjitlink.py ______________________ tests/test_nvjitlink.py:62: in <module> not check_nvjitlink_usable(), reason="nvJitLink not usable, maybe not installed or too old (<12.3)" tests/test_nvjitlink.py:58: in check_nvjitlink_usable return inner_nvjitlink._inspect_function_pointer("__nvJitLinkVersion") != 0 cuda/bindings/_internal/nvjitlink.pyx:257: in cuda.bindings._internal.nvjitlink._inspect_function_pointer ??? cuda/bindings/_internal/nvjitlink.pyx:260: in cuda.bindings._internal.nvjitlink._inspect_function_pointer ??? cuda/bindings/_internal/nvjitlink.pyx:208: in cuda.bindings._internal.nvjitlink._inspect_function_pointers ??? cuda/bindings/_internal/nvjitlink.pyx:102: in cuda.bindings._internal.nvjitlink._check_or_init_nvjitlink ??? cuda/bindings/_internal/nvjitlink.pyx:59: in cuda.bindings._internal.nvjitlink.load_library ??? /opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:313: in get_cuda_paths "libdevice": _get_libdevice_paths(), /opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:126: in _get_libdevice_paths by, libdir = _get_libdevice_path_decision() /opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/site-packages/cuda/bindings/path_finder.py:73: in _get_libdevice_path_decision if os.path.exists(libdevice_ctk_dir): <frozen genericpath>:19: in exists ??? E TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType ```
1 parent 4133132 commit 746cee0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

cuda_bindings/cuda/bindings/path_finder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def _get_libdevice_path_decision():
7070
("NVIDIA NVCC Wheel", get_libdevice_wheel()),
7171
]
7272
libdevice_ctk_dir = get_system_ctk("nvvm", "libdevice")
73-
if os.path.exists(libdevice_ctk_dir):
73+
if libdevice_ctk_dir and os.path.exists(libdevice_ctk_dir):
7474
options.append(("System", libdevice_ctk_dir))
7575

7676
by, libdir = _find_valid_path(options)

0 commit comments

Comments
 (0)