forked from NVIDIA/cuda-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_gpu_driver.ps1
More file actions
33 lines (27 loc) · 1.37 KB
/
install_gpu_driver.ps1
File metadata and controls
33 lines (27 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#Requires -RunAsAdministrator
# Install the driver
function Install-Driver {
# Set the correct URL, filename, and arguments to the installer
# This driver is picked to support Windows 11 & CUDA 12.8
$url = 'https://us.download.nvidia.com/tesla/572.13/572.13-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe';
$file_dir = 'C:\NVIDIA-Driver\572.13-data-center-tesla-desktop-win10-win11-64bit-dch-international.exe';
$install_args = '/s /noeula /noreboot';
# Create the folder for the driver download
if (!(Test-Path -Path 'C:\NVIDIA-Driver')) {
New-Item -Path 'C:\' -Name 'NVIDIA-Driver' -ItemType 'directory' | Out-Null
}
# Download the file to a specified directory
# Disabling progress bar due to https://github.com/GoogleCloudPlatform/compute-gpu-installation/issues/29
$ProgressPreference_tmp = $ProgressPreference
$ProgressPreference = 'SilentlyContinue'
Write-Output 'Downloading the driver installer...'
Invoke-WebRequest $url -OutFile $file_dir
$ProgressPreference = $ProgressPreference_tmp
Write-Output 'Download complete!'
# Install the file with the specified path from earlier as well as the RunAs admin option
Write-Output 'Running the driver installer...'
Start-Process -FilePath $file_dir -ArgumentList $install_args -Wait
Write-Output 'Done!'
}
# Run the functions
Install-Driver