Skip to content

Commit 5fb5870

Browse files
jchen351kleiti
authored andcommitted
Install CUDA 12.2 on Windows (microsoft#18044)
### Description <!-- Describe your changes. --> ### Motivation and Context <!-- - Why is this change required? What problem does it solve? - If it fixes an open issue, please link to the issue here. -->
1 parent 9abc5a0 commit 5fb5870

6 files changed

Lines changed: 36 additions & 22 deletions

File tree

tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ stages:
193193
DoCompliance: ${{ parameters.DoCompliance }}
194194
DoEsrp: ${{ parameters.DoEsrp }}
195195
stage_name_suffix: gpu
196-
EnvSetupScript: setup_env_cuda_11.bat
196+
EnvSetupScript: setup_env_cuda.bat
197197
buildArch: x64
198198
msbuildPlatform: x64
199199
packageName: x64-cuda

tools/ci_build/github/azure-pipelines/post-merge-jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ stages:
6767
- template: templates/jobs/win-ci-vs-2022-job.yml
6868
parameters:
6969
BuildConfig: 'RelWithDebInfo'
70-
EnvSetupScript: setup_env_cuda_11.bat
70+
EnvSetupScript: setup_env_cuda.bat
7171
buildArch: x64
7272
additionalBuildFlags: --enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8" --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
7373
msbuildPlatform: x64
Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
parameters:
2-
- name: EnvSetupScript
3-
type: string
4-
5-
- name: DownloadCUDA
6-
type: boolean
7-
default: false
2+
- name: EnvSetupScript
3+
type: string
4+
- name: DownloadCUDA
5+
type: boolean
6+
default: false
7+
- name: PrimaryCUDAVersion
8+
type: string
9+
default: '11.8'
10+
- name: SecondaryCUDAVersion
11+
type: string
12+
default: '12.2'
813

914
steps:
10-
- ${{ if eq(parameters.DownloadCUDA, 'true') }}:
11-
- powershell: |
12-
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v11.8" $(Agent.TempDirectory)
13-
14-
- task: BatchScript@1
15-
displayName: 'setup env'
16-
inputs:
17-
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}'
18-
modifyEnvironment: true
19-
workingFolder: '$(Build.BinariesDirectory)'
15+
- ${{ if eq(parameters.DownloadCUDA, 'true') }}:
16+
- powershell: |
17+
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.PrimaryCUDAVersion }}" $(Agent.TempDirectory)
18+
displayName: 'Download Primary CUDA SDK v${{ parameters.PrimaryCUDAVersion }}'
19+
- powershell: |
20+
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.SecondaryCUDAVersion }}" $(Agent.TempDirectory)
21+
displayName: 'Download Secondary CUDA SDK v${{ parameters.SecondaryCUDAVersion }}'
22+
- task: BatchScript@1
23+
displayName: 'setup env'
24+
inputs:
25+
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}'
26+
modifyEnvironment: true
27+
workingFolder: '$(Build.BinariesDirectory)'

tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ stages:
4040
- template: templates/jobs/win-ci-vs-2022-job.yml
4141
parameters:
4242
BuildConfig: 'RelWithDebInfo'
43-
EnvSetupScript: setup_env_cuda_11.bat
43+
EnvSetupScript: setup_env_cuda.bat
4444
buildArch: x64
4545
additionalBuildFlags: --enable_pybind --build_java --build_nodejs --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8" --enable_cuda_profiling --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86
4646
msbuildPlatform: x64
@@ -57,7 +57,7 @@ stages:
5757
- template: templates/jobs/win-ci-vs-2022-job.yml
5858
parameters:
5959
BuildConfig: 'RelWithDebInfo'
60-
EnvSetupScript: setup_env_cuda_11.bat
60+
EnvSetupScript: setup_env_cuda.bat
6161
buildArch: x64
6262
additionalBuildFlags: --enable_pybind --enable_training --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8" --skip_onnx_tests --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75
6363
msbuildPlatform: x64
@@ -76,7 +76,7 @@ stages:
7676
- template: templates/jobs/win-ci-vs-2022-job.yml
7777
parameters:
7878
BuildConfig: 'RelWithDebInfo'
79-
EnvSetupScript: setup_env_cuda_11.bat
79+
EnvSetupScript: setup_env_cuda.bat
8080
buildArch: x64
8181
# note: need to specify `--gen_doc` when creating the build config so it has to be in additionalBuildFlags
8282
additionalBuildFlags: --gen_doc validate --skip_tests --enable_pybind --use_dml --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8" --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=OFF

tools/ci_build/github/azure-pipelines/win-gpu-reduce-op-ci-pipeline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
BuildConfig: 'MinSizeRel'
1111
variables:
1212
MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary'
13-
EnvSetupScript: setup_env_cuda_11.bat
13+
EnvSetupScript: setup_env_cuda.bat
1414
buildArch: x64
1515
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
1616
timeoutInMinutes: 120

tools/ci_build/github/windows/setup_env_cuda_11.bat renamed to tools/ci_build/github/windows/setup_env_cuda.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,10 @@ if exist PATH=%AGENT_TEMPDIRECTORY%\v11.8\ {
66
} else {
77
set PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.8\extras\CUPTI\lib64;%PATH%
88
}
9+
@REM The default version is still cuda v11.8, because set cuda v12.2 after it
10+
if exist PATH=%AGENT_TEMPDIRECTORY%\v12.2\ {
11+
set PATH=%PATH%;%AGENT_TEMPDIRECTORY%\v12.2\bin;%AGENT_TEMPDIRECTORY%\v12.2\extras\CUPTI\lib64
12+
} else {
13+
set PATH=%PATH%;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\bin;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\extras\CUPTI\lib64
14+
}
915
set GRADLE_OPTS=-Dorg.gradle.daemon=false

0 commit comments

Comments
 (0)