2021-04-27 01:27:45 +08:00
|
|
|
# Copyright (c) Microsoft Corporation.
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
# REPLACE WITH DROP-TO-ADMIN-USER-PREFIX.ps1
|
|
|
|
|
|
|
|
# REPLACE WITH UTILITY-PREFIX.ps1
|
|
|
|
|
2024-03-19 04:26:24 +08:00
|
|
|
# If you are running this script outside of our Azure VMs, you will need to download cudnn from NVIDIA and place
|
|
|
|
# it next to this script.
|
2021-04-27 01:27:45 +08:00
|
|
|
|
2023-03-22 03:27:26 +08:00
|
|
|
$CudaUrl = 'https://developer.download.nvidia.com/compute/cuda/12.1.0/network_installers/cuda_12.1.0_windows_network.exe'
|
2021-04-27 01:27:45 +08:00
|
|
|
|
2023-03-22 03:27:26 +08:00
|
|
|
# https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html
|
|
|
|
# Intentionally omitted:
|
|
|
|
# demo_suite_12.1
|
|
|
|
# documentation_12.1
|
|
|
|
# nvvm_samples_12.1
|
|
|
|
# Display.Driver
|
2021-04-27 01:27:45 +08:00
|
|
|
|
2023-03-22 03:27:26 +08:00
|
|
|
$CudaInstallerArgs = @(
|
|
|
|
'-s',
|
|
|
|
'cublas_12.1',
|
|
|
|
'cublas_dev_12.1',
|
|
|
|
'cuda_profiler_api_12.1',
|
|
|
|
'cudart_12.1',
|
|
|
|
'cufft_12.1',
|
|
|
|
'cufft_dev_12.1',
|
|
|
|
'cuobjdump_12.1',
|
|
|
|
'cupti_12.1',
|
|
|
|
'curand_12.1',
|
|
|
|
'curand_dev_12.1',
|
|
|
|
'cusolver_12.1',
|
|
|
|
'cusolver_dev_12.1',
|
|
|
|
'cusparse_12.1',
|
|
|
|
'cusparse_dev_12.1',
|
|
|
|
'cuxxfilt_12.1',
|
|
|
|
'npp_12.1',
|
|
|
|
'npp_dev_12.1',
|
|
|
|
'nsight_compute_12.1',
|
|
|
|
'nsight_systems_12.1',
|
|
|
|
'nsight_vse_12.1',
|
|
|
|
'nvcc_12.1',
|
|
|
|
'nvdisasm_12.1',
|
|
|
|
'nvjitlink_12.1',
|
|
|
|
'nvjpeg_12.1',
|
|
|
|
'nvjpeg_dev_12.1',
|
|
|
|
'nvml_dev_12.1',
|
|
|
|
'nvprof_12.1',
|
|
|
|
'nvprune_12.1',
|
|
|
|
'nvrtc_12.1',
|
|
|
|
'nvrtc_dev_12.1',
|
|
|
|
'nvtx_12.1',
|
|
|
|
'occupancy_calculator_12.1',
|
|
|
|
'opencl_12.1',
|
|
|
|
'sanitizer_12.1',
|
|
|
|
'thrust_12.1',
|
|
|
|
'visual_profiler_12.1',
|
|
|
|
'visual_studio_integration_12.1'
|
|
|
|
)
|
|
|
|
|
|
|
|
$destination = "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v12.1"
|
2021-04-27 01:27:45 +08:00
|
|
|
|
|
|
|
try {
|
|
|
|
Write-Host 'Downloading CUDA...'
|
|
|
|
[string]$installerPath = Get-TempFilePath -Extension 'exe'
|
|
|
|
curl.exe -L -o $installerPath -s -S $CudaUrl
|
|
|
|
Write-Host 'Installing CUDA...'
|
2023-03-22 03:27:26 +08:00
|
|
|
$proc = Start-Process -FilePath $installerPath -ArgumentList $CudaInstallerArgs -Wait -PassThru
|
2021-04-27 01:27:45 +08:00
|
|
|
$exitCode = $proc.ExitCode
|
|
|
|
if ($exitCode -eq 0) {
|
|
|
|
Write-Host 'Installation successful!'
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Write-Error "Installation failed! Exited with $exitCode."
|
|
|
|
throw
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch {
|
|
|
|
Write-Error "Failed to install CUDA! $($_.Exception.Message)"
|
|
|
|
throw
|
|
|
|
}
|