Skip to content

Conversation

@cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Feb 11, 2026

Summary

  • [FEA]: Support load_nvidia_dynamic_lib() "cuda", "nvml" #1288: Add support for load_nvidia_dynamic_lib("cuda") and load_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.
  • [FEA]: Avoid loading non-supported dynamic libraries #1564: Reject unrecognized libnames with ValueError instead 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 raises ValueError for 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 — new SUPPORTED_LINUX_SONAMES_DRIVER / SUPPORTED_WINDOWS_DLLS_DRIVER dicts
  • load_nvidia_dynamic_lib.py_DRIVER_ONLY_LIBNAMES, _load_driver_lib_no_cache(), _ALL_SUPPORTED_LIBNAMES validation, updated docstring
  • tests/test_driver_lib_loading.py — 10 new tests for driver lib flow
  • tests/test_load_nvidia_dynamic_lib.py — 2 new tests for validation, migrated to mocker

Closes #1288, closes #1564.

Made with Cursor

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Feb 11, 2026

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.

@cpcloud cpcloud force-pushed the driver-libs-and-validation branch from 182be13 to 058f824 Compare February 11, 2026 19:49
…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>
@cpcloud cpcloud force-pushed the driver-libs-and-validation branch from 058f824 to 902a7f5 Compare February 11, 2026 19:51
@cpcloud
Copy link
Contributor Author

cpcloud commented Feb 11, 2026

/ok to test

@github-actions
Copy link

Copy link
Contributor

Copilot AI left a 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 libname against 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.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cpcloud
Copy link
Contributor Author

cpcloud commented Feb 12, 2026

/ok to test

@rparolin rparolin added bug Something isn't working feature New feature or request and removed bug Something isn't working labels Feb 12, 2026
@rparolin rparolin added this to the cuda.pathfinder 1.4.0 milestone Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA]: Avoid loading non-supported dynamic libraries [FEA]: Support load_nvidia_dynamic_lib() "cuda", "nvml"

2 participants