[FEA]: Add per-library path override env var to cuda.pathfinder#1979
Open
rparolin wants to merge 2 commits intoNVIDIA:mainfrom
Open
[FEA]: Add per-library path override env var to cuda.pathfinder#1979rparolin wants to merge 2 commits intoNVIDIA:mainfrom
rparolin wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Adds CUDA_PATHFINDER_<LIBNAME_UPPER>_PATH_OVERRIDE as a developer escape hatch for pointing cuda.pathfinder at a custom build of a specific library (e.g. a development branch of nvshmem) without having to remove the wheel or copy .so files into site-packages. The value can be either an absolute file path (used as-is) or a directory (searched with the same platform logic as conda / CUDA_PATH). The override has the highest priority and applies uniformly to CTK, third-party, and driver libraries. If the env var is set but the library cannot be resolved from it, the load fails immediately rather than silently falling through to other search steps. This keeps the override behavior explicit and easy to debug. Closes NVIDIA#1054. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1054.
Adds
CUDA_PATHFINDER_<LIBNAME_UPPER>_PATH_OVERRIDEas a developer escape hatch so users working on a development branch of a library (e.g. nvshmem) can pointcuda.pathfinderat a custom build without having to uninstall the wheel or copy.sofiles intosite-packages.This implements option 1 from the issue (per-library override), which matches @kkraus14's later suggestion in the thread for a per-library, pathfinder-specific knob — and avoids the cross-cutting precedence concerns @leofang raised against a global
TOP_PRIORITY_PATH.Behavior
CUDA_PATHFINDER_<LIBNAME_UPPER>_PATH_OVERRIDEnvshmem_host→CUDA_PATHFINDER_NVSHMEM_HOST_PATH_OVERRIDEcublasLt→CUDA_PATHFINDER_CUBLASLT_PATH_OVERRIDECUDA_PATH).CUDA_PATH, and the canary probe. Applies uniformly to CTK, third-party, and driver libraries.DynamicLibNotFoundErrorimmediately rather than silently falling through. Silent fallthrough would be the actual debugging footgun — a typo or stale path should be loud.found_via: tagged asoverride(CUDA_PATHFINDER_<LIB>_PATH_OVERRIDE)so the resolved source is distinguishable fromsite-packages,conda, etc.Files
cuda_pathfinder/cuda/pathfinder/_dynamic_libs/search_steps.py— newfind_via_path_overridefind step +path_override_env_varhelper; prepended toEARLY_FIND_STEPS.cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py— driver fast-path also honors the override; updated docstring.cuda_pathfinder/tests/test_search_steps.py— 11 new unit tests.🤖 Generated with Claude Code