Add Windows GPU CI (#600)
* set cuda * update * update * win cuda * cuda_path * print log * update * vsintegration * CUDA toolkit dir * update * update * win GPU * fix typo * 1.16.1 * test * update comments * rm useless steps --------- Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
This commit is contained in:
Родитель
b8cb2f8508
Коммит
5489325df9
|
@ -473,6 +473,54 @@ stages:
|
|||
python -m pytest --ignore=test_cv2.py --ignore=test_tools_add_pre_post_processing_to_model.py . --verbose
|
||||
displayName: Run python test
|
||||
|
||||
- stage: WindowsCUDABuilds
|
||||
dependsOn: []
|
||||
jobs:
|
||||
- job: WindowsC
|
||||
pool:
|
||||
name: 'onnxruntime-extensions-Win2022-GPU-A10'
|
||||
variables:
|
||||
ORT_VERSION: '1.16.2'
|
||||
steps:
|
||||
- template: templates/set_winenv.yml
|
||||
parameters:
|
||||
EnvSetupScript: 'set_env_cuda.bat'
|
||||
DownloadCUDA: true
|
||||
|
||||
- script: |
|
||||
nvidia-smi
|
||||
nvcc --version
|
||||
where nvcc
|
||||
displayName: check cuda version
|
||||
|
||||
- task: DownloadGitHubRelease@0
|
||||
inputs:
|
||||
connection: 'GitHub - Release'
|
||||
userRepository: 'microsoft/onnxruntime'
|
||||
defaultVersionType: 'specificTag'
|
||||
version: 'v$(ORT_VERSION)'
|
||||
itemPattern: '*-win-x64-gpu-$(ORT_VERSION)*'
|
||||
downloadPath: '$(Build.SourcesDirectory)'
|
||||
displayName: Download the ONNXRuntime prebuilt package.
|
||||
|
||||
- task: ExtractFiles@1
|
||||
inputs:
|
||||
archiveFilePatterns: '**/*.zip'
|
||||
destinationFolder: '$(Build.SourcesDirectory)'
|
||||
cleanDestinationFolder: false
|
||||
overwriteExistingFiles: true
|
||||
displayName: Unpack ONNXRuntime package.
|
||||
|
||||
- script: |
|
||||
set CUDA_PATH=$(Agent.TempDirectory)\v11.8
|
||||
call .\build.bat -T cuda="%CUDA_PATH%" -DOCOS_ENABLE_CTEST=ON -DOCOS_USE_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=86 -DOCOS_ONNXRUNTIME_VERSION="$(ORT_VERSION)" -DONNXRUNTIME_PKG_DIR=.\onnxruntime-win-x64-gpu-$(ORT_VERSION)
|
||||
displayName: build the customop library with onnxruntime
|
||||
|
||||
- script: |
|
||||
cd out/Windows
|
||||
ctest -C RelWithDebInfo --output-on-failure
|
||||
displayName: Run C++ native tests
|
||||
|
||||
- stage: WebAssemblyBuilds
|
||||
dependsOn: []
|
||||
jobs:
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
REM Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
REM Licensed under the MIT License.
|
||||
|
||||
if exist PATH=%AGENT_TEMPDIRECTORY%\v11.8\ (
|
||||
set PATH=%AGENT_TEMPDIRECTORY%\v11.8\bin;%AGENT_TEMPDIRECTORY%\v11.8\extras\CUPTI\lib64;%PATH%
|
||||
) 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
|
|
@ -0,0 +1,27 @@
|
|||
parameters:
|
||||
- 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/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)\.pipelines\scripts\${{ parameters.EnvSetupScript }}'
|
||||
modifyEnvironment: true
|
||||
workingFolder: '$(Build.BinariesDirectory)'
|
Загрузка…
Ссылка в новой задаче