-
Notifications
You must be signed in to change notification settings - Fork 245
feat(pathfinder): support "cuda"/"nvml" driver libs and reject unsupported libnames #1602
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?
Conversation
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
182be13 to
058f824
Compare
…orted libnames
Add support for loading NVIDIA driver libraries ("cuda", "nvml") via
load_nvidia_dynamic_lib(). These are part of the display driver (not the
CTK) and use a simplified system-search-only path, skipping site-packages,
conda, CUDA_HOME, and canary probe steps.
Also reject unrecognized libnames with a ValueError instead of silently
falling through to system search, which could produce surprising results
for unsupported libs like "cupti".
Closes NVIDIA#1288, closes NVIDIA#1564.
Co-authored-by: Cursor <cursoragent@cursor.com>
058f824 to
902a7f5
Compare
|
/ok to test |
|
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.
Pull request overview
Adds explicit support in cuda.pathfinder for loading NVIDIA driver libraries ("cuda", "nvml") via a system-search-only path, and hard-fails on unknown library names to avoid surprising implicit loads.
Changes:
- Add platform-specific driver library name mappings (
libcuda.so.1/nvcuda.dll,libnvidia-ml.so.1/nvml.dll) to the supported-lib registries. - Introduce a dedicated driver-only loading path (skip wheel/conda/CUDA_HOME/canary) and validate
libnameagainst a platform-aware supported set. - Expand tests to cover driver lib dispatch behavior and unsupported-libname validation.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
cuda_pathfinder/cuda/pathfinder/_dynamic_libs/supported_nvidia_libs.py |
Adds driver-library mappings and folds them into the platform registries. |
cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py |
Adds supported-name validation and a driver-only load path that bypasses the CTK cascade. |
cuda_pathfinder/tests/test_driver_lib_loading.py |
New targeted unit tests for driver-only behavior and dispatch rules. |
cuda_pathfinder/tests/test_load_nvidia_dynamic_lib.py |
Updates tests to use mocker and adds unsupported-libname validation tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/ok to test |
Summary
load_nvidia_dynamic_lib()"cuda","nvml"#1288: Add support forload_nvidia_dynamic_lib("cuda")andload_nvidia_dynamic_lib("nvml"). These are NVIDIA driver libraries (not CTK) with non-standard naming (libcuda.so.1/nvcuda.dll,libnvidia-ml.so.1/nvml.dll). They use a simplified system-search-only path, skipping site-packages, conda, CUDA_HOME, and canary probe.ValueErrorinstead of silently falling through to system search. The error message includes the full list of supported names for discoverability.Breaking change
load_nvidia_dynamic_lib()now raisesValueErrorfor unrecognized libnames. Any downstream code passing names like"cupti"that happened to work via system search will break. Adding CUPTI as a supported lib (#1572) before the next release would restore that path through the proper search cascade.Changes
supported_nvidia_libs.py— newSUPPORTED_LINUX_SONAMES_DRIVER/SUPPORTED_WINDOWS_DLLS_DRIVERdictsload_nvidia_dynamic_lib.py—_DRIVER_ONLY_LIBNAMES,_load_driver_lib_no_cache(),_ALL_SUPPORTED_LIBNAMESvalidation, updated docstringtests/test_driver_lib_loading.py— 10 new tests for driver lib flowtests/test_load_nvidia_dynamic_lib.py— 2 new tests for validation, migrated tomockerCloses #1288, closes #1564.
Made with Cursor