How to completely turn off the Nvidia dGPU after an external monitor has been disconnected #
“Hi everybody, I posted some days ago about Nvidia dGPU not switching off completely when unused in hybrid mode. This is a bad problem because the Nvidia dGPU will not turn off even on battery mode, drawing down our battery. I found a way to solve this problem, it’s not elegant, but it’s functional.”
The problem in details: #
External display outputs (HDMI / USB-C) are directly connected to the Nvidia dGPU, any time we use an external monitor the Nvidia card is forcefully used. Any app (or system background processes/daemons) that is launched after the external monitor is connected is started using Nvidia dGPU. If the system is started with an external monitor attached, even more processes/apps/services/daemons use the Nvidia dGPU. When we disconnect the external monitor, we expect that apps using the Nvidia dGpu will be “migrated” to Intel/Amd iGPU. We can check if any remaining app is running in the Nvidia dGPU using the Nvdia GPU activity monitor in the tray. If any app is still running, we can kill it, closing it or using the task manager. Now the Nvidia GPU activity monitor is gray, no app is running, it should be fine, but it’s not. Using HWinfo64, we can clearly see that the dGPU is active in idle state, consuming 10/12 W to do nothing. It’s not HWinfo64 that is waking up the Nvidia dGPU, HWInfo64 wakes it up only when started in sensor mode only. Very strange behavior.
So I dig in the hole… #
There is a tool called nvidia-smi
, you can launch it using a terminal. Using nvidia-smi you can check if there is any other process on the Nvidia dGPU In fact, there are some processes that are not listed in the Nvidia GPU activity monitor. If we kill these processes, the Nvidia dGPU will turn off Then I found this forum post: https://forum-en.msi.com/index.php?threads/issue-with-nvidia-optimus-on-msi-gs65.317379/post-1949576 He is talking about the very same problem. This guy made a PowerShell script that we can run to restart any process running in the Nvidia dGPU You can find it here: https://github.com/eduojeda/nvidia-optimus-kill I tested it, and it’s working as expected, to run it you need to open a PowerShell terminal and paste this
Set-ExecutionPolicy RemoteSigned
then you can run it by double-clicking nvidia-kill link or nvidia-kill.bat
SMI before #

SMI after #

Credits @LABØ!