Skip to content

Commit 18edf5e

Browse files
authored
Merge branch 'main' into dching/latest-sanitizer-alt
2 parents 6b02f1a + bd770e1 commit 18edf5e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/actions/fetch_ctk/action.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ runs:
5656
5757
# The binary archives (redist) are guaranteed to be updated as part of the release posting.
5858
CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/"
59-
CTK_JSON_URL="$CTK_BASE_URL/redistrib_${{ inputs.cuda-version }}.json"
6059
if [[ "${{ inputs.host-platform }}" == linux* ]]; then
6160
if [[ "${{ inputs.host-platform }}" == "linux-64" ]]; then
6261
CTK_SUBDIR="linux-x86_64"
@@ -75,13 +74,15 @@ runs:
7574
rm -rf $_TEMP_DIR_
7675
}
7776
fi
77+
7878
function populate_cuda_path() {
7979
# take the component name as a argument
8080
function download() {
8181
curl -kLSs $1 -o $2
8282
}
83-
CTK_COMPONENT=$1
84-
CTK_COMPONENT_REL_PATH="$(curl -s $CTK_JSON_URL |
83+
local CTK_COMPONENT=$1
84+
local CTK_VERSION=$2
85+
CTK_COMPONENT_REL_PATH="$(curl -s ${CTK_BASE_URL}/redistrib_${CTK_VERSION}.json |
8586
python -c "import sys, json; print(json.load(sys.stdin)['${CTK_COMPONENT}']['${CTK_SUBDIR}']['relative_path'])")"
8687
CTK_COMPONENT_URL="${CTK_BASE_URL}/${CTK_COMPONENT_REL_PATH}"
8788
CTK_COMPONENT_COMPONENT_FILENAME="$(basename $CTK_COMPONENT_REL_PATH)"
@@ -98,7 +99,17 @@ runs:
9899
CTK_CACHE_COMPONENTS="${CTK_CACHE_COMPONENTS//,,/,}"
99100
# Get headers and shared libraries in place
100101
for item in $(echo $CTK_CACHE_COMPONENTS | tr ',' ' '); do
101-
populate_cuda_path "$item"
102+
ctk_version="${{ inputs.cuda-version }}"
103+
if [[ "$item" == "cuda_sanitizer_api" ]]; then
104+
# Always use latest CTK for cuda_sanitizer_api
105+
# FIXME: Automatically track latest CTK version
106+
CUDA_MAJOR="$(cut -d '.' -f 1 <<< ${{ inputs.cuda-version }})"
107+
if [[ "$CUDA_MAJOR" == "12" ]]; then
108+
# TODO: Automatically track latest CTK minor version
109+
ctk_version="12.8.0"
110+
fi
111+
fi
112+
populate_cuda_path "$item" "$ctk_version"
102113
done
103114
ls -l $CACHE_TMP_DIR
104115

0 commit comments

Comments
 (0)