Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 321
Support non-CTK Nvidia libraries#864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
eeef550678947bc3e5d336421b498dc6dd57376bef37b8822d12cc2cf3db8871951ab7c6fe20afcc7a7c72fa7590b06db90eaecd31f2a917959d34b6adc349a79351711ff2d3c5f2d332a6eda37957fe46a7f57012485f170b198c6cea192f33d7c81b216d73c900ae58a25201c939a7acc226bb5b12f09678a86fcdd97787a8e43784723f68b411ea8a9506ad720880c3cd201c0a0e5571160202a9bea69d7c98File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -63,7 +63,7 @@ | ||
| SUPPORTED_LIBNAMES = SUPPORTED_LIBNAMES_WINDOWS if IS_WINDOWS else SUPPORTED_LIBNAMES_LINUX | ||
| # Based on ldd output for Linux x86_64 nvidia-*-cu12 wheels (12.8.1) | ||
| DIRECT_DEPENDENCIES = { | ||
| DIRECT_DEPENDENCIES_CTK = { | ||
| "cublas": ("cublasLt",), | ||
| "cufftw": ("cufft",), | ||
| # "cufile_rdma": ("cufile",), | ||
| @@ -82,6 +82,10 @@ | ||
| "npps": ("nppc",), | ||
| "nvblas": ("cublas", "cublasLt"), | ||
| } | ||
| DIRECT_DEPENDENCIES = DIRECT_DEPENDENCIES_CTK | { | ||
| "mathdx": ("nvrtc",), | ||
| "cufftMp": ("nvshmem_host",), | ||
| } | ||
| # Based on these released files: | ||
| # cuda_11.0.3_450.51.06_linux.run | ||
| @@ -104,7 +108,7 @@ | ||
| # cuda_12.9.1_575.57.08_linux.run | ||
| # cuda_13.0.0_580.65.06_linux.run | ||
| # Generated with toolshed/build_pathfinder_sonames.py | ||
| SUPPORTED_LINUX_SONAMES = { | ||
| SUPPORTED_LINUX_SONAMES_CTK = { | ||
| "cublas": ( | ||
| "libcublas.so.11", | ||
| "libcublas.so.12", | ||
| @@ -232,6 +236,13 @@ | ||
| "libnvvm.so.4", | ||
| ), | ||
| } | ||
| SUPPORTED_LINUX_SONAMES_OTHER = { | ||
| "cufftMp": ("libcufftMp.so.11",), | ||
| "mathdx": ("libmathdx.so.0",), | ||
| "nvpl_fftw": ("libnvpl_fftw.so.0",), | ||
| "nvshmem_host": ("libnvshmem_host.so.3",), | ||
| } | ||
| SUPPORTED_LINUX_SONAMES = SUPPORTED_LINUX_SONAMES_CTK | SUPPORTED_LINUX_SONAMES_OTHER | ||
| # Based on these released files: | ||
| # cuda_11.0.3_451.82_win10.exe | ||
| @@ -254,7 +265,7 @@ | ||
| # cuda_12.9.1_576.57_windows.exe | ||
| # cuda_13.0.0_windows.exe | ||
| # Generated with toolshed/build_pathfinder_dlls.py | ||
| SUPPORTED_WINDOWS_DLLS = { | ||
| SUPPORTED_WINDOWS_DLLS_CTK = { | ||
| "cublas": ( | ||
| "cublas64_11.dll", | ||
| "cublas64_12.dll", | ||
| @@ -384,12 +395,91 @@ | ||
| "nvvm70.dll", | ||
| ), | ||
| } | ||
| SUPPORTED_WINDOWS_DLLS_OTHER = { | ||
| "mathdx": ("mathdx64_0.dll",), | ||
| } | ||
| SUPPORTED_WINDOWS_DLLS = SUPPORTED_WINDOWS_DLLS_CTK | SUPPORTED_WINDOWS_DLLS_OTHER | ||
| LIBNAMES_REQUIRING_OS_ADD_DLL_DIRECTORY = ( | ||
| "cufft", | ||
| "nvrtc", | ||
| ) | ||
| LIBNAMES_REQUIRING_RTLD_DEEPBIND = ("cufftMp",) | ||
| # Based on output of toolshed/make_site_packages_libdirs_linux.py | ||
| SITE_PACKAGES_LIBDIRS_LINUX_CTK = { | ||
| "cublas": ("nvidia/cu13/lib", "nvidia/cublas/lib"), | ||
| "cublasLt": ("nvidia/cu13/lib", "nvidia/cublas/lib"), | ||
| "cudart": ("nvidia/cu13/lib", "nvidia/cuda_runtime/lib"), | ||
| "cufft": ("nvidia/cu13/lib", "nvidia/cufft/lib"), | ||
| "cufftw": ("nvidia/cu13/lib", "nvidia/cufft/lib"), | ||
| "cufile": ("nvidia/cu13/lib", "nvidia/cufile/lib"), | ||
| # "cufile_rdma": ("nvidia/cu13/lib", "nvidia/cufile/lib"), | ||
| "curand": ("nvidia/cu13/lib", "nvidia/curand/lib"), | ||
| "cusolver": ("nvidia/cu13/lib", "nvidia/cusolver/lib"), | ||
| "cusolverMg": ("nvidia/cu13/lib", "nvidia/cusolver/lib"), | ||
| "cusparse": ("nvidia/cu13/lib", "nvidia/cusparse/lib"), | ||
| "nppc": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppial": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppicc": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppidei": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppif": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppig": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppim": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppist": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppisu": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nppitc": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "npps": ("nvidia/cu13/lib", "nvidia/npp/lib"), | ||
| "nvJitLink": ("nvidia/cu13/lib", "nvidia/nvjitlink/lib"), | ||
| "nvblas": ("nvidia/cu13/lib", "nvidia/cublas/lib"), | ||
| "nvfatbin": ("nvidia/cu13/lib", "nvidia/nvfatbin/lib"), | ||
| "nvjpeg": ("nvidia/cu13/lib", "nvidia/nvjpeg/lib"), | ||
| "nvrtc": ("nvidia/cu13/lib", "nvidia/cuda_nvrtc/lib"), | ||
| "nvvm": ("nvidia/cu13/lib", "nvidia/cuda_nvcc/nvvm/lib64"), | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh man, so in CUDA 13 the Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is annoying... so the wheel layout for NVVM is changed, but not the system CTK which still has $ tree /usr/local/cuda-13.0/nvvm/
/usr/local/cuda-13.0/nvvm/
├── bin
│ └── cicc
├── include
│ └── nvvm.h
├── lib64
│ ├── libnvvm.so -> libnvvm.so.4
│ ├── libnvvm.so.4 -> libnvvm.so.4.0.0
│ └── libnvvm.so.4.0.0
└── libdevice
└── libdevice.10.bc
4 directories, 6 files | ||
| } | ||
| SITE_PACKAGES_LIBDIRS_LINUX_OTHER = { | ||
| "cufftMp": ("nvidia/cufftmp/cu12/lib",), | ||
| "mathdx": ("nvidia/cu13/lib", "nvidia/cu12/lib"), | ||
| "nvpl_fftw": ("nvpl/lib",), | ||
| "nvshmem_host": ("nvidia/nvshmem/lib",), | ||
| } | ||
| SITE_PACKAGES_LIBDIRS_LINUX = SITE_PACKAGES_LIBDIRS_LINUX_CTK | SITE_PACKAGES_LIBDIRS_LINUX_OTHER | ||
| # Based on output of toolshed/make_site_packages_libdirs_windows.py | ||
| SITE_PACKAGES_LIBDIRS_WINDOWS_CTK = { | ||
| "cublas": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), | ||
| "cublasLt": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), | ||
| "cudart": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_runtime/bin"), | ||
| "cufft": ("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), | ||
| "cufftw": ("nvidia/cu13/bin/x86_64", "nvidia/cufft/bin"), | ||
| "curand": ("nvidia/cu13/bin/x86_64", "nvidia/curand/bin"), | ||
| "cusolver": ("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), | ||
| "cusolverMg": ("nvidia/cu13/bin/x86_64", "nvidia/cusolver/bin"), | ||
| "cusparse": ("nvidia/cu13/bin/x86_64", "nvidia/cusparse/bin"), | ||
| "nppc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppial": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppicc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppidei": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppif": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppig": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppim": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppist": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppisu": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nppitc": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "npps": ("nvidia/cu13/bin/x86_64", "nvidia/npp/bin"), | ||
| "nvJitLink": ("nvidia/cu13/bin/x86_64", "nvidia/nvjitlink/bin"), | ||
| "nvblas": ("nvidia/cu13/bin/x86_64", "nvidia/cublas/bin"), | ||
| "nvfatbin": ("nvidia/cu13/bin/x86_64", "nvidia/nvfatbin/bin"), | ||
| "nvjpeg": ("nvidia/cu13/bin/x86_64", "nvidia/nvjpeg/bin"), | ||
| "nvrtc": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvrtc/bin"), | ||
| "nvvm": ("nvidia/cu13/bin/x86_64", "nvidia/cuda_nvcc/nvvm/bin"), | ||
| } | ||
| SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER = { | ||
| "mathdx": ("nvidia/cu13/bin/x86_64", "nvidia/cu12/bin"), | ||
| } | ||
| SITE_PACKAGES_LIBDIRS_WINDOWS = SITE_PACKAGES_LIBDIRS_WINDOWS_CTK | SITE_PACKAGES_LIBDIRS_WINDOWS_OTHER | ||
| def is_suppressed_dll_file(path_basename: str) -> bool: | ||
| if path_basename.startswith("nvrtc"): | ||
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| import collections | ||
| import functools | ||
| import importlib.metadata | ||
| @functools.cache | ||
| def find_all_dll_files_via_metadata() -> dict[str, tuple[str, ...]]: | ||
| results: collections.defaultdict[str, list[str]] = collections.defaultdict(list) | ||
| # sort dists for deterministic output | ||
| for dist in sorted(importlib.metadata.distributions(), key=lambda d: (d.metadata.get("Name", ""), d.version)): | ||
| files = dist.files | ||
| if not files: | ||
| continue | ||
| for relpath in sorted(files, key=lambda p: str(p)): # deterministic | ||
| relname = relpath.name.lower() | ||
| if not relname.endswith(".dll"): | ||
| continue | ||
| abs_path = str(dist.locate_file(relpath)) | ||
| results[relname].append(abs_path) | ||
| # plain dicts; sort inner list for stability | ||
| return {k: tuple(sorted(v)) for k, v in results.items()} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| import collections | ||
| import functools | ||
| import importlib.metadata | ||
| import re | ||
| _SO_RE = re.compile(r"\.so(?:$|\.)") # matches libfoo.so or libfoo.so.1.2.3 | ||
| def split_so_version_suffix(so_filename: str) -> tuple[str, str]: | ||
| idx = so_filename.rfind(".so") | ||
| assert idx > 0, so_filename | ||
| idx += 3 | ||
| return (so_filename[:idx], so_filename[idx:]) | ||
| @functools.cache | ||
| def find_all_so_files_via_metadata() -> dict[str, dict[str, tuple[str, ...]]]: | ||
| results: collections.defaultdict[str, collections.defaultdict[str, list[str]]] = collections.defaultdict( | ||
| lambda: collections.defaultdict(list) | ||
| ) | ||
| # sort dists for deterministic output | ||
| for dist in sorted(importlib.metadata.distributions(), key=lambda d: (d.metadata.get("Name", ""), d.version)): | ||
| files = dist.files | ||
| if not files: | ||
| continue | ||
| for relpath in sorted(files, key=lambda p: str(p)): # deterministic | ||
| relname = relpath.name | ||
| if not _SO_RE.search(relname): | ||
| continue | ||
| so_basename, so_version_suffix = split_so_version_suffix(relname) | ||
| abs_path = str(dist.locate_file(relpath)) | ||
| results[so_basename][so_version_suffix].append(abs_path) | ||
| # plain dicts; sort inner lists for stability | ||
| return {k: {kk: tuple(sorted(vv)) for kk, vv in v.items()} for k, v in results.items()} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| __version__ = "1.1.1a2" | ||
| __version__ = "1.1.1a3" |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: is deepbind needed so as to avoid symbol collision with libcufft?