mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-05-29 23:06:41 +00:00
Install CUDA 12.2 on Windows (#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. -->
This commit is contained in:
parent
eb47008049
commit
e63ccd3cbb
6 changed files with 36 additions and 22 deletions
|
|
@ -193,7 +193,7 @@ stages:
|
|||
DoCompliance: ${{ parameters.DoCompliance }}
|
||||
DoEsrp: ${{ parameters.DoEsrp }}
|
||||
stage_name_suffix: gpu
|
||||
EnvSetupScript: setup_env_cuda_11.bat
|
||||
EnvSetupScript: setup_env_cuda.bat
|
||||
buildArch: x64
|
||||
msbuildPlatform: x64
|
||||
packageName: x64-cuda
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ stages:
|
|||
- template: templates/jobs/win-ci-vs-2022-job.yml
|
||||
parameters:
|
||||
BuildConfig: 'RelWithDebInfo'
|
||||
EnvSetupScript: setup_env_cuda_11.bat
|
||||
EnvSetupScript: setup_env_cuda.bat
|
||||
buildArch: x64
|
||||
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
|
||||
msbuildPlatform: x64
|
||||
|
|
|
|||
|
|
@ -1,19 +1,27 @@
|
|||
parameters:
|
||||
- name: EnvSetupScript
|
||||
type: string
|
||||
|
||||
- name: DownloadCUDA
|
||||
type: boolean
|
||||
default: false
|
||||
- name: EnvSetupScript
|
||||
type: string
|
||||
- name: DownloadCUDA
|
||||
type: boolean
|
||||
default: false
|
||||
- name: PrimaryCUDAVersion
|
||||
type: string
|
||||
default: '11.8'
|
||||
- name: SecondaryCUDAVersion
|
||||
type: string
|
||||
default: '12.2'
|
||||
|
||||
steps:
|
||||
- ${{ if eq(parameters.DownloadCUDA, 'true') }}:
|
||||
- powershell: |
|
||||
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v11.8" $(Agent.TempDirectory)
|
||||
|
||||
- task: BatchScript@1
|
||||
displayName: 'setup env'
|
||||
inputs:
|
||||
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}'
|
||||
modifyEnvironment: true
|
||||
workingFolder: '$(Build.BinariesDirectory)'
|
||||
- ${{ if eq(parameters.DownloadCUDA, 'true') }}:
|
||||
- powershell: |
|
||||
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.PrimaryCUDAVersion }}" $(Agent.TempDirectory)
|
||||
displayName: 'Download Primary CUDA SDK v${{ parameters.PrimaryCUDAVersion }}'
|
||||
- powershell: |
|
||||
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v${{ parameters.SecondaryCUDAVersion }}" $(Agent.TempDirectory)
|
||||
displayName: 'Download Secondary CUDA SDK v${{ parameters.SecondaryCUDAVersion }}'
|
||||
- task: BatchScript@1
|
||||
displayName: 'setup env'
|
||||
inputs:
|
||||
filename: '$(Build.SourcesDirectory)\tools\ci_build\github\windows\${{ parameters.EnvSetupScript }}'
|
||||
modifyEnvironment: true
|
||||
workingFolder: '$(Build.BinariesDirectory)'
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ stages:
|
|||
- template: templates/jobs/win-ci-vs-2022-job.yml
|
||||
parameters:
|
||||
BuildConfig: 'RelWithDebInfo'
|
||||
EnvSetupScript: setup_env_cuda_11.bat
|
||||
EnvSetupScript: setup_env_cuda.bat
|
||||
buildArch: x64
|
||||
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
|
||||
msbuildPlatform: x64
|
||||
|
|
@ -57,7 +57,7 @@ stages:
|
|||
- template: templates/jobs/win-ci-vs-2022-job.yml
|
||||
parameters:
|
||||
BuildConfig: 'RelWithDebInfo'
|
||||
EnvSetupScript: setup_env_cuda_11.bat
|
||||
EnvSetupScript: setup_env_cuda.bat
|
||||
buildArch: x64
|
||||
additionalBuildFlags: --enable_pybind --enable_training --use_cuda --cuda_home="$(Agent.TempDirectory)\v11.8" --skip_onnx_tests --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=75
|
||||
msbuildPlatform: x64
|
||||
|
|
@ -76,7 +76,7 @@ stages:
|
|||
- template: templates/jobs/win-ci-vs-2022-job.yml
|
||||
parameters:
|
||||
BuildConfig: 'RelWithDebInfo'
|
||||
EnvSetupScript: setup_env_cuda_11.bat
|
||||
EnvSetupScript: setup_env_cuda.bat
|
||||
buildArch: x64
|
||||
# note: need to specify `--gen_doc` when creating the build config so it has to be in additionalBuildFlags
|
||||
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
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ jobs:
|
|||
BuildConfig: 'MinSizeRel'
|
||||
variables:
|
||||
MsbuildArguments: '-detailedsummary -maxcpucount -consoleloggerparameters:PerformanceSummary'
|
||||
EnvSetupScript: setup_env_cuda_11.bat
|
||||
EnvSetupScript: setup_env_cuda.bat
|
||||
buildArch: x64
|
||||
TODAY: $[format('{0:dd}{0:MM}{0:yyyy}', pipeline.startTime)]
|
||||
timeoutInMinutes: 120
|
||||
|
|
|
|||
|
|
@ -6,4 +6,10 @@ if exist PATH=%AGENT_TEMPDIRECTORY%\v11.8\ {
|
|||
} else {
|
||||
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%
|
||||
}
|
||||
@REM The default version is still cuda v11.8, because set cuda v12.2 after it
|
||||
if exist PATH=%AGENT_TEMPDIRECTORY%\v12.2\ {
|
||||
set PATH=%PATH%;%AGENT_TEMPDIRECTORY%\v12.2\bin;%AGENT_TEMPDIRECTORY%\v12.2\extras\CUPTI\lib64
|
||||
} else {
|
||||
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
|
||||
}
|
||||
set GRADLE_OPTS=-Dorg.gradle.daemon=false
|
||||
Loading…
Reference in a new issue