Coder Social home page Coder Social logo

cloud-gpu-updater's Introduction

This script is made to run on Paperspace P4000, P5000, AWS G3.4xLarge and Azure NV6 machines.

This script checks NVIDIA.com for updates, and will download and install graphics drivers including setting NVIDIA-SMI to the correct value on required GPUs.

Supported Operating Systems

Windows Server 2016
Windows Server 2019

Supported GPUs

AWS G3.4xLarge (Tesla M60)
AWS G2.2xLarge (GRID K520)
AWS G4dn.xLarge (Tesla T4 with vGaming driver)
Azure NV6 (Tesla M60)
Paperspace P4000 (Quadro P4000)
Paperspace P5000 (Quadro P5000)
Google P100 VW (Tesla P100 with Virtual Workstation Driver)
Google P4 VW (Tesla P4 with Virtual Workstation Driver)
Google T4 VW (Tesla T4 with Virtual Workstation Driver)

Instructions

  1. Download https://github.com/jamesstringerparsec/Cloud-GPU-Updater/archive/master.zip
  2. Extract the folder, right click "GPU Updater Tool.ps1" and run with Powershell - if the script immediately closes, right click and click edit, then the green play button in the Powershell ISE toolbar.

Q&A

Q. Why aren't Windows 10, 8.1 or Server 2012 supported
A. There is no need currently for Windows 8.1 or Server 2012, we will investigate Windows 10 when it is generaly available.

cloud-gpu-updater's People

Contributors

anntoin avatar jamesstringerparsec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cloud-gpu-updater's Issues

Support Windows Server 2012 R2 [atleast for Azure]

Hello,
many people like to use Windows Server 2012 R2 for Cloud Gaming usage because not everyone is a friend of Windows 10.
So unlike Windows 8.1, I see reasons to support Server 2012.

Would be nice if you support it, I can even help you if you want.

On AWS and Google Cloud, I am not sure if they support GRID drivers for Server 2012, but on Azure they support

GPU udpater error on AWS g4dn.xlarge instance

I'm getting the following error when trying to run the script:

PS C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master> C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:443 char:65

  • ... e_ID -eq "DEV_1EB8†) -or $($gpu.Device_ID -eq "DEV_15F8†) -or $($ ...
  •                                                 ~~~~~~~~~~~~~
    

The string is missing the terminator: ".
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:443 char:79

  • ... _ID -eq "DEV_1EB8†) -or $($gpu.Device_ID -eq "DEV_15F8†) -or $($g ...
  •                                                              ~
    

Missing closing ')' in subexpression.
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:443 char:104

  • ... e_ID -eq "DEV_15F8†) -or $($gpu.Device_ID -eq "DEV_1BB3†) -or $($ ...
  •                                                 ~~~~~~~~~~~~~
    

The string is missing the terminator: ".
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:443 char:118

  • ... _ID -eq "DEV_15F8†) -or $($gpu.Device_ID -eq "DEV_1BB3†) -or $($g ...
  •                                                              ~
    

Missing closing ')' in subexpression.
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:443 char:143

  • ... Device_ID -eq "DEV_1BB3†) -or $($gpu.Device_ID -eq "DEV_7362†)) {
  •                                                      ~~~~~~~~~~~~~
    

The string is missing the terminator: ".
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:443 char:157

  • ... Device_ID -eq "DEV_1BB3†) -or $($gpu.Device_ID -eq "DEV_7362†)) {
  •                                                                    ~
    

Missing closing ')' in subexpression.
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:456 char:30

  • ... ported -eq "UnOfficial") -and ($gpu.cloudprovider -eq "aws") -and ($g ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    

Unexpected token 'UnOfficial") -and ($gpu.cloudprovider -eq "aws") -and ($gpu.Device_ID -eq "DEV_1EB8")) -eq $true){
$S3Path = AWSPrivatedriver -profileName ParsecGPUUpdate -GPU "G4dn"
(New-Object System.Net.WebClient).DownloadFile($("https://nvidia-gaming.s3.amazonaws.com/" + $s3path), $($system.Path) + "\NVIDIA_"

  • $($gpu.web_driver) + ".zip")
    Expand-Archive -Path ($($system.Path) + "\NVIDIA_" + $($gpu.web_driver) + ".zip") -DestinationPath
    "$($system.Path)\ExtractedGPUDriver"
    $extractedpath = Get-ChildItem -Path "$($system.Path)\ExtractedGPUDriver\Windows" | Where-Object name -like 'win10' | % name
    Rename-Item -Path "$($system.Path)\ExtractedGPUDriver\Windows$extractedpath" -NewName "NVIDIA_$($gpu.web_driver).exe"
    Move-Item -Path "$($system.Path)\ExtractedGPUDriver\Windows\NVIDIA_$($gpu.web_driver).exe" -Destination $system.Path
    remove-item "$($system.Path)\NVIDIA_$($gpu.web_driver).zip"
    remove-item "$($system.Path)\ExtractedGPUDriver" -Recurse
    (New-Object
    System.Net.WebClient).DownloadFile("https://nvidia-gaming.s3.amazonaws.com/GridSwCert-Archive/GridSwCert-Windows_2020_04.cert",
    "C:\Users\Public\Documents\GridSwCert.txt")
    ClearG4DNCredentials ParsecGPUUpdate
    }
    Elseif((($gpu.Supported -eq "UnOfficial") -and ($gpu.cloudprovider -eq "aws") -and ($gpu.Device_ID -eq "DEV_7362")) -eq $true){
    $S3Path = AWSPrivatedriver -profileName ParsecGPUUpdate -GPU "G4ad"
    (New-Object System.Net.WebClient).DownloadFile($("https://ec2-amd-windows-drivers.s3.amazonaws.com/" + $s3path), $($system.Path) +
    "\AMD_" + $($gpu.web_driver) + ".zip")
    Expand-Archive -Path ($($system.Path) + "\AMD_" + $($gpu.web_driver) + ".zip") -DestinationPath "$($system.Path)\ExtractedGPUDriver"
    $GPU.AMDExtractedPath = Get-ChildItem -Path "$($system.Path)\ExtractedGPUDriver" -recurse -Directory | Where-Object name -like
    'WT6A_INF' | % FullName
    }
    Elseif ((($gpu.supported -eq "UnOfficial") -and ($gpu.cloudprovider -eq "Google"))-eq $true) {
    $googlestoragedriver =([xml](invoke-webrequest -uri
    https://storage.googleapis.com/nvidia-drivers-us-public).content).listbucketresult.contents.key -like "GRID1server2016*.exe" | select
    -last 1
    (New-Object System.Net.WebClient).DownloadFile($("https://storage.googleapis.com/nvidia-drivers-us-public/" + $googlestoragedriver),
    "C:\ParsecTemp\Drivers\GoogleGRID.exe")
    }
    Elseif((($gpu.Supported -eq "yes") -and ($gpu.cloudprovider -eq "aws") -and ($gpu.Device_ID -ne "DEV_118A") -and ($gpu.Device_ID -ne
    "DEV_1EB8")) -eq $true) {
    $s3path = $(([xml](invoke-webrequest -uri
    https://ec2-windows-nvidia-drivers.s3.amazonaws.com).content).listbucketresult.contents.key -like "latest/server2016")
    (New-Object System.Net.WebClient).DownloadFile($("https://ec2-windows-nvidia-drivers.s3.amazonaws.com/" + $s3path), $($system.Path)
  • "\NVIDIA_" + $($gpu.web_driver) + ".exe")
    }
    Elseif((($gpu.Supported -eq "yes") -and ($gpu.cloudprovider -eq "azure")) -eq $true){
    $azuresupportpage = (Invoke-WebRequest -Uri https://docs.microsoft.com/en-us/azure/virtual-machines/windows/n-series-driver-setup
    -UseBasicParsing).links.outerhtml -like "GRID"
    (New-Object System.Net.WebClient).DownloadFile($($azuresupportpage[0].split('"')[1]), $($system.Path) + "\NVIDIA_" +
    $($gpu.web_driver) + ".exe")
    }
    Else {
    #downloads driver from nvidia.com
    $Download.Link = Invoke-WebRequest -Uri $gpu.url -Method Get -UseBasicParsing | select @{N='Latest';E={$($.links.href
    -match"www.nvidia.com/download/driverResults.aspx*")[0].substring(2)}}
    $download.Direct = Invoke-WebRequest -Uri $download.link.latest -Method Get -UseBasicParsing | select @{N= 'Download';
    E={"http://us.download.nvidia.com" + $($
    .links.href -match "/content/driverdownload*").split('=')[1].split('&')[0]}}
    (New-Object System.Net.WebClient).DownloadFile($($download.direct.download), $($system.Path) + "\NVIDIA_" + $($gpu.web_driver) +
    ".exe")
    }
    }
    function Test-RegistryValue {

    https://www.jonathanmedd.net/2014/02/testing-for-the-presence-of-a-registry-key-and-value.html

    param (
    [parameter(Mandatory=$true)]
    [ValidateNotNullOrEmpty()]$Path,
    [parameter(Mandatory=$true)]
    [ValidateNotNullOrEmpty()]$Value
    )
    try {
    Get-ItemProperty -Path $Path | Select-Object -ExpandProperty $Value -ErrorAction Stop | Out-Null
    return $true
    }
    catch {
    return $false
    }
    }
    function DisableSecondMonitor {
    #downloads script to set GPU to WDDM if required
    (New-Object System.Net.WebClient).DownloadFile("https://raw.githubusercontent.com/parsec-cloud/Cloud-GPU-Updater/master/Additional%20File
    s/DisableSecondMonitor.ps1", $($system.Path) + "\DisableSecondMonitor.ps1")
    Unblock-File -Path "$($system.Path)\DisableSecondMonitor.ps1"
    }
    function DisableSecondMonitor-shortcut{
    #creates startup shortcut that will start the script downloaded in setnvsmi
    #Write-Output "Generic' in expression or statement.
    At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:572 char:28
  •                ((//////
    
  •                        ~
    

Missing closing ')' in expression.
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:587 char:27

  •                      *#############///
    
  •                       ~
    

You must provide a value expression following the '*' operator.
At C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master\GPUUpdaterTool.ps1:591 char:19

  •               ~Parsec GPU Updater~
    
  •               ~~~~~~~
    

Unexpected token '~Parsec' in expression or statement.
Not all parse errors were reported. Correct the reported errors and try again.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : TerminatorExpectedAtEndOfString

PS C:\Users\Administrator\Downloads\Cloud-GPU-Updater-master\Cloud-GPU-Updater-master>

GPU Updater crashes on AWS G4.xlarge, due to Nvidia driver directory structure changing

The GPU updater crashes with the following error:

Move-Item : Cannot find path 'C:\ParsecTemp\Drivers\ExtractedGPUDriver\NVIDIA_445.87.exe' because it does not exist.
At C:\Users\Administrator\Documents\Untitled1.ps1:264 char:1
+ Move-Item -Path "$($system.Path)\ExtractedGPUDriver\NVIDIA_$($gpu.web ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\ParsecTemp\D...IDIA_445.87.exe:String) [Move-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.MoveItemCommand

This occurs because the ExtractedGPUDriver path needs to be changed to "$($system.Path)\ExtractedGPUDriver\Windows" as the directory structure of the driver ZIP file has changed:

Old:
├── 440.68-442.59-March2020-grid-vgaming-applicaton-note.pdf
├── 442.59_grid_vgaming_win10_64bit_international_whql.exe
├── 442.59_grid_vgaming_win8_win7_64bit_international_whql.exe
└── GRID-442.59-Mar2020-vGaming-Windows-Guest-Drivers.zip


New:
.
├── GRID-445.87-Apr2020-vGaming-Windows-Guest-Drivers.zip
└── Windows
    ├── 445.87-445.48-April2020-grid-vgaming-applicaton-note..pdf
    ├── 445.87_grid_vgaming_win10_64bit_international_whql.exe
    └── 445.87_grid_vgaming_win8_win7_64bit_international_whql.exe

https://github.com/jamesstringerparsec/Cloud-GPU-Updater/blob/e6832db7c9c74e62458121d8eb8bddb2f9047648/GPU%20Updater%20Tool.ps1#L262

Updating the path on that line and the next few resolved the issue on my instance. Thank you for this tool.

GPU Drivers download links expired

Hello, I am not able to download GPU drivers, I am using AWS g4dn.xlarge instance, (Tesla T4 GPU) I am getting this error and I searched it and I got to know that download link is expired. You can send me the link of GPU drivers in mail or something if you have them. Here is the error:

Downloading Driver
Invoke-WebRequest : Cannot validate argument on parameter 'Uri'. The argument is null or empty. Provide an argument
that is not null or empty, and then try the command again.
At C:\ProgramData\ParsecLoader\GPUUpdaterTool.ps1:499 char:51
+ ... ownload.Direct = Invoke-WebRequest -Uri $download.link.latest -Method ...
+                                             ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Invoke-WebRequest], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Exception calling "DownloadFile" with "2" argument(s): "Value cannot be null.
Parameter name: address"
At C:\ProgramData\ParsecLoader\GPUUpdaterTool.ps1:500 char:119
+ ... t.download), $($system.Path) + "\NVIDIA_" + $($gpu.web_driver) + ".ex ...
+                                                   ~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentNullException

Success!


Installing Driver, this may take up to 10 minutes and will automatically reboot if required
Start-Process : This command cannot be run completely because the system cannot find all the information required.
At C:\ProgramData\ParsecLoader\GPUUpdaterTool.ps1:548 char:9
+         Start-Process -FilePath "$($system.Path)\$dlpath" -ArgumentLi ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

Success - Driver Installed

`GPU Updater Tool.ps1` throws exception "Value cannot be null. Parameter name: address"

https://github.com/jamesstringerparsec/Cloud-GPU-Updater/blob/6e3f42c526eb413854fba8f2ce59e2d50ce41102/GPU%20Updater%20Tool.ps1#L208-L218

Configuration

  • OS: Windows Server 2016 Datacenter
  • Tier: Standard NV6

To reproduce

  1. Manually deploy a new Virtual Machine from Azure Portal with the configurations below:
Location: South Central US
Virtual Machine Size: Standard NV6
Allow Public Inbound Port: RDP:3389
Data Disks: Standard SSD 1023 GiB (Attached)
  1. After deployment successfully created, connect to the virtual machine through Microsoft Remote Desktop
  2. Copy the script referenced here and paste into PowerShell (Admin)
  3. After the PowerShell window closed automatically. Run PostInstall.ps1, it will install Chrome, Parsec, etc... Follow the steps in the output of PowerShell window.
  4. Run GPU Updater.Ink which is located at Desktop.

If It's about the script, It will produce same error. If not:

What I've done to fix it

  • Windows Firewall was On. Turned off and tried again. Gave the same error.
  • Tried to run the GPU Updater Tool.ps1 in PowerShell ISE

Google Cloud Auth Error?

When I try to run the programm on a google cloud vm with a t4. The VM gives me those two errors. I googled what could be the error and saw that you need to auth to the google cloud with gcloud auth login . I also did that and I still got the error bellow.

invoke-webrequest : AccessDeniedAccess denied.Anonymous caller does not have storage.objects.list access to the Google
Cloud Storage bucket.
At C:\ProgramData\ParsecLoader\GPUUpdaterTool.ps1:264 char:38
+ ... ver =([xml](invoke-webrequest -uri https://storage.googleapis.com/nvi ...
+                 
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
You cannot call a method on a null-valued expression.
At C:\ProgramData\ParsecLoader\GPUUpdaterTool.ps1:265 char:9
         $googlestoragedriver.split('/')[2].split('_')[0]
+        
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

This GPU (NVIDIA Tesla T4) requires a private driver downloaded from the Google Support Site
invoke-webrequest : AccessDeniedAccess denied.Anonymous caller does not have storage.objects.list access to the Google
Cloud Storage bucket.
At C:\ProgramData\ParsecLoader\GPUUpdaterTool.ps1:264 char:38
+ ... ver =([xml](invoke-webrequest -uri https://storage.googleapis.com/nvi ...
+     
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
   eption
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
You cannot call a method on a null-valued expression.
At C:\ProgramData\ParsecLoader\GPUUpdaterTool.ps1:265 char:9
        $googlestoragedriver.split('/')[2].split('_')[0]
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

Update tool does not work on AWS g2.2xlarge instances

After trying this tool on the AWS g2.2xlarge instances, I found out that the downloaded driver is not compatible with Windows Server 2016.

The downloaded driver for GRID K520 is https://ec2-windows-nvidia-drivers.s3.amazonaws.com/latest/431.02_grid_win10_server2016_server2019_64bit_international.exe but this one does not work with server2016 + K520.

The official website shows that the latest driver for this card is 370.39 (grid-4.6) (https://www.nvidia.com/download/driverResults.aspx/151636/en-us). That is probably why AWS Documentation says that the drivers should be downloaded manually and not from the S3 bucket.

Specify license

Hey,
thanks for providing this tool.
It would be helpful to know the software license of it. I don't intent to use it commercially.

Thanks a lot.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.