You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
samples: fix unsatisfiable dependency pins and depend on cuda-core[cu13] - #3601
Each pin had a documented reason (in the sample's requirements.txt or README), so each fix addresses that reason rather than just deleting the pin:
Sample
Before
After
Why
processCheckpoint
cuda-python>=13.0.0,<13.3.0
cuda-core[cu13]>=1.3.0
Only cuda-bindings 13.3.0 lacked CUcheckpointRestoreArgs, and 13.3.1 restored it (#2144). cuda-core 1.3.0's cu13 extra requires cuda-bindings >=13.5.0, which excludes 13.3.0.
tmaTensorMap
nvidia-cuda-cccl-cu12
nvidia-cuda-cccl>=13.0.0
The sample is CUDA 13 (cupy-cuda13x), and the CUDA 13 CCCL wheel has no -cu12 suffix. cuda.pathfinder finds its headers in nvidia/cu13/include/cccl.
pageRank
cuda-core<1.0.0
cuda-core[cu13]>=1.0.0
The cap came from cudf-cu13 requiring numba-cuda<0.29.0. cudf-cu13 26.10.2 allows numba-cuda 0.30.4, which allows cuda-core<2.0.0. The README's known-issue note is removed.
processCheckpoint now runs in the regular core CI job on Linux CUDA 13 rows, so it is removed from the "not currently run in any CI job" marker in test_samples.py. tmaTensorMap still needs the CCCL wheel and CuPy installed, and pageRank still needs RAPIDS. #3578 tracks both.
2. cuda-core[cu13] instead of cuda-python
Samples that depend on cuda-core no longer list cuda-python. Plain cuda-core installs no cuda-bindings; they come only through its cu12/cu13 extras. So these samples now require cuda-core[cu13].
43 PEP 723 headers, 43 requirements.txt files, and 34 READMEs.
glInteropFluid, glInteropMipmapLod and textureSample require >=1.1.0, because cuda.core.texture first shipped in cuda-core 1.1.0. The two GL headers had listed cuda_bindings plus cuda_core>0.6.0; they now match their requirements.txt.
3. Sample runner: check what an extra requires
cuda-python>=13.0.0 was what made these samples skip on CUDA 12 rows. The runner used to check only that a distribution declares a requested extra, so cuda-core[cu13] alone would have passed there too.
missing_dependencies(sample)
for each requirement:
version satisfies specifier?
requested extras declared?
+ for each requested extra:+ for each requirement that extra adds (recursively, e.g. cu13 -> minimal-sysctk13):+ installed? -> its version must satisfy the requirement+ not installed -> accepted (conda / a local CTK provide it without pip metadata)
So cuda-core[cu13] is unmet when cuda-bindings 12.x is installed:
cuda-core[cu13]>=1.0.0 (cuda-core 1.3.1: extra cu13 requires cuda-core[minimal-sysctk13]
(cuda-core 1.3.1: extra minimal-sysctk13 requires cuda-bindings<14,>=13.5.0
(cuda-bindings 12.9.6: version 12.9.6 does not satisfy <14,>=13.5.0)))
4. One copy of the sample test logic
cuda_core/tests/example_tests/test_samples.py and cuda_bindings_13/tests/example_tests/test_samples.py each repeated the code that runs one sample and turns its result into a pass, skip, or fail. That code is now SampleSuite in cuda_python_test_helpers/sample_runner.py:
The "unmet package requirement(s):" prefix is one constant (UNMET_DEPENDENCIES).
Wrapper re-exports in both run_samples.py files that nothing uses anymore are removed.
sample_runner.py now imports pytest.
The CUDA 12 bindings root has no sample tests, so it has no counterpart change.
Evidence
Gating against real package metadata. Each sample's skip decision, before and after, in three environments:
Environment
Samples whose skip status changes
CUDA 12 metadata (cuda-core 1.3.1, cuda-bindings 12.9.6)
none: every cuda-core[cu13] sample still skips, now through the extras check
PyPI CUDA 13 (cuda-core 1.3.1, cuda-bindings 13.5.0, CuPy, nvidia-cuda-cccl)
processCheckpoint and tmaTensorMap: skip → run
Local CUDA 13 dev build
none
Samples:
processCheckpoint PASSED on an RTX 5070 and an RTX A400.
tmaTensorMap PASSED through the sample runner in the PyPI CUDA 13 environment, with CUDA_HOME/CUDA_PATH unset, using only the nvidia-cuda-cccl wheel's headers.
pageRank: uv pip compile resolves cuda-core>=1.0.0 together with cugraph-cu13, cudf-cu13 26.10.2, and dask-cuda (to cuda-core 1.2.2 and numba-cuda 0.30.4).
Confirming it runs in CI: in this PR's CI run, the Linux CUDA 13 core jobs should report test_sample[cuda_core/processCheckpoint] PASSED, where main reports it SKIPPED. The CUDA 12 jobs should still skip the cuda-core[cu13] samples, now with the extra cu13 requires … reason. For example:
gh run view <CI run id> --repo NVIDIA/cuda-python --log | grep -F "test_sample[cuda_core/processCheckpoint]"
Merge Danger
Door: two-way. Sample metadata and test harness only.
Blast Radius: sample tests in cuda.core and cuda.bindings, and anyone installing a sample's requirements.
processCheckpoint now runs on Linux CUDA 13 CI rows. It checkpoints and restores its own process, so a driver or container restriction on a runner would show up as a failure there.
Installing a cuda.core sample's requirements now installs cuda-core[cu13] (cuda-bindings 13.x plus cuda-toolkit 13 wheels) instead of cuda-python.
The extras check accepts a missing distribution, so it cannot newly skip samples in conda or local-toolkit environments. An installed distribution with a conflicting version now causes a skip.
Three cuda.core samples declared PEP 723 requirements that no CI
environment can satisfy, so they skipped everywhere:
- processCheckpoint capped cuda-python <13.3.0 because cuda-bindings
13.3.0 lacked CUcheckpointRestoreArgs (13.3.1 restored it). Require
cuda-core[cu13]>=1.3.0 instead: its cu13 extra needs cuda-bindings
>=13.5.0, which excludes 13.3.0.
- tmaTensorMap required the CUDA 12 nvidia-cuda-cccl-cu12 package. Use
the CUDA 13 nvidia-cuda-cccl>=13.0.0.
- pageRank pinned cuda-core<1.0.0 because cudf-cu13 used to require
numba-cuda<0.29.0. Current cudf-cu13 allows numba-cuda 0.30.4, which
allows cuda-core<2.0.0, so use a lower bound and drop the README note.
Samples that depend on cuda-core no longer list cuda-python. They
require cuda-core[cu13] instead, which installs the matching
cuda-bindings, in the PEP 723 headers, requirements.txt files, and
READMEs. Samples that use cuda.core.texture require cuda-core>=1.1.0.
The sample runner now checks the installed distributions that a
requested extra requires, so cuda-core[cu13] is unmet when cuda-bindings
12.x is installed and these samples keep skipping on CUDA 12 rows.
Distributions an extra requires but that are not installed are accepted,
because conda and a local CUDA Toolkit provide them without pip metadata.
Move the code that runs one sample and maps its result to a pytest
outcome, duplicated in the cuda.core and cuda.bindings test_samples.py,
into SampleSuite in sample_runner.py, and drop wrapper re-exports that
are no longer used.
processCheckpoint now runs in CI, so remove it from the "not currently
run in any CI job" marker scope.
ClosesNVIDIA#3567.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Updated CUDA Core sample requirements and installation instructions to use the CUDA 13 extra, replacing separate CUDA package requirements.
Updated affected samples to reflect the appropriate minimum CUDA Core versions and dependency constraints.
Bug Fixes
Improved sample dependency checks to account for requested extras and their transitive requirements, helping identify incompatible installed packages.
Standardized sample test handling for missing dependencies and sample outcomes.
The changes update CUDA Core sample dependency declarations, add recursive checks for requested package extras, and route sample tests through a shared pytest suite. The three sample dependency pins identified in issue 3567 are revised.
Changes: CUDA Core sample dependency and test flow
The runner recursively checks installed providers against requested extras. It tracks visited distribution-extra pairs and uses a shared unmet-dependency message prefix.
CUDA Core sample dependency declarations samples/cuda_core/*/{README.md,*.py,requirements.txt}
Sample declarations change to cuda-core[cu13]. The processCheckpoint and pageRank constraints are updated, and tmaTensorMap switches to the CUDA 13 CCCL package.
Shared sample test execution cuda_bindings_13/tests/example_tests/*, cuda_core/tests/example_tests/*, cuda_python_test_helpers/cuda_python_test_helpers/sample_runner.py
SampleSuite loads sample entries and configuration and handles test outcomes. The CUDA 13 and CUDA Core tests delegate checks to it; selected runner re-exports are removed.
Assessment against linked issues
Objective
Addressed
Explanation
[3567] Make the processCheckpoint, tmaTensorMap, and pageRank dependency headers satisfiable in CI.
✅
Out-of-scope changes
Code Change
Explanation
Update dependency declarations for other samples, such as binarySearch (samples/cuda_core/binarySearch/requirements.txt:2)
Issue 3567 identifies only processCheckpoint, tmaTensorMap, and pageRank; it does not request changing other sample requirements.
Possibly related issues
Issue 2961: The recursive checks for requirements declared by requested extras address the described dependency-validation gap. The changes do not complete the issue’s cupy-cuda13x standardization.
Issue 3578: The PR changes sample dependency declarations and skip handling, but does not add the optional packages tracked by the issue.
Issue 3562: The CUDA Core sample test list no longer marks processCheckpoint as not currently run in CI. The PR does not address the test-discovery parsing issues described there.
Suggested reviewers:danielfrg, jpascucci-nv
Change: Bug fix · Severity of issue fixed: Low
Merge Risk: Low · up to d3c62
The recursive extra check can wrongly skip a sample when an alternate provider package, such as cupy instead of cupy-cuda13x, satisfies a requirement that the first installed provider fails. This affects only test gating, not production behavior. Fix the provider loop to continue past a mismatched provider before merging, or accept it as a minor follow-up.
Security architecture risk: Minimal · up to d3c62
The shared runner preserves each suite’s skip and failure rules and uses the same subprocess permissions as before. The dependency changes affect sample installation and test eligibility; the review found no material weakening of security or failure containment.
Retained concerns
No architecture-level concerns identified.
Security review details
Security Blast Radius
inferred — The changed execution path is scoped to sample-running environments. Dependency metadata can affect whether a sample launches, but the inspected change does not introduce a remote caller, a new launcher source, or greater process authority.
Trust Boundaries and Controls
observed — Samples continue to run as subprocesses with the runner’s inherited environment, the sample directory as the working directory, and the existing timeout. The subprocess separates execution from pytest but is not a credential sandbox; this behavior predates the PR.
- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Both standalone sample CLIs fail to import without undeclared pytest, even for --help, and the recursive extras gate lacks unit coverage for dependency traversal and compatibility checks.
This PR corrects sample dependency metadata for #3567 and supports the broader effort in #2077 to reduce samples that never run in CI.
Changes:
Replaces separate cuda-python and cuda-core requirements with cuda-core[cu13], aligning script headers, requirements, and documentation.
Fixes the checkpoint, CCCL, and PageRank constraints, and raises texture samples’ minimum cuda-core version to 1.1.
Adds recursive extra-dependency checks and shares pytest sample execution through SampleSuite.
No CUDA 12 counterparts were found for cuda_bindings_13/tests/example_tests/run_samples.py or cuda_bindings_13/tests/example_tests/test_samples.py; no matching changes are needed there. The supplied diffs do not modify marked synchronized blocks.
Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 5 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
important: Check fallback providers before rejecting an extra requirement.
If an extra requires cupy-cuda13x>=14, installed metadata for cupy-cuda13x==13.0 causes this loop to stop even when the fallback cupy==14.0 satisfies the requirement. The top-level provider loop accepts that fallback, but the recursive loop incorrectly waives the sample.
Collect mismatches until all providers fail. Break only when a provider satisfies the requirement.
Preview will be ready when the GitHub Pages deployment is complete.
This branch has not been deployed
No deployments
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
cuda.bindingsEverything related to the cuda.bindings modulecuda.coreEverything related to the cuda.core moduletestImprovements or additions to tests
2 participants
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.
Closes #3567. Part of #2077.
Summary
1. Three unsatisfiable sample pins
Each pin had a documented reason (in the sample's
requirements.txtor README), so each fix addresses that reason rather than just deleting the pin:processCheckpointcuda-python>=13.0.0,<13.3.0cuda-core[cu13]>=1.3.0CUcheckpointRestoreArgs, and 13.3.1 restored it (#2144). cuda-core 1.3.0'scu13extra requires cuda-bindings >=13.5.0, which excludes 13.3.0.tmaTensorMapnvidia-cuda-cccl-cu12nvidia-cuda-cccl>=13.0.0cupy-cuda13x), and the CUDA 13 CCCL wheel has no-cu12suffix.cuda.pathfinderfinds its headers innvidia/cu13/include/cccl.pageRankcuda-core<1.0.0cuda-core[cu13]>=1.0.0cudf-cu13requiringnumba-cuda<0.29.0.cudf-cu1326.10.2 allowsnumba-cuda0.30.4, which allowscuda-core<2.0.0. The README's known-issue note is removed.processCheckpointnow runs in the regularcoreCI job on Linux CUDA 13 rows, so it is removed from the "not currently run in any CI job" marker intest_samples.py.tmaTensorMapstill needs the CCCL wheel and CuPy installed, andpageRankstill needs RAPIDS. #3578 tracks both.2.
cuda-core[cu13]instead ofcuda-pythonSamples that depend on cuda-core no longer list
cuda-python. Plaincuda-coreinstalls no cuda-bindings; they come only through itscu12/cu13extras. So these samples now requirecuda-core[cu13].requirements.txtfiles, and 34 READMEs.glInteropFluid,glInteropMipmapLodandtextureSamplerequire>=1.1.0, becausecuda.core.texturefirst shipped in cuda-core 1.1.0. The two GL headers had listedcuda_bindingspluscuda_core>0.6.0; they now match theirrequirements.txt.3. Sample runner: check what an extra requires
cuda-python>=13.0.0was what made these samples skip on CUDA 12 rows. The runner used to check only that a distribution declares a requested extra, socuda-core[cu13]alone would have passed there too.missing_dependencies(sample) for each requirement: version satisfies specifier? requested extras declared? + for each requested extra: + for each requirement that extra adds (recursively, e.g. cu13 -> minimal-sysctk13): + installed? -> its version must satisfy the requirement + not installed -> accepted (conda / a local CTK provide it without pip metadata)So
cuda-core[cu13]is unmet when cuda-bindings 12.x is installed:4. One copy of the sample test logic
cuda_core/tests/example_tests/test_samples.pyandcuda_bindings_13/tests/example_tests/test_samples.pyeach repeated the code that runs one sample and turns its result into a pass, skip, or fail. That code is nowSampleSuiteincuda_python_test_helpers/sample_runner.py:UNMET_DEPENDENCIES).run_samples.pyfiles that nothing uses anymore are removed.sample_runner.pynow imports pytest.Evidence
Gating against real package metadata. Each sample's skip decision, before and after, in three environments:
cuda-core[cu13]sample still skips, now through the extras checknvidia-cuda-cccl)processCheckpointandtmaTensorMap: skip → runSamples:
processCheckpointPASSED on an RTX 5070 and an RTX A400.tmaTensorMapPASSED through the sample runner in the PyPI CUDA 13 environment, withCUDA_HOME/CUDA_PATHunset, using only thenvidia-cuda-ccclwheel's headers.pageRank:uv pip compileresolvescuda-core>=1.0.0together withcugraph-cu13,cudf-cu1326.10.2, anddask-cuda(to cuda-core 1.2.2 and numba-cuda 0.30.4).cuda_core/tests/example_tests: 121 passed, 39 skipped.cuda_bindings_13/tests/example_tests: 24 passed, 1 skipped (sample-reported waiver).Confirming it runs in CI: in this PR's CI run, the Linux CUDA 13
corejobs should reporttest_sample[cuda_core/processCheckpoint] PASSED, wheremainreports it SKIPPED. The CUDA 12 jobs should still skip thecuda-core[cu13]samples, now with theextra cu13 requires …reason. For example:Merge Danger
Door: two-way. Sample metadata and test harness only.
Blast Radius: sample tests in cuda.core and cuda.bindings, and anyone installing a sample's requirements.
processCheckpointnow runs on Linux CUDA 13 CI rows. It checkpoints and restores its own process, so a driver or container restriction on a runner would show up as a failure there.cuda-core[cu13](cuda-bindings 13.x pluscuda-toolkit13 wheels) instead ofcuda-python.test_samples.pymarker list, so whichever merges second needs a small rebase.Reviewers: please feel free to push commits directly to this PR to improve it.
🤖 Generated with Claude Code