Skip to content

Commit 211164d

Browse files
committed
PARTIALLY_SUPPORTED_LIBNAMES_LINUX, PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS
1 parent 7da74bd commit 211164d

File tree

2 files changed

+36
-14
lines changed

2 files changed

+36
-14
lines changed

cuda_bindings/cuda/bindings/_path_finder/supported_libs.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44

55
# THIS FILE NEEDS TO BE REVIEWED/UPDATED FOR EACH CTK RELEASE
66

7+
import sys
8+
79
SUPPORTED_LIBNAMES = (
810
# Core CUDA Runtime and Compiler
911
"nvJitLink",
1012
"nvrtc",
1113
"nvvm",
1214
)
1315

14-
PARTIALLY_SUPPORTED_LIBNAMES = (
16+
PARTIALLY_SUPPORTED_LIBNAMES_COMMON = (
1517
# Core CUDA Runtime and Compiler
1618
"cudart",
1719
"nvfatbin",
@@ -37,11 +39,31 @@
3739
"npps",
3840
"nvblas",
3941
# Other
42+
"nvjpeg",
43+
)
44+
45+
PARTIALLY_SUPPORTED_LIBNAMES_LINUX_ONLY = (
4046
"cufile",
4147
# "cufile_rdma", # Requires libmlx5.so
42-
"nvjpeg",
4348
)
4449

50+
PARTIALLY_SUPPORTED_LIBNAMES_LINUX = PARTIALLY_SUPPORTED_LIBNAMES_COMMON + PARTIALLY_SUPPORTED_LIBNAMES_LINUX_ONLY
51+
52+
PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS_ONLY = ()
53+
54+
PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS = PARTIALLY_SUPPORTED_LIBNAMES_COMMON + PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS_ONLY
55+
56+
PARTIALLY_SUPPORTED_LIBNAMES_ALL = (
57+
PARTIALLY_SUPPORTED_LIBNAMES_COMMON
58+
+ PARTIALLY_SUPPORTED_LIBNAMES_LINUX_ONLY
59+
+ PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS_ONLY
60+
)
61+
62+
if sys.platform == "win32":
63+
PARTIALLY_SUPPORTED_LIBNAMES = PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS
64+
else:
65+
PARTIALLY_SUPPORTED_LIBNAMES = PARTIALLY_SUPPORTED_LIBNAMES_LINUX
66+
4567
# Based on ldd output for Linux x86_64 nvidia-*-cu12 wheels (12.8.1)
4668
DIRECT_DEPENDENCIES = {
4769
"cublas": ("cublasLt",),
@@ -231,8 +253,6 @@
231253
"cufftw64_10.dll",
232254
"cufftw64_11.dll",
233255
),
234-
"cufile": (),
235-
# "cufile_rdma": (),
236256
"curand": ("curand64_10.dll",),
237257
"cusolver": (
238258
"cusolver64_10.dll",

cuda_bindings/tests/test_path_finder.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,28 @@
77
from cuda.bindings import path_finder
88
from cuda.bindings._path_finder import supported_libs
99

10-
ALL_LIBNAMES = path_finder.SUPPORTED_LIBNAMES + supported_libs.PARTIALLY_SUPPORTED_LIBNAMES
10+
ALL_LIBNAMES = path_finder.SUPPORTED_LIBNAMES + supported_libs.PARTIALLY_SUPPORTED_LIBNAMES_ALL
11+
ALL_LIBNAMES_LINUX = path_finder.SUPPORTED_LIBNAMES + supported_libs.PARTIALLY_SUPPORTED_LIBNAMES_LINUX
12+
ALL_LIBNAMES_WINDOWS = path_finder.SUPPORTED_LIBNAMES + supported_libs.PARTIALLY_SUPPORTED_LIBNAMES_WINDOWS
1113
if os.environ.get("CUDA_BINDINGS_PATH_FINDER_TEST_ALL_LIBNAMES", False):
12-
TEST_LIBNAMES = ALL_LIBNAMES
14+
if sys.platform == "win32":
15+
TEST_FIND_OR_LOAD_LIBNAMES = ALL_LIBNAMES_WINDOWS
16+
else:
17+
TEST_FIND_OR_LOAD_LIBNAMES = ALL_LIBNAMES_LINUX
1318
else:
14-
TEST_LIBNAMES = path_finder.SUPPORTED_LIBNAMES
19+
TEST_FIND_OR_LOAD_LIBNAMES = path_finder.SUPPORTED_LIBNAMES
1520

1621

1722
def test_all_libnames_linux_sonames_consistency():
18-
assert tuple(sorted(ALL_LIBNAMES)) == tuple(sorted(supported_libs.SUPPORTED_LINUX_SONAMES.keys()))
23+
assert tuple(sorted(ALL_LIBNAMES_LINUX)) == tuple(sorted(supported_libs.SUPPORTED_LINUX_SONAMES.keys()))
1924

2025

2126
def test_all_libnames_windows_dlls_consistency():
22-
assert tuple(sorted(ALL_LIBNAMES)) == tuple(sorted(supported_libs.SUPPORTED_WINDOWS_DLLS.keys()))
27+
assert tuple(sorted(ALL_LIBNAMES_WINDOWS)) == tuple(sorted(supported_libs.SUPPORTED_WINDOWS_DLLS.keys()))
2328

2429

2530
def test_all_libnames_libnames_requiring_os_add_dll_directory_consistency():
26-
assert not (set(supported_libs.LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY) - set(ALL_LIBNAMES))
31+
assert not (set(supported_libs.LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY) - set(ALL_LIBNAMES_WINDOWS))
2732

2833

2934
def test_all_libnames_expected_lib_symbols_consistency():
@@ -45,11 +50,8 @@ def _build_subprocess_failed_for_libname_message(libname, result):
4550

4651

4752
@pytest.mark.parametrize("api", ("find", "load"))
48-
@pytest.mark.parametrize("libname", TEST_LIBNAMES)
53+
@pytest.mark.parametrize("libname", TEST_FIND_OR_LOAD_LIBNAMES)
4954
def test_find_or_load_nvidia_dynamic_library(info_summary_append, api, libname):
50-
if sys.platform == "win32" and not supported_libs.SUPPORTED_WINDOWS_DLLS[libname]:
51-
pytest.skip(f"{libname=!r} not supported on {sys.platform=}")
52-
5355
if libname == "nvJitLink" and not _check_nvjitlink_usable():
5456
pytest.skip(f"{libname=!r} not usable")
5557

0 commit comments

Comments
 (0)