Skip to content

Commit

Permalink
Update cuda_curr_max to CUDA 12.5 (#328)
Browse files Browse the repository at this point in the history
* Update to cuda12.5

* Fix windows build for 12.5 (#329)

* Improve CUDA toolkit URI generation.

---------

Co-authored-by: Wesley Maxey <71408887+wmaxey@users.noreply.github.com>
  • Loading branch information
jrhemstad and wmaxey committed Jun 13, 2024
1 parent 78b5160 commit 0ec3cbd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 58 deletions.
2 changes: 1 addition & 1 deletion matrix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
x-cuda-prev-min: &cuda_prev_min { name: "cuda", version: "11.1" }
x-cuda-prev-max: &cuda_prev_max { name: "cuda", version: "11.8" }
x-cuda-curr-min: &cuda_curr_min { name: "cuda", version: "12.0" }
x-cuda-curr-max: &cuda_curr_max { name: "cuda", version: "12.4" }
x-cuda-curr-max: &cuda_curr_max { name: "cuda", version: "12.5" }
x-cuda-curr-max: &cuda_curr_max_rapids { name: "cuda", version: "12.2" }

x-gcc-6: &gcc_6 { name: "gcc", version: "6" }
Expand Down
90 changes: 33 additions & 57 deletions windows/image/installers/install-cuda.ps1
Original file line number Diff line number Diff line change
@@ -1,71 +1,47 @@
Param(
[Parameter(Mandatory=$false)]
[string]
$cudaVersion="latest"
$cudaVersion="12.5.0"
)

$cudaUri = @{
# Why did the names change???
"11.0.2" = "11.0.2/network_installers/cuda_11.0.2_win10_network.exe"
"11.0.3" = "11.0.3/network_installers/cuda_11.0.3_win10_network.exe"
"11.0" = "11.0.3/network_installers/cuda_11.0.3_win10_network.exe"
"11.1.0" = "11.1.0/network_installers/cuda_11.1.0_win10_network.exe"
"11.1.1" = "11.1.1/network_installers/cuda_11.1.1_win10_network.exe"
"11.1" = "11.1.1/network_installers/cuda_11.1.1_win10_network.exe"
"12.0.0" = "12.0.0/network_installers/cuda_12.0.0_windows_network.exe"
"12.0.1" = "12.0.1/network_installers/cuda_12.0.1_windows_network.exe"
"12.0" = "12.0.1/network_installers/cuda_12.0.1_windows_network.exe"
"12.1.0" = "12.1.0/network_installers/cuda_12.1.0_windows_network.exe"
"12.1.1" = "12.1.1/network_installers/cuda_12.1.1_windows_network.exe"
"12.1" = "12.1.1/network_installers/cuda_12.1.1_windows_network.exe"
"12.2" = "12.2.0/network_installers/cuda_12.2.0_windows_network.exe"
"12.2.0" = "12.2.0/network_installers/cuda_12.2.0_windows_network.exe"
"12.3" = "12.3.0/network_installers/cuda_12.3.0_windows_network.exe"
"12.3.0" = "12.3.0/network_installers/cuda_12.3.0_windows_network.exe"
"12.4" = "12.4.0/network_installers/cuda_12.4.0_windows_network.exe"
"12.4.0" = "12.4.0/network_installers/cuda_12.4.0_windows_network.exe"
"latest" = "12.4.0/network_installers/cuda_12.4.0_windows_network.exe"
}[$cudaVersion]
# Use System.Version to tokenize version
$version = [Version]$cudaVersion

# The component tags don't include patch, so we need to map input to major.minor
$componentTag = @{
"11.0.2" = "11.0"
"11.0.3" = "11.0"
"11.0" = "11.0"
"11.1.0" = "11.1"
"11.1.1" = "11.1"
"11.1" = "11.1"
"12.0.0" = "12.0"
"12.0.1" = "12.0"
"12.0" = "12.0"
"12.1.0" = "12.1"
"12.1.1" = "12.1"
"12.1" = "12.1"
"12.2" = "12.2"
"12.2.0" = "12.2"
"12.3" = "12.3"
"12.3.0" = "12.3"
"12.4" = "12.4"
"12.4.0" = "12.4"
"latest" = "12.4"
}[$cudaVersion]
$major = $version.Major
$minor = $version.Minor
$build = $version.Build

$cudaVersionUrl = "https://developer.download.nvidia.com/compute/cuda/$cudaUri"
# 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}"

$cudaMajorUri = @{
"11" = "${mmbVersionTag}/network_installers/cuda_${mmbVersionTag}_win10_network.exe"
"12" = "${mmbVersionTag}/network_installers/cuda_${mmbVersionTag}_windows_network.exe"
}["$major"]

$cudaVersionUrl = "https://developer.download.nvidia.com/compute/cuda/$cudaMajorUri"
$cudaComponents =
"nvcc_$componentTag",
"curand_$componentTag",
"curand_dev_$componentTag",
"cudart_$componentTag",
"cupti_$componentTag",
"nvrtc_$componentTag",
"nvrtc_dev_$componentTag",
"nvml_dev_$componentTag",
"nvtx_$componentTag"
"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$componentTag\bin"
$ENV:CUDA_PATH="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$componentTag"
$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"

Remove-Item .\cuda_network.exe

0 comments on commit 0ec3cbd

Please sign in to comment.