Prevent race condition

This commit is contained in:
David Heinemeier Hansson
2026-01-19 14:16:21 -04:00
parent 08fead671e
commit 3678b27170
2 changed files with 15 additions and 3 deletions

View File

@@ -24,6 +24,9 @@ case "$gpu_mode" in
# Let hybrid mode be the default after system sleep # Let hybrid mode be the default after system sleep
sudo rm -rf /usr/lib/systemd/system-sleep/force-igpu sudo rm -rf /usr/lib/systemd/system-sleep/force-igpu
# Remove the startup delay override (not needed for Hybrid mode)
sudo rm -rf /etc/systemd/system/supergfxd.service.d/delay-start.conf
omarchy-cmd-reboot omarchy-cmd-reboot
fi fi
;; ;;
@@ -36,9 +39,12 @@ case "$gpu_mode" in
sudo mkdir -p /usr/lib/systemd/system-sleep sudo mkdir -p /usr/lib/systemd/system-sleep
sudo cp -p $OMARCHY_PATH/default/systemd/system-sleep/force-igpu /usr/lib/systemd/system-sleep/ sudo cp -p $OMARCHY_PATH/default/systemd/system-sleep/force-igpu /usr/lib/systemd/system-sleep/
echo "Disabling dedicated GPU..." # Delay supergfxd startup to avoid race condition with display manager
supergfxctl -m Vfio # that can cause system freeze when booting in Integrated mode
supergfxctl -m Integrated sudo mkdir -p /etc/systemd/system/supergfxd.service.d
sudo cp -p $OMARCHY_PATH/default/systemd/system/supergfxd.service.d/delay-start.conf /etc/systemd/system/supergfxd.service.d/
omarchy-cmd-reboot
fi fi
;; ;;
*) *)

View File

@@ -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