]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/deploy-cuda.ps1
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / scripts / azure-pipelines / windows / deploy-cuda.ps1
1 # Copyright (c) Microsoft Corporation.
2 # SPDX-License-Identifier: MIT
3
4 # REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
5
6 # REPLACE WITH UTILITY-PREFIX.ps1
7
8 # REPLACE WITH $CudnnUrl
9
10 $CudnnLocalZipPath = "$PSScriptRoot\cudnn-11.2-windows-x64-v8.1.1.33.zip"
11
12 $CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/11.3.0/network_installers/cuda_11.3.0_win10_network.exe'
13
14 $CudaFeatures = 'nvcc_11.3 cuobjdump_11.3 nvprune_11.3 cupti_11.3 memcheck_11.3 nvdisasm_11.3 nvprof_11.3 ' + `
15 'visual_studio_integration_11.3 visual_profiler_11.3 visual_profiler_11.3 cublas_11.3 cublas_dev_11.3 ' + `
16 'cudart_11.3 cufft_11.3 cufft_dev_11.3 curand_11.3 curand_dev_11.3 cusolver_11.3 cusolver_dev_11.3 ' + `
17 'cusparse_11.3 cusparse_dev_11.3 npp_11.3 npp_dev_11.3 nvrtc_11.3 nvrtc_dev_11.3 nvml_dev_11.3 ' + `
18 'occupancy_calculator_11.3 thrust_11.3 '
19
20 $destination = "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v11.3"
21
22 try {
23 Write-Host 'Downloading CUDA...'
24 [string]$installerPath = Get-TempFilePath -Extension 'exe'
25 curl.exe -L -o $installerPath -s -S $CudaUrl
26 Write-Host 'Installing CUDA...'
27 $proc = Start-Process -FilePath $installerPath -ArgumentList @('-s ' + $CudaFeatures) -Wait -PassThru
28 $exitCode = $proc.ExitCode
29 if ($exitCode -eq 0) {
30 Write-Host 'Installation successful!'
31 }
32 else {
33 Write-Error "Installation failed! Exited with $exitCode."
34 throw
35 }
36 }
37 catch {
38 Write-Error "Failed to install CUDA! $($_.Exception.Message)"
39 throw
40 }
41
42 try {
43 if ([string]::IsNullOrWhiteSpace($CudnnUrl)) {
44 if (-Not (Test-Path $CudnnLocalZipPath)) {
45 throw "CUDNN zip ($CudnnLocalZipPath) was missing, please download from NVidia and place next to this script."
46 }
47
48 $cudnnZipPath = $CudnnLocalZipPath
49 } else {
50 Write-Host 'Downloading CUDNN...'
51 $cudnnZipPath = Get-TempFilePath -Extension 'zip'
52 curl.exe -L -o $cudnnZipPath -s -S $CudnnUrl
53 }
54
55 Write-Host "Installing CUDNN to $destination..."
56 tar.exe -xvf "$cudnnZipPath" --strip 1 --directory "$destination"
57 Write-Host 'Installation successful!'
58 }
59 catch {
60 Write-Error "Failed to install CUDNN! $($_.Exception.Message)"
61 throw
62 }