diff --git a/Fix-EnableGPUScheduling.ps1 b/Fix-EnableGPUScheduling.ps1 index b9bb657..c96c73b 100644 --- a/Fix-EnableGPUScheduling.ps1 +++ b/Fix-EnableGPUScheduling.ps1 @@ -2,22 +2,19 @@ $key = "HKLM:\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" $name = "HwSchMode" # Check to see if GPU scheduling is enabled - +$HardwareGPUSchedulingEnabled = $false 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" $HardwareGPUSchedulingEnabled = $true - } Else { - LogMsg "Hardware assisted GPU scheduling is disabled" - $HardwareGPUSchedulingEnabled = $false } -} Else { +} +If ( $HardwareGPUSchedulingEnabled -eq $false ) { LogMsg "Hardware assisted GPU scheduling is disabled" $HardwareGPUSchedulingEnabled = $false } - # Find a GPU in the system so we can enable GPU scheduling If ( $HardwareGPUSchedulingEnabled -eq $false ) { LogMsg " - Attempting to find a discrete Nvidia or AMD GPU"