Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
eeef550
Add find_site_packages_so.py
rwgk Aug 19, 2025
678947b
Use find_all_so_files_under_all_site_packages() from _find_so_using_n…
rwgk Aug 19, 2025
c3e5d33
Bump cuda-pathfinder version to `1.1.1a3`
rwgk Aug 19, 2025
6421b49
Limit site-packages search to ("nvidia", "nvpl") subdirs.
rwgk Aug 19, 2025
8dc6dd5
Replace find_all_so_files_under_all_site_packages → find_all_so_files…
rwgk Aug 19, 2025
7376bef
Add find_site_packages_dll.py and use from _find_dll_using_nvidia_bin…
rwgk Aug 20, 2025
37b8822
Add mathdx, cufftMp DIRECT_DEPENDENCIES
rwgk Aug 20, 2025
d12cc2c
Add LIBNAMES_REQUIRING_RTLD_DEEPBIND feature (for cufftMp)
rwgk Aug 20, 2025
f3db887
pyproject.toml: add libmathdx, cufftmpm nvshmem, nvpl-fft wheels for …
rwgk Aug 20, 2025
1951ab7
Add SITE_PACKAGES_LIBDIRS_LINUX
rwgk Aug 20, 2025
c6fe20a
Add make_site_packages_libdirs_linux.py
rwgk Aug 20, 2025
fcc7a7c
Use SITE_PACKAGES_LIBDIRS_LINUX in _find_so_using_nvidia_lib_dirs, ke…
rwgk Aug 20, 2025
72fa759
Add SITE_PACKAGES_LIBDIRS_WINDOWS and toolshed/make_site_packages_lib…
rwgk Aug 20, 2025
0b06db9
chmod 755 make_site_packages_libdirs_windows.py
rwgk Aug 20, 2025
0eaecd3
Adds paths for the CUDA static library based on CUDA_HOME (#608).
Andy-Jost Aug 14, 2025
1f2a917
Removes LIB and LIBRARY_PATH environment variables from the build-whe…
Andy-Jost Aug 19, 2025
959d34b
Updates Linux install to search both lib and lib64 directories for CU…
Andy-Jost Aug 19, 2025
6adc349
Removes LIBRARY_PATH environment variable from installation docs (no …
Andy-Jost Aug 20, 2025
a793517
Use SITE_PACKAGES_LIBDIRS_WINDOWS in _find_dll_using_nvidia_bin_dirs,…
rwgk Aug 20, 2025
11ff2d3
Merge branch 'main' into find_all_dynamic_libs_under_all_site_packages
rwgk Aug 20, 2025
c5f2d33
Factor out SITE_PACKAGES_LIBDIRS_*_CTK, add test_supported_libnames_*…
rwgk Aug 20, 2025
2a6eda3
Also exercise "other" (non-CTK) libnames in test_load_nvidia_dynamic_…
rwgk Aug 20, 2025
7957fe4
Exercise fallback code path using pygit2 wheel.
rwgk Aug 21, 2025
6a7f570
Merge branch 'main' into find_all_dynamic_libs_under_all_site_packages
rwgk Aug 21, 2025
12485f1
Add other_wheels,foreign_wheels to pip install nvidia_wheels_cu13
rwgk Aug 21, 2025
70b198c
Add toolshed/collect_site_packages_so_files.sh, with terse Usage comm…
rwgk Aug 21, 2025
6cea192
Add toolshed/collect_site_packages_dll_files.ps1 with terse Usage com…
rwgk Aug 21, 2025
f33d7c8
Add pygit2 comments.
rwgk Aug 21, 2025
1b216d7
Replace special-case workaround in tests/child_load_nvidia_dynamic_li…
rwgk Aug 21, 2025
3c900ae
Add anticipated CTK 13 paths for mathdx in SITE_PACKAGES_LIBDIRS_LINU…
rwgk Aug 21, 2025
58a2520
Rename other_wheels → nvidia_wheels_host
rwgk Aug 21, 2025
1c939a7
WIP
rwgk Aug 21, 2025
acc226b
Restore _no_such_file_in_sub_dirs error reporting
rwgk Aug 21, 2025
b5b12f0
Merge branch 'main' into find_all_dynamic_libs_under_all_site_packages
rwgk Aug 21, 2025
9678a86
Merge branch 'main' into find_all_dynamic_libs_under_all_site_packages
rwgk Aug 22, 2025
fcdd977
Use `pip install -v ".[nvidia_wheels_cu${TEST_CUDA_MAJOR},nvidia_whee…
rwgk Aug 22, 2025
87a8e43
Export TEST_CUDA_MAJOR to the GITHUB_ENV
rwgk Aug 22, 2025
784723f
Merge branch 'main' into find_all_dynamic_libs_under_all_site_packages
rwgk Aug 22, 2025
68b411e
Merge branch 'main' into find_all_dynamic_libs_under_all_site_packages
rwgk Aug 26, 2025
a8a9506
Fix existing (on main) pre-commit error
rwgk Aug 26, 2025
ad72088
Do not install nvidia-cufftmp-cu12 on Windows (it is only a placehold…
rwgk Aug 26, 2025
0c3cd20
Leo's --only-binary=:all: suggestions
rwgk Aug 26, 2025
1c0a0e5
Leo's --only-binary=:all: suggestions (toolshed scripts)
rwgk Aug 26, 2025
5711602
Remove fallback code paths in _find_so_using_nvidia_lib_dirs, _find_d…
rwgk Aug 27, 2025
02a9bea
Merge branch 'main' into find_all_dynamic_libs_under_all_site_packages
rwgk Aug 27, 2025
69d7c98
Consolidate make_site_packages_libdirs_linux.py + make_site_packages_…
rwgk Aug 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use SITE_PACKAGES_LIBDIRS_LINUX in _find_so_using_nvidia_lib_dirs, ke…
…ep find_all_so_files_via_metadata as fallback
  • Loading branch information
rwgk committed Aug 20, 2025
commit fcc7a7ca322a6ac2a898f0be10ced9aaa2106e22
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from cuda.pathfinder._dynamic_libs.load_dl_common import DynamicLibNotFoundError
from cuda.pathfinder._dynamic_libs.supported_nvidia_libs import (
IS_WINDOWS,
SITE_PACKAGES_LIBDIRS_LINUX,
is_suppressed_dll_file,
)
from cuda.pathfinder._utils.find_site_packages_dll import find_all_dll_files_via_metadata
Expand All @@ -27,13 +28,31 @@ def _no_such_file_in_sub_dirs(
attachments.append(f" {node}")


def _find_so_using_nvidia_lib_dirs(so_basename: str) -> Optional[str]:
candidates = find_all_so_files_via_metadata().get(so_basename)
if not candidates:
return None
so_versions = candidates.keys()
all_abs_paths: list[str] = candidates[next(iter(sorted(so_versions)))]
return next(iter(sorted(all_abs_paths)))
def _find_so_using_nvidia_lib_dirs(libname: str, so_basename: str) -> Optional[str]:
rel_dirs = SITE_PACKAGES_LIBDIRS_LINUX.get(libname)
if rel_dirs is not None:
# Fast direct access with minimal globbing.
file_wild = so_basename + "*"
for rel_dir in rel_dirs:
for abs_dir in find_sub_dirs_all_sitepackages(tuple(rel_dir.split(os.path.sep))):
# First look for an exact match
so_name = os.path.join(abs_dir, so_basename)
if os.path.isfile(so_name):
return so_name
# Look for a versioned library
# Using sort here mainly to make the result deterministic.
for so_name in sorted(glob.glob(os.path.join(abs_dir, file_wild))):
if os.path.isfile(so_name):
return so_name
else:
# This fallback is relatively slow, but acceptable.
candidates = find_all_so_files_via_metadata().get(so_basename)
if candidates:
so_versions = candidates.keys()
# For now, simply take the first candidate after sorting.
all_abs_paths: list[str] = candidates[next(iter(sorted(so_versions)))]
return next(iter(sorted(all_abs_paths)))
return None


def _find_dll_under_dir(dirpath: str, file_wild: str) -> Optional[str]:
Expand Down Expand Up @@ -143,7 +162,7 @@ def __init__(self, libname: str):
else:
self.lib_searched_for = f"lib{libname}.so"
if self.abs_path is None:
self.abs_path = _find_so_using_nvidia_lib_dirs(self.lib_searched_for)
self.abs_path = _find_so_using_nvidia_lib_dirs(libname, self.lib_searched_for)

def retry_with_cuda_home_priority_last(self) -> None:
cuda_home_lib_dir = _find_lib_dir_using_cuda_home(self.libname)
Expand Down