Skip to content

Commit bdfc6a7

Browse files
committed
Update README.md, mostly as revised by perplexity, with various manual edits.
1 parent 9154995 commit bdfc6a7

File tree

1 file changed

+44
-26
lines changed
  • cuda_bindings/cuda/bindings/_path_finder

1 file changed

+44
-26
lines changed
Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,61 @@
1-
`cuda.bindings.path_finder`
2-
===========================
1+
# `cuda.bindings.path_finder` Module
32

4-
Currently, the only two (semi-)public APIs are:
3+
## Public API (Work in Progress)
54

6-
* `cuda.bindings.path_finder._SUPPORTED_LIBNAMES` (currently `('nvJitLink', 'nvrtc', 'nvvm')`)
5+
Currently exposes two primary interfaces:
76

8-
* `cuda.bindings.path_finder._load_nvidia_dynamic_library(libname: str) -> LoadedDL`
7+
```
8+
cuda.bindings.path_finder._SUPPORTED_LIBNAMES # ('nvJitLink', 'nvrtc', 'nvvm')
9+
cuda.bindings.path_finder._load_nvidia_dynamic_library(libname: str) -> LoadedDL
10+
```
911

10-
These APIs are prefixed with an underscore because they are STILL A WORK IN PROGRESS,
11-
although already fairly well tested.
12+
**Note:**
13+
These APIs are prefixed with an underscore because they are considered
14+
experimental while undergoing active development, although already
15+
reasonably well-tested through CI pipelines.
1216

13-
`load_nvidia_dynamic_library()` is meant to become the one, central, go-to API for
14-
loading NVIDIA shared libraries from Python.
17+
## Library Loading Search Priority
1518

19+
The `load_nvidia_dynamic_library()` function implements a hierarchical search
20+
strategy for locating NVIDIA shared libraries:
1621

17-
Search Priority
18-
---------------
22+
1. **Python Package Ecosystem**
23+
- Scans `sys.path` to find libraries installed via NVIDIA Python wheels
1924

20-
The _intended_ search priority for locating NVIDIA dynamic libraries is:
25+
2. **Conda Environments**
26+
- Leverages Conda-specific paths through our fork of `get_cuda_paths()` from Numba
2127

22-
* *site-packages* — Traversal of Python's `sys.path` (in order), which for all practical
23-
purposes amounts to a search for libraries installed from NVIDIA wheels.
28+
3. **System Installations**
29+
- Checks traditional system locations via the same `get_cuda_paths()` implementation
2430

25-
* *Conda* — Currently mplemented via `get_cuda_paths()` as forked from numba/cuda/cuda_paths.py
31+
4. **OS Default Mechanisms**
32+
- Falls back to native loader:
33+
- `dlopen()` on Linux
34+
- `LoadLibraryW()` on Windows
2635

27-
* *System* — Also implemented via `get_cuda_paths()`
36+
## Implementation Philosophy
2837

29-
* *OS-provided search*`dlopen()` (Linux) or `LoadLibraryW()` (Windows) mechanisms
38+
The current implementation balances stability and evolution:
3039

40+
- **Baseline Foundation:** Uses a fork of Numba's `cuda_paths.py` that has been
41+
battle-tested in production environments
3142

32-
Currently, our fork of cuda_paths.py is intentionally used as-is.
33-
cuda_paths.py has a long and convoluted development history, but that also means
34-
the product is time-tested. Our strategy for evolving the implementation is:
43+
- **Validation Infrastructure:** Comprehensive CI testing matrix being developed to cover:
44+
- Various Linux/Windows environments
45+
- Python packaging formats (wheels, conda)
46+
- CUDA Toolkit versions
3547

36-
* Establish a minimal viable product as a baseline (current stage).
48+
- **Roadmap:** Planned refactoring to:
49+
- Unify library discovery logic
50+
- Improve maintainability
51+
- Better enforce search priority
52+
- Expand platform support
3753

38-
* Establish a comprehensive testing infrastructure (GitHub Actions / CI) to
39-
cover all sorts of environments that we want to support.
54+
## Maintenance Requirements
4055

41-
* Combine, refactor, and clean up find_nvidia_dynamic_library.py & cuda_paths.py
42-
to achieve a more maintainable and robust implementation of the intended
43-
dynamic library search priority.
56+
These key components must be updated for new CUDA Toolkit releases:
57+
58+
- `supported_libs.SUPPORTED_LIBNAMES`
59+
- `supported_libs.SUPPORTED_WINDOWS_DLLS`
60+
- `supported_libs.SUPPORTED_LINUX_SONAMES`
61+
- `supported_libs.EXPECTED_LIB_SYMBOLS`

0 commit comments

Comments
 (0)