Skip to content

Commit 6ff7365

Browse files
committed
use guess_latest.sh to get the latest CTK ver
1 parent 247f2a0 commit 6ff7365

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/actions/fetch_ctk/guess_latest.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
2+
# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
33
#
44
# SPDX-License-Identifier: Apache-2.0
55

@@ -30,3 +30,4 @@ get_latest_version() {
3030

3131
# Call the function and store the result
3232
latest_version=$(get_latest_version)
33+
echo $latest_version

.github/workflows/test-wheel-linux.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ jobs:
7878
fi
7979
fi
8080
81+
# We don't test compute-sanitizer on CTK<12 because backporting fixes is too much effort
82+
# We only test compute-sanitizer on python 3.12 arbitrarily; we don't need to use sanitizer on the entire matrix
83+
# Only local ctk installs have compute-sanitizer; there is not wheel for it
84+
if [[ "${{ inputs.python-version }}" == "3.12" && "${{ inputs.cuda-version }}" != "11.8.0" && "${{ inputs.local-ctk }}" == 1 ]]; then
85+
SETUP_SANITIZER=1
86+
echo "LATEST_CUDA_VERSION=$(bash .github/actions/fetch_ctk/guess_latest.sh)" >> $GITHUB_ENV
87+
else
88+
SETUP_SANITIZER=0
89+
fi
90+
echo "SETUP_SANITIZER=${SETUP_SANITIZER}" >> $GITHUB_ENV
91+
8192
# make outputs from the previous job as env vars
8293
CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ inputs.host-platform }}"
8394
echo "PYTHON_VERSION_FORMATTED=${PYTHON_VERSION_FORMATTED}" >> $GITHUB_ENV
@@ -185,20 +196,17 @@ jobs:
185196
cuda-version: ${{ inputs.cuda-version }}
186197

187198
- name: Set up latest cuda_sanitizer_api
188-
if: ${{ inputs.local-ctk == '1' }}
199+
if: ${{ env.SETUP_SANITIZER == '1' }}
189200
uses: ./.github/actions/fetch_ctk
190201
continue-on-error: false
191202
with:
192203
host-platform: ${{ inputs.host-platform }}
193-
cuda-version: "12.8.1"
204+
cuda-version: ${{ env.LATEST_CUDA_VERSION }}
194205
cuda-components: "cuda_sanitizer_api"
195206

196207
- name: Set up compute-sanitizer
197208
run: |
198-
# We don't test compute-sanitizer on CTK<12 because backporting fixes is too much effort
199-
# We only test compute-sanitizer on python 3.12 arbitrarily; we don't need to use sanitizer on the entire matrix
200-
# Only local ctk installs have compute-sanitizer; there is not wheel for it
201-
if [[ "${{ inputs.python-version }}" == "3.12" && "${{ inputs.cuda-version }}" != "11.8.0" && "${{ inputs.local-ctk }}" == 1 ]]; then
209+
if [[ "${SETUP_SANITIZER}" == 1 ]]; then
202210
COMPUTE_SANITIZER="${CUDA_HOME}/bin/compute-sanitizer"
203211
COMPUTE_SANITIZER_VERSION=$(${COMPUTE_SANITIZER} --version | grep -Eo "[0-9]{4}\.[0-9]\.[0-9]" | sed -e 's/\.//g')
204212
SANITIZER_CMD="${COMPUTE_SANITIZER} --target-processes=all --launch-timeout=0 --tool=memcheck --error-exitcode=1"

0 commit comments

Comments
 (0)