lord-carlos / nvidia-update

Checks for a new version of the Nvidia Driver, downloads and installs it.
MIT License
147 stars 29 forks source link

Multi GPU / SLI detection not supported #1

Open gsparx opened 7 years ago

gsparx commented 7 years ago

I've been using this for a while now to great effect, so thanks for putting it together!

Just this time I ran it, I'm now seeing this error:

PS C:\Users\garrett\Downloads> $ins_version = (Get-WmiObject Win32_PnPSignedDriver | where {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"}).DriverVersion.SubString(7).Remove(1,1)
Cannot find an overload for "Remove" and the argument count: "2".
At line:1 char:1
+ $ins_version = (Get-WmiObject Win32_PnPSignedDriver | where {$_.devic ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

Any idea what might cause that? I tweaked it to on.SubString(7).Replace(".", "") but appending the .Insert(3, ".") to that results in Exception calling "Insert" with "2" argument(s): "Collection was of a fixed size."

Any help is appreciated!

lord-carlos commented 7 years ago

Does this return anything? (Get-WmiObject Win32_PnPSignedDriver | where {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"}).DriverVersion

Do you have any drivers installed or is this a fresh windows install?

gsparx commented 7 years ago

Yeah, it does.

PS C:\Users\garrett\Downloads> $ins_version = (Get-WmiObject Win32_PnPSignedDriver | where {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"}).DriverVersion.SubString(7)

PS C:\Users\garrett\Downloads> $ins_version
3.8219
3.8219
PS C:\Users\garrett\Downloads> $ins_version = (Get-WmiObject Win32_PnPSignedDriver | where {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"}).DriverVersion

PS C:\Users\garrett\Downloads> $ins_version
22.21.13.8219
22.21.13.8219

It's only once I get up to the Replace part that it has issues. This is weird since I've used this before successfully several times.

gsparx commented 7 years ago

looks like it might be related to the fact that it's returning two results for DriverVersion

I just tweaked it to be DriverVersion[0] and it looks like that command passed

lord-carlos commented 7 years ago

Yes, the two results are weird. Can you show me what this returns?

(Get-WmiObject Win32_PnPSignedDriver | where {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"})

The same as before, but without the .DriverVersion.

gsparx commented 7 years ago

Aha you've discovered the problem.

PS C:\Users\garrett\Downloads> (Get-WmiObject Win32_PnPSignedDriver | where {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"})

__GENUS                 : 2
__CLASS                 : Win32_PnPSignedDriver
__SUPERCLASS            : CIM_Service
__DYNASTY               : CIM_ManagedSystemElement
__RELPATH               : 
__PROPERTY_COUNT        : 28
__DERIVATION            : {CIM_Service, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                : DESKTOP-TR95E8S
__NAMESPACE             : root\cimv2
__PATH                  : 
Caption                 : 
ClassGuid               : {4d36e968-e325-11ce-bfc1-08002be10318}
CompatID                : PCI\VEN_10DE&DEV_17C8&REV_A1
CreationClassName       : 
Description             : NVIDIA GeForce GTX 980 Ti
DeviceClass             : DISPLAY
DeviceID                : PCI\VEN_10DE&DEV_17C8&SUBSYS_49983842&REV_A1\4&14144E6&0&00E4
DeviceName              : NVIDIA GeForce GTX 980 Ti
DevLoader               : 
DriverDate              : 20170607000000.******+***
DriverName              : 
DriverProviderName      : NVIDIA
DriverVersion           : 22.21.13.8253
FriendlyName            : 
HardWareID              : PCI\VEN_10DE&DEV_17C8&SUBSYS_49983842&REV_A1
InfName                 : oem3.inf
InstallDate             : 
IsSigned                : True
Location                : PCI bus 5, device 0, function 0
Manufacturer            : NVIDIA
Name                    : 
PDO                     : \Device\NTPNP_PCI0017
Signer                  : Microsoft Windows Hardware Compatibility Publisher
Started                 : 
StartMode               : 
Status                  : 
SystemCreationClassName : 
SystemName              : 
PSComputerName          : DESKTOP-TR95E8S

__GENUS                 : 2
__CLASS                 : Win32_PnPSignedDriver
__SUPERCLASS            : CIM_Service
__DYNASTY               : CIM_ManagedSystemElement
__RELPATH               : 
__PROPERTY_COUNT        : 28
__DERIVATION            : {CIM_Service, CIM_LogicalElement, CIM_ManagedSystemElement}
__SERVER                : DESKTOP-TR95E8S
__NAMESPACE             : root\cimv2
__PATH                  : 
Caption                 : 
ClassGuid               : {4d36e968-e325-11ce-bfc1-08002be10318}
CompatID                : PCI\VEN_10DE&DEV_1B06&REV_A1
CreationClassName       : 
Description             : NVIDIA GeForce GTX 1080 Ti
DeviceClass             : DISPLAY
DeviceID                : PCI\VEN_10DE&DEV_1B06&SUBSYS_66963842&REV_A1\4&3834D97&0&0008
DeviceName              : NVIDIA GeForce GTX 1080 Ti
DevLoader               : 
DriverDate              : 20170607000000.******+***
DriverName              : 
DriverProviderName      : NVIDIA
DriverVersion           : 22.21.13.8253
FriendlyName            : 
HardWareID              : PCI\VEN_10DE&DEV_1B06&SUBSYS_66963842&REV_A1
InfName                 : oem3.inf
InstallDate             : 
IsSigned                : True
Location                : PCI bus 1, device 0, function 0
Manufacturer            : NVIDIA
Name                    : 
PDO                     : \Device\NTPNP_PCI0014
Signer                  : Microsoft Windows Hardware Compatibility Publisher
Started                 : 
StartMode               : 
Status                  : 
SystemCreationClassName : 
SystemName              : 
PSComputerName          : DESKTOP-TR95E8S

It's because I have two GPUs installed right now. I recently added the other one. So now we're returning both GPU devices and the drivers for both.

Harall commented 6 years ago

Hello @lord-carlos , did you try maybe to use command like $ins_version = (Get-WmiObject Win32_PnPSignedDriver | Where-Object {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"} | Select-Object -First 1).DriverVersion.SubString(7).Remove(1,1).Insert(3,".") to select only one (first) graphic card and then parse driver version like before?

I understand that you use same driver for both cards and you install it for both in the same time.

lord-carlos commented 6 years ago

That commend works for me with single GPU. @gsparx can you try the command from @Harall on your sli setup?

(Get-WmiObject Win32_PnPSignedDriver | Where-Object {$_.devicename -like "*nvidia*" -and $_.devicename -notlike "*audio*"} | Select-Object -First 1).DriverVersion.SubString(7).Remove(1,1).Insert(3,".")