Skip to content

Commit 62df918

Browse files
authored
bug fix: constrain cuda.core test installs to the requested CTK minor (#1921)
* test: pin core toolkit installs to the requested CTK minor Keep the core test environment aligned with the matrix-selected CUDA toolkit so pip does not resolve a newer runtime and invalidate the job coverage. Made-with: Cursor * test: simplify core wheel install selection Centralize the core wheel target selection so both install modes share one pip invocation while preserving when the published cuda.bindings extra is requested. Made-with: Cursor
1 parent a8805e5 commit 62df918

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ci/tools/run-tests

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ elif [[ "${test_module}" == "core" ]]; then
7474

7575
pushd ./cuda_core
7676
CUDA_VER_MINOR="$(cut -d '.' -f 1-2 <<< "${CUDA_VER}")"
77-
if [[ "${LOCAL_CTK}" == 1 ]]; then
78-
# We already installed cuda-bindings, and all CTK components exist locally,
79-
# so just install the test dependencies.
80-
# Constrain cuda-toolkit to match the local CTK version to avoid
81-
# pip pulling in a newer nvidia-cuda-runtime that conflicts with it.
82-
pip install "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*"
83-
else
84-
pip install $(ls "${CUDA_CORE_ARTIFACTS_DIR}"/*.whl)["cu${TEST_CUDA_MAJOR}"] --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}"
77+
# Start from the built wheel path, then add the published cuda.bindings extra
78+
# when this job is resolving against wheel-installed CTK packages.
79+
WHL_EXTRA=("${CUDA_CORE_ARTIFACTS_DIR}"/*.whl)
80+
if [[ "${LOCAL_CTK}" != 1 ]]; then
81+
WHL_EXTRA=("${WHL_EXTRA[0]}[cu${TEST_CUDA_MAJOR}]")
8582
fi
83+
# Constrain cuda-toolkit to the requested CTK version to avoid
84+
# pip pulling in a newer nvidia-cuda-runtime that conflicts with it.
85+
pip install "${WHL_EXTRA[@]}" --group "test-cu${TEST_CUDA_MAJOR}${FREE_THREADING}" "cuda-toolkit==${CUDA_VER_MINOR}.*"
8686
echo "Running core tests"
8787
${SANITIZER_CMD} pytest -rxXs -v --durations=0 --randomly-dont-reorganize tests/
8888
# Currently our CI always installs the latest bindings (from either major version).

0 commit comments

Comments
 (0)