Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions .github/actions/fetch_ctk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'"
required: false
type: string
default: "cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_sanitizer_api,libnvjitlink"
default: "cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,libnvjitlink"

runs:
using: composite
Expand Down Expand Up @@ -50,8 +50,9 @@ runs:
if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }}
shell: bash --noprofile --norc -xeuo pipefail {0}
run: |
CUDA_PATH="./cuda_toolkit"
mkdir $CUDA_PATH
CACHE_TMP_DIR="./cache_tmp_dir"
Comment thread
leofang marked this conversation as resolved.
rm -rf $CACHE_TMP_DIR
mkdir $CACHE_TMP_DIR

# The binary archives (redist) are guaranteed to be updated as part of the release posting.
CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/"
Expand All @@ -62,14 +63,14 @@ runs:
CTK_SUBDIR="linux-sbsa"
fi
function extract() {
tar -xvf $1 -C $CUDA_PATH --strip-components=1
tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1
}
elif [[ "${{ inputs.host-platform }}" == "win-64" ]]; then
CTK_SUBDIR="windows-x86_64"
function extract() {
_TEMP_DIR_=$(mktemp -d)
unzip $1 -d $_TEMP_DIR_
cp -r $_TEMP_DIR_/*/* $CUDA_PATH
cp -r $_TEMP_DIR_/*/* $CACHE_TMP_DIR
rm -rf $_TEMP_DIR_
}
fi
Expand Down Expand Up @@ -110,11 +111,16 @@ runs:
fi
populate_cuda_path "$item" "$ctk_version"
done
ls -l $CUDA_PATH
ls -l $CACHE_TMP_DIR

# Prepare the cache
# Note: try to escape | and > ...
tar -czvf ${CTK_CACHE_FILENAME} ${CUDA_PATH}
tar -czvf ${CTK_CACHE_FILENAME} ${CACHE_TMP_DIR}

CUDA_PATH="./cuda_toolkit"
mkdir -p $CUDA_PATH
mv $CACHE_TMP_DIR/* $CUDA_PATH
Comment thread
leofang marked this conversation as resolved.
Outdated
rmdir $CACHE_TMP_DIR

- name: Upload CTK cache
if: ${{ always() &&
Expand Down
32 changes: 32 additions & 0 deletions .github/actions/fetch_ctk/guess_latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/bash
Comment thread
leofang marked this conversation as resolved.
# Copyright (c) 2024-2025, NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED.
Comment thread
leofang marked this conversation as resolved.
Outdated
#
# SPDX-License-Identifier: Apache-2.0

# URL to search
URL="https://developer.download.nvidia.com/compute/cuda/redist/"

# Fetch the directory listing and extract the latest version number
get_latest_version() {
# Get the HTML content of the page
local html_content=$(wget -q -O - "$URL")

# Extract links matching the pattern redistrib_?.?.?.json
local files=$(echo "$html_content" | grep -oP 'redistrib_[0-9]+\.[0-9]+\.[0-9]+\.json' | cut -d'"' -f2)

# If files were found, extract the version numbers and find the latest
if [ -n "$files" ]; then
# Extract just the version numbers using regex
local versions=$(echo "$files" | grep -oP 'redistrib_\K[0-9]+\.[0-9]+\.[0-9]+(?=\.json)')

# Sort the versions and get the latest
local latest_version=$(echo "$versions" | sort -V | tail -n 1)
echo "$latest_version"
else
echo "No files matching the pattern were found."
return 1
fi
}

# Call the function and store the result
latest_version=$(get_latest_version)
28 changes: 14 additions & 14 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ jobs:
matrix:
host-platform:
- linux-64
- linux-aarch64
- win-64
# - linux-aarch64
# - win-64
python-version:
- "3.13"
# - "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
# - "3.11"
# - "3.10"
# - "3.9"
cuda-version:
# Note: this is for build-time only.
- "12.8.0"
Expand Down Expand Up @@ -63,11 +63,11 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Set up MSVC
if: ${{ startsWith(matrix.host-platform, 'win') }}
uses: ilammy/msvc-dev-cmd@v1

- name: Set environment variables
run: |
PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.')
Expand All @@ -79,7 +79,7 @@ jobs:
PWD=$(pwd)
REPO_DIR=$(cygpath -w $PWD)
fi

echo "CUDA_BINDINGS_PARALLEL_LEVEL=$(nproc)" >> $GITHUB_ENV
CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ matrix.host-platform }}"
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
Expand Down Expand Up @@ -215,13 +215,13 @@ jobs:
matrix:
host-platform:
- linux-64
- linux-aarch64
# - linux-aarch64
python-version:
- "3.13"
# - "3.13"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
# - "3.11"
# - "3.10"
# - "3.9"
cuda-version:
# Note: this is for test-time only.
- "12.8.0"
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/test-wheel-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,15 @@ jobs:
host-platform: ${{ inputs.host-platform }}
cuda-version: ${{ inputs.cuda-version }}

- name: Set up latest cuda_sanitizer_api
if: ${{ inputs.local-ctk == '1' }}
uses: ./.github/actions/fetch_ctk
continue-on-error: false
with:
host-platform: ${{ inputs.host-platform }}
cuda-version: "12.8.1"
Comment thread
leofang marked this conversation as resolved.
Outdated
cuda-components: "cuda_sanitizer_api"

- name: Set up compute-sanitizer
run: |
# We don't test compute-sanitizer on CTK<12 because backporting fixes is too much effort
Expand Down