mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Toggle hybrid GPU mode via supergfxctl (#4277)
* Toggle hybrid GPU mode via supergfxctl Very useful for Asus G14 and other laptops with NVIDIA + AMD iGPU combos. * Use correct exit * Simplify * Wording * Revise switching process * Spacing * These are sudo actions * Make it exe * No need for extensions Matches existing style * Relying on the new config should be enough since we are restarting anyway * Prevent race condition * Reminder to add to OPR
This commit is contained in:
committed by
GitHub
parent
4701726c83
commit
2c7b283aef
18
default/systemd/system-sleep/force-igpu
Executable file
18
default/systemd/system-sleep/force-igpu
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Use the Vfio to Integrated trick to 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.
|
||||
|
||||
if [[ $1 == "post" ]]; then
|
||||
# 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
|
||||
fi
|
||||
@@ -0,0 +1,6 @@
|
||||
[Service]
|
||||
# Delay startup to avoid race condition with display manager initialization
|
||||
# when booting in Integrated mode. Without this delay, the system can freeze
|
||||
# on boot because supergfxd tries to disable the dGPU while the display
|
||||
# subsystem is still initializing.
|
||||
ExecStartPre=/bin/sleep 5
|
||||
Reference in New Issue
Block a user