-
Notifications
You must be signed in to change notification settings - Fork 175
Move pathfinder
to cuda-python top level
#723
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
base: main
Are you sure you want to change the base?
Changes from all commits
fbdebfa
731256d
6e0ec6c
07e1385
68aa8d5
fafa998
4eff7d2
db0f540
9fea2e7
c494ef2
78b8c6d
5690d96
81b9bd9
b9be5cb
79a8019
975ba0b
3678fb4
c25184e
58b2513
050f857
1933869
50f4f8e
787236c
5b5078b
13e08ae
97f9dc8
e18cf05
b015bbe
36491c8
c6187db
346e8b9
9207966
3682f7d
7742c5c
92c8441
a5b7190
db0ea56
9a9f1d7
aac1cf7
989db08
222df6c
0b8af00
f902dc9
481f8de
fd18e1e
796bd46
06763af
b2135cf
bf48142
135a37d
48c6d63
7ab201a
9f3e9a4
00c8b6a
034286a
aaed5f2
9d8c70c
8440f90
98ae874
9686c2f
f3c0006
8f015d2
9f17cd1
db7933a
1b9a929
b69bf23
80ebbda
1c8d315
52e1369
70d1c14
342ca49
4e0033c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1 @@ | ||
# `cuda.bindings.path_finder` Module | ||
|
||
## Public API (Work in Progress) | ||
|
||
Currently exposes two primary interfaces: | ||
|
||
``` | ||
cuda.bindings.path_finder._SUPPORTED_LIBNAMES # ('nvJitLink', 'nvrtc', 'nvvm') | ||
cuda.bindings.path_finder._load_nvidia_dynamic_library(libname: str) -> LoadedDL | ||
``` | ||
|
||
**Note:** | ||
These APIs are prefixed with an underscore because they are considered | ||
experimental while undergoing active development, although already | ||
reasonably well-tested through CI pipelines. | ||
|
||
## Library Loading Search Priority | ||
|
||
The `load_nvidia_dynamic_library()` function implements a hierarchical search | ||
strategy for locating NVIDIA shared libraries: | ||
|
||
0. **Check if a library was loaded into the process already by some other means.** | ||
- If yes, there is no alternative to skipping the rest of the search logic. | ||
The absolute path of the already loaded library will be returned, along | ||
with the handle to the library. | ||
|
||
1. **NVIDIA Python wheels** | ||
- Scans all site-packages to find libraries installed via NVIDIA Python wheels. | ||
|
||
2. **OS default mechanisms / Conda environments** | ||
- Falls back to native loader: | ||
- `dlopen()` on Linux | ||
- `LoadLibraryW()` on Windows | ||
- Conda installations are expected to be discovered: | ||
- Linux: Via `$ORIGIN/../lib` on `RPATH` (of the `python` binary; | ||
note that this preempts `LD_LIBRARY_PATH` and `/etc/ld.so.conf.d/`) | ||
- Windows: Via `%CONDA_PREFIX%\Library\bin` on system `PATH` | ||
- CTK installations with system config updates are expected to be discovered: | ||
- Linux: Via `/etc/ld.so.conf.d/*cuda*.conf` | ||
- Windows: Via `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y\bin` on system `PATH` | ||
|
||
3. **Environment variables** | ||
- Relies on `CUDA_HOME` or `CUDA_PATH` environment variables if set | ||
(in that order). | ||
|
||
Note that the search is done on a per-library basis. There is no centralized | ||
mechanism that ensures all libraries are found in the same way. | ||
|
||
## Maintenance Requirements | ||
|
||
These key components must be updated for new CUDA Toolkit releases: | ||
|
||
- `supported_libs.SUPPORTED_LIBNAMES` | ||
- `supported_libs.SUPPORTED_WINDOWS_DLLS` | ||
- `supported_libs.SUPPORTED_LINUX_SONAMES` | ||
- `supported_libs.EXPECTED_LIB_SYMBOLS` | ||
# The `cuda.bindings.path_finder` module was moved → `cuda.pathfinder` |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
# Copyright 2024-2025 NVIDIA Corporation. All rights reserved. | ||
# | ||
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE | ||
|
||
from cuda.bindings._path_finder.load_nvidia_dynamic_library import ( | ||
load_nvidia_dynamic_library as _load_nvidia_dynamic_library, | ||
) | ||
from cuda.bindings._path_finder.supported_libs import SUPPORTED_LIBNAMES as _SUPPORTED_LIBNAMES | ||
from cuda.pathfinder import SUPPORTED_NVIDIA_LIBNAMES as _SUPPORTED_LIBNAMES | ||
from cuda.pathfinder import load_nvidia_dynamic_lib as _load_nvidia_dynamic_library | ||
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. Can we add some kind of deprecation warning if someone uses 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. Sounds like this is indeed the plan: NVIDIA/numba-cuda#308 (comment) |
||
|
||
__all__ = [ | ||
"_load_nvidia_dynamic_library", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ dynamic = [ | |
"readme", | ||
] | ||
dependencies = [ | ||
"cuda-pathfinder", | ||
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. as discussed in the meeting we probably need a lower bound here 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. I was thinking it's best to add the lower bound as needed? It'll only become a consideration after we have a second |
||
"pywin32; sys_platform == 'win32'", | ||
] | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.