Repository navigation
sys: honor CUDA_TOOLKIT_PATH in runtime discovery - #95
Merged
nihalpasham merged 4 commits intoJun 12, 2026
Merged
Conversation
Search CUDA_TOOLKIT_PATH before CUDA_HOME and CUDA_PATH when discovering libNVVM and nvJitLink so runtime loading matches the project-supported build environment. Signed-off-by: yagna-1 <[email protected]>
The ltoir module carries a third copy of cuda_roots() that the sys-crate fix did not reach, so a toolkit installed only via CUDA_TOOLKIT_PATH would load libNVVM and nvJitLink but still fail to find libdevice.10.bc. Port the same precedence (CUDA_TOOLKIT_PATH, CUDA_HOME, CUDA_PATH, then the /usr/local/cuda and /opt/cuda defaults) and reuse the closure seam so the search order stays unit-testable without touching process env.
The runtime search now consults CUDA_TOOLKIT_PATH first, but the module docs, READMEs, and not-found error messages still advertised only CUDA_HOME and CUDA_PATH, steering users away from the variable the build environment already standardizes on. Sweep every discovery list (libnvvm-sys, nvjitlink-sys, the primitive_stress README) and both LibraryNotFound messages to match the actual probe order.
Collaborator
|
LGTM 👍🏾, verified the precedence end-to-end (fake roots via env: Layered two commits on top:
|
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
CUDA_TOOLKIT_PATHin libNVVM and nvJitLink runtime discovery.CUDA_HOMEandCUDA_PATHso runtime loading matches the build script and CI environment.Fixes #93
Test plan
cargo fmt --check --allcargo test -p libnvvm-sys -p nvjitlink-sys --libcargo clippy -p libnvvm-sys -p nvjitlink-sys --lib --tests -- -D warnings