-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into explicit-credentials-for-s3-configuration
- Loading branch information
Showing
62 changed files
with
6,066 additions
and
1,183 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: nvcc-toolchain | ||
inputs: | ||
cuda-version: | ||
description: CUDA Toolkit version | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- if: runner.os == 'Linux' | ||
shell: bash | ||
run: .github/actions/nvcc-toolchain/install-cuda.sh ${{ inputs.cuda-version }} | ||
|
||
- if: runner.os == 'Windows' | ||
shell: powershell | ||
run: .\.github\actions\nvcc-toolchain\install-cuda.ps1 -cudaVersion ${{ inputs.cuda-version }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Param( | ||
[Parameter(Mandatory=$false)] | ||
[string] | ||
$cudaVersion="12.6.0" | ||
) | ||
|
||
# Use System.Version to tokenize version | ||
$version = [Version]$cudaVersion | ||
|
||
$major = $version.Major | ||
$minor = $version.Minor | ||
$build = $version.Build | ||
|
||
# Minimum build is 0, not -1 as default in case "12.5" is passed | ||
if ($build -lt 0) { | ||
$build = 0 | ||
} | ||
|
||
# mmb == major minor build | ||
$mmbVersionTag = "${major}.${minor}.${build}" | ||
# mm = major minor | ||
$mmVersionTag = "${major}.${minor}" | ||
|
||
$cudaVersionUrl = "https://developer.download.nvidia.com/compute/cuda/${mmbVersionTag}/network_installers/cuda_${mmbVersionTag}_windows_network.exe" | ||
|
||
### | ||
# `cuda_${mmbVersionTag}_windows_network.exe` name only valid back to CUDA v11.5.1. | ||
# Before that it was named `cuda_${mmbVersionTag}_win10_network.exe`: | ||
# * https://developer.download.nvidia.com/compute/cuda/11.5.1/network_installers/cuda_11.5.1_windows_network.exe | ||
# * https://developer.download.nvidia.com/compute/cuda/11.5.0/network_installers/cuda_11.5.0_win10_network.exe | ||
### | ||
|
||
if ([version]$mmbVersionTag -le "11.5.0") { | ||
$cudaVersionUrl = "https://developer.download.nvidia.com/compute/cuda/${mmbVersionTag}/network_installers/cuda_${mmbVersionTag}_win10_network.exe" | ||
} | ||
|
||
$cudaComponents = | ||
"nvcc_$mmVersionTag", | ||
"curand_$mmVersionTag", | ||
"curand_dev_$mmVersionTag", | ||
"cudart_$mmVersionTag", | ||
"cupti_$mmVersionTag", | ||
"nvrtc_$mmVersionTag", | ||
"nvrtc_dev_$mmVersionTag", | ||
"nvml_dev_$mmVersionTag", | ||
"nvtx_$mmVersionTag" | ||
|
||
Invoke-WebRequest -Uri "$cudaVersionUrl" -OutFile "./cuda_network.exe" -UseBasicParsing | ||
Start-Process -Wait -PassThru -FilePath .\cuda_network.exe -ArgumentList "-s $cudaComponents" | ||
|
||
$ENV:PATH="$ENV:PATH;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$mmVersionTag\bin" | ||
$ENV:CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$mmVersionTag" | ||
|
||
$PATH_STR="PATH=$ENV:PATH" | ||
$PATH_STR | Out-File -Append $ENV:GITHUB_ENV | ||
|
||
$CUDA_PATH_STR="CUDA_PATH=$ENV:CUDA_PATH" | ||
$CUDA_PATH_STR | Out-File -Append $ENV:GITHUB_ENV | ||
|
||
Remove-Item .\cuda_network.exe |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
#! /usr/bin/env bash | ||
set -eu | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
get_cuda_deb() { | ||
local deb="$( \ | ||
wget --no-hsts -q -O- "${1}/Packages" \ | ||
| grep -P "^Filename: \./${2}(.*)\.deb$" \ | ||
| sort -Vr | head -n1 | cut -d' ' -f2 \ | ||
)"; | ||
if [ -z "$deb" ]; then | ||
echo "Error: No matching .deb found for '${1}' and '${2}'" >&2 | ||
return 1 | ||
fi | ||
wget --no-hsts -q -O "/tmp/${deb#./}" "${1}/${deb#./}"; | ||
echo -n "/tmp/${deb#./}"; | ||
} | ||
|
||
VERSION="$1"; | ||
|
||
NVARCH="$(uname -p)"; | ||
|
||
if test "$NVARCH" = aarch64; then | ||
NVARCH="sbsa"; | ||
fi | ||
|
||
OSNAME="$( | ||
. /etc/os-release; | ||
major="$(cut -d'.' -f1 <<< "${VERSION_ID}")"; | ||
minor="$(cut -d'.' -f2 <<< "${VERSION_ID}")"; | ||
echo "$ID$((major - (major % 2)))${minor}"; | ||
)"; | ||
|
||
CUDA_HOME="/usr/local/cuda"; | ||
|
||
cuda_repo_base="https://developer.download.nvidia.com/compute/cuda/repos"; | ||
cuda_repo="${cuda_repo_base}/${OSNAME}/${NVARCH}"; | ||
|
||
cuda_ver="$VERSION"; | ||
cuda_ver="$(grep -Po '^[0-9]+\.[0-9]+' <<< "${cuda_ver}")"; | ||
cuda_ver="${cuda_ver/./-}"; | ||
|
||
if ! dpkg -s cuda-keyring; then | ||
sudo apt-get install -y --no-install-recommends \ | ||
"$(get_cuda_deb "${cuda_repo}" cuda-keyring)" \ | ||
; | ||
fi | ||
|
||
PKGS=(); | ||
PKGS+=("cuda-toolkit-${cuda_ver}"); | ||
|
||
sudo apt-get update; | ||
sudo apt-get install -y --no-install-recommends "${PKGS[@]}"; | ||
|
||
if ! test -L "${CUDA_HOME}"; then | ||
# Create /usr/local/cuda symlink | ||
sudo ln -s "${CUDA_HOME}-${cuda_ver}" "${CUDA_HOME}"; | ||
fi | ||
|
||
export PATH="$PATH:$CUDA_HOME/bin" | ||
|
||
which -a nvcc | ||
nvcc --version | ||
|
||
cat <<EOF | tee -a "$GITHUB_ENV" | ||
CUDA_HOME=$CUDA_HOME | ||
CUDA_PATH=$CUDA_HOME | ||
PATH=$PATH | ||
EOF | ||
|
||
rm /tmp/*.deb |
This file contains 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
Oops, something went wrong.