Toggle hybrid GPU mode via supergfxctl

Very useful for Asus G14 and other laptops with NVIDIA + AMD iGPU
combos.
This commit is contained in:
David Heinemeier Hansson
2026-01-15 17:56:08 -05:00
parent 5ff76df5e4
commit 06d06c0c3d
3 changed files with 75 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
#!/bin/bash
# Use the Vfio to Integrated trick to put turn off NVIDIA dgpu when in integrated mode
# without needing to restart the computer. This is needed because computers like the Asus G14
# will wake after suspend in Hybrid mode, even if the system was in Integrated mode before
# suspending.
case "$1" in
post)
# small delay so the device is fully re-enumerated
sleep 4
# force-bind dGPU to vfio (fully detached from nvidia)
/usr/bin/supergfxctl -m Vfio
sleep 1
# then go back to Integrated, which powers it off again
/usr/bin/supergfxctl -m Integrated
;;
esac
exit 0