Hardware-accelerated GPU scheduling allows Windows to offload some work to the GPU, theoretically providing increased performance in some scenarios. For more details check out Microsoft's developer blog post on the topic: https://devblogs.microsoft.com/directx/hardware-accelerated-gpu-scheduling/
HAGS may cause performance issues and failures with OBS and hardware encoders. It is recommended that if you are having these issues you disable HAGS as a troubleshooting step.
From there, set "Hardware-accelerated GPU scheduling" to OFF, then reboot your computer.
From there, set "Hardware-accelerated GPU scheduling" to OFF, then reboot your computer.