Pin cuda-toolkit wheel to container's CTK major.minor in CI#8160
Open
leofang wants to merge 2 commits intoNVIDIA:mainfrom
Open
Pin cuda-toolkit wheel to container's CTK major.minor in CI#8160leofang wants to merge 2 commits intoNVIDIA:mainfrom
leofang wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Contributor
leofang
commented
Mar 24, 2026
Previously, Python test scripts extracted only the major version from nvcc (e.g. 12) and installed cuda-toolkit==12.*, which floated to the latest 12.x from PyPI regardless of the container's actual CTK version. This masked issues like the nvrtc compiler bug in CTK 12.4. Use PIP_CONSTRAINT to pin cuda-toolkit==X.Y.* (e.g. 12.9.*) matching the container's nvcc, ensuring CI tests exercise the exact same cuda-toolkit minor version as the devcontainer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d53a49f to
a89e9d2
Compare
Member
Author
|
/ok to test 7f3f7a1 |
Contributor
🥳 CI Workflow Results🟩 Finished in 2h 55m: Pass: 100%/445 | Total: 7d 04h | Max: 2h 54m | Hits: 86%/512649See results here. |
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-toolkitPyPI wheels in CI to match the container's exact CTK major.minor version (e.g.cuda-toolkit==12.9.*) instead of floating to the latest (e.g.cuda-toolkit==12.*)PIP_CONSTRAINTmechanism — no changes topyproject.toml, so end users are unaffectedtest_cuda_cccl_headers,test_cuda_compute,test_cuda_coop,test_cuda_cccl_examplesMotivation
The Python CI test scripts previously extracted only the major version from
nvcc(e.g.12) and installedcuda-toolkit==12.*, which always resolved to the latest 12.x from PyPI regardless of the container's actual CTK version. This meant that even when running in a CTK 12.0 container, CI would installcuda-toolkit12.9 wheels (as discovered in #8139 (comment)).This masked issues like the nvrtc compiler bug in CTK 12.4, because the pip-installed nvrtc (latest) was always used instead of the container's version.
How it works
Each test script now also extracts the
X.Yversion fromnvcc --versionand writes a pip constraint file:PIP_CONSTRAINTis a standard pip environment variable that automatically constrains all subsequentpip installcommands in the script.Test plan
cuda-toolkit==12.0.*is installed instead of 12.9🤖 Generated with Claude Code