check that reg property exists
This commit is contained in:
@@ -2,15 +2,22 @@ $key = "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers"
|
|||||||
$name = "HwSchMode"
|
$name = "HwSchMode"
|
||||||
|
|
||||||
# Check to see if GPU scheduling is enabled
|
# Check to see if GPU scheduling is enabled
|
||||||
$setting = (Get-ItemPropertyValue -Path $key -Name $name -ErrorAction SilentlyContinue)
|
|
||||||
If ( $setting -eq 2 ) {
|
If ( Test-RegistryProperty -Path $key -Name $name ) {
|
||||||
|
$setting = (Get-ItemPropertyValue -Path $key -Name $name -ErrorAction SilentlyContinue)
|
||||||
|
If ( $setting -eq 2 ) {
|
||||||
LogMsg "Hardware assisted GPU scheduling is already enabled"
|
LogMsg "Hardware assisted GPU scheduling is already enabled"
|
||||||
$HardwareGPUSchedulingEnabled = $true
|
$HardwareGPUSchedulingEnabled = $true
|
||||||
|
} Else {
|
||||||
|
LogMsg "Hardware assisted GPU scheduling is disabled"
|
||||||
|
$HardwareGPUSchedulingEnabled = $false
|
||||||
|
}
|
||||||
} Else {
|
} Else {
|
||||||
LogMsg "Hardware assisted GPU scheduling is not currently enabled"
|
LogMsg "Hardware assisted GPU scheduling is disabled"
|
||||||
$HardwareGPUSchedulingEnabled = $false
|
$HardwareGPUSchedulingEnabled = $false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# Find a GPU in the system so we can enable GPU scheduling
|
# Find a GPU in the system so we can enable GPU scheduling
|
||||||
If ( $HardwareGPUSchedulingEnabled -eq $false ) {
|
If ( $HardwareGPUSchedulingEnabled -eq $false ) {
|
||||||
LogMsg " - Attempting to find a discrete Nvidia or AMD GPU"
|
LogMsg " - Attempting to find a discrete Nvidia or AMD GPU"
|
||||||
|
|||||||
Reference in New Issue
Block a user