Hardware-Accelerated GPU Scheduling (HAGS) is a Windows feature that shifts more GPU management and scheduling tasks from the CPU to the GPU, reducing CPU overhead and potentially improving performance and latency
$regPath="HKLM:\System\CurrentControlSet\Control\GraphicsDrivers"$keyName="HwSchMode"$value=2If(-not(Test-Path$regPath)){New-Item-Path$regPath-Force|Out-Null}Set-ItemProperty-Path$regPath-Name$keyName-Value$value-TypeDWordWrite-Host"Hardware-Accelerated GPU Scheduling enabled. A restart may be required."
$regPath="HKLM:\System\CurrentControlSet\Control\GraphicsDrivers"$keyName="HwSchMode"$value=1If(Test-Path$regPath){Set-ItemProperty-Path$regPath-Name$keyName-Value$value-TypeDWordWrite-Host"Hardware-Accelerated GPU Scheduling disabled. A restart may be required."}else{Write-Host"Registry path not found."}