[FEA]: Ability to provide an extra path for cuda-pathfinder to search with high priority #1054
Copy link
Copy link
Closed
Closed
Enhancement
Copy link
Labels
awaiting-responseFurther information is requestedFurther information is requestedcuda.pathfinderEverything related to the cuda.pathfinder moduleEverything related to the cuda.pathfinder modulefeatureNew feature or requestNew feature or request
Milestone
Description
Is this a duplicate?
- I confirmed there appear to be no duplicate issues for this request and that I agree to the Code of Conduct
Area
cuda.pathfinder
Is your feature request related to a problem? Please describe.
The cuda-pathfinder's search path prioritizes libraries from wheels. For example, libnvshmem_host.so comes from libnvidia-nvshmem-cuXX wheel. If I'm working from a development branch of nvshmem, I may need to manually copy libraries over the site-packages directory in order to get my custom libraries to be opened. LD_LIBRARY_PATH is much lower in the priority order (on purpose), so that won't work either.
Describe the solution you'd like
A few different ideas come to mind:
<LIBNAME_UPPER_CASE>_PATH_OVERRIDEso each library has an ability to be overridden independentlyCUDA_PATHFINDER_TOP_PRIORITY_PATHwhich applies to all pathfinder searches- Adding a
<library>_HOMEenvironment variable, and prioritizing it above other search paths
Describe alternatives you've considered
I think I listed all 3 above. The current hacky WAR is to copy .so files around on the system.
Additional context
No response
Reacted by Leo Fang
Metadata
Metadata
Assignees
Labels
awaiting-responseFurther information is requestedFurther information is requestedcuda.pathfinderEverything related to the cuda.pathfinder moduleEverything related to the cuda.pathfinder modulefeatureNew feature or requestNew feature or request
Activity
leofang commentedon Sep 30, 2025
Why don't you just remove the wheel from the Python env, and let the system search kick in (through
LD_LIBRARY_PATH)? This is not a typical request especially for library teams who own both C and Python libraries. If you don't keep the hygiene of your dev env, at one point things will just break and we can't be blamed.benhg commentedon Sep 30, 2025
We could certainly do that. It's just one extra step to make sure
pip installnever pulls back in those dependencies. I agree that it is very much a niche/developer-only feature and may not be worth doing if it only serves a small value.leofang commentedon Sep 30, 2025
pip install --no-deps ...will help you avoid installing dependencies. Alternatively, you can organize non-nvSHMEM dependencies into a, say,requirements-dev-core.txtfile, and thenpip install -r requirements-dev-core.txtto just avoid nvSHMEM.I'd prefer us to not commit to any overwrite mechanisms for now (preferably forever). I don't want to repeat the nightmare of having
RPATHvsRUNPATHand having to worry about the search precedence. The less factors participating in our search logic, the better.benhg commentedon Sep 30, 2025
Understandable. This is not a dealbreaker for us (or probably anyone else) if we can't have it.
kkraus14 commentedon Oct 1, 2025
I agree we shouldn't reorder standard paths, but I agree with @benhg that there's value in having an "escape hatch" of sorts to override pathfinder behavior. This will inevitably come in handy when someone needs to pull in a debug build of a library or something else. I think if we have pathfinder specific environment variables that allow controlling on a per library and per component (library vs headers vs executables vs etc.) basis that it would be a valuable addition.
rparolin commentedon Apr 27, 2026
x-ref: #1979
rwgk commentedon Aug 23, 2026
Hi @benhg, I wanted to call out that the just-merged PR #2680 includes features relevant to this issue.
PR #2680 adds descriptor-driven product installation roots for cuDNN and NCCL. Existing Pathfinder APIs use these automatically for both dynamic-library and header discovery:
CUDNN_PATH=<root>supports the declared cuDNN layouts:lib/lib64plusincludeon Linux;bin/x64orbinplusincludeon Windows x64; and the verified standalone archive'sbin/arm64plusincludelayout on native Windows ARM64.NCCL_HOME=<root>supportslib,lib64, andbuild/libfor the NCCL dynamic library on Linux, plusincludeandbuild/includefor headers. This covers installed/extracted prefixes as well as an NCCL source/build tree.This resembles the third idea in this issue, but there is an important difference: these variables are conventional-layout fallbacks, not developer overrides.
For dynamic libraries, the effective load precedence remains:
CUDNN_PATHorNCCL_HOME).For headers, wheel and Conda candidates likewise precede the product root; the product root then precedes generic CUDA and system locations. A product variable must point to an installation root with one of the declared layouts, and an unset, stale, or non-matching root falls through normally.
So PR #2680 does not resolve the original nvSHMEM development use case here, mainly:
Do you think this issue should stay open for a genuine preemptive override, or would the current product-root model be sufficient if we added equivalent nvSHMEM metadata? It could let pathfinder discover a conventional nvSHMEM development or installation tree whenever no higher-priority wheel or Conda candidate is present.
rparolin commentedon Oct 29, 2026
I'm going to close this issue due to inactivity. Feel free to re-open it again if you still need this functionality.