Hibernation: keep native GPU drivers out of the initramfs so resume runs before any GPU driver touches the hardware - #10065
Open
madakas wants to merge 1 commit into
Open
Conversation
…figured A GPU driver bound by the boot kernel before the resume hook fires suspends and ASIC-resets hardware the restored kernel then cannot reclaim, hanging or faulting resume-from-hibernate (amdgpu CIK, NVIDIA, nouveau). The resume decision cannot move earlier - the swapfile sits inside LUKS - so the GPU driver moves later: omarchy-hibernation-setup now strips the kms hook and bakes an initramfs-only modprobe blacklist into the image via a new omarchy-defer-gpu initcpio hook, and Plymouth renders the LUKS prompt on simpledrm (plymouth.use-simpledrm). On normal boots the real root loads the driver right after switch_root; on resume boots the restored kernel reclaims the GPU from clean EFI-posted state. omarchy-hibernation-remove now also deletes the resume.conf and rtc-alarm.conf limine-entry-tool drop-ins before the rebuild, so removal no longer leaves resume= pointing at the deleted swapfile (omacom#10037). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K9mJ7cVrfJxovv31CaN7NF
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
One mechanism sits behind #10061, #10039, #8352 and #7848: the initramfs loads the native GPU driver before the resume hook can run. The
kmshook (or the NVIDIAMODULES+=drop-in, which busybox init modprobes before any hook) exists so Plymouth can theme the LUKS prompt — but the resume decision structurally cannot happen until after unlock, because the swapfile sits inside LUKS. So on every resume-from-hibernate boot, the boot kernel fully initializes the GPU, its.freezecallback then suspends and ASIC-resets it (amdgpu does this unconditionally on dGPUs since kernel commitdaf8de0874ab), and the restored kernel has to reclaim hardware a second driver instance just reprogrammed. On robust hardware that survives; on plenty of real machines it does not —nv_pmops_freeze → -EIOon NVIDIA, nouveau FIFO faults on Macs, and a silent hard hang on amdgpu CIK iMacs (silent because the whole window runs with consoles suspended and Arch builds withoutCONFIG_DPM_WATCHDOG). Full source-level analysis with citations: #10061 (comment)Two reporters have already verified the workaround independently (#10039, #8352): remove the GPU driver from the initramfs and resume works. Fedora shipped exactly this model distro-wide in F42 (Changes/PlymouthUseSimpledrm).
Fix
Hibernation-scoped, so nobody else's boot experience changes: while hibernation is configured, keep native GPU drivers out of the initramfs and let Plymouth render the LUKS prompt on simpledrm (EFI framebuffer, native resolution).
omarchy-hibernation-setupnow writes a drop-in that adds theresumehook and stripskms, installs a newomarchy-defer-gpuinitcpio hook that bakes an initramfs-only modprobe blacklist into the image (never into host/etc/modprobe.d, whichmodconfwould copy in and which would affect the running system), and appendsplymouth.use-simpledrmto the cmdline drop-in it already writes. The blacklist also covers the NVIDIAMODULES+=early load: mkinitcpio's init usesmodprobe -qab, and-bapplies blacklists to explicit names too — soinstall/hardware/nvidia.shneeds no change.omarchy-hibernation-removenow deletes everything setup created — including theresume.confandrtc-alarm.conflimine-entry-tool drop-ins, before the rebuild. Fixes omarchy hibernation remove leaves /etc/limine-entry-tool.d/resume.conf behind, so the rebuilt UKI still boots with resume= pointing at the deleted swapfile #10037 (removal used to leaveresume=pointing at the deleted swapfile in every regenerated boot entry).switch_root(one brief modeset handoff — the trade-off Fedora accepted). On resume boots the restored kernel reclaims the GPU from clean, EFI-posted state — the path its S4 restore code is actually written for.Testing
On the affected hardware class (iMac17,1, amdgpu Bonaire/CIK, Btrfs+LUKS, Limine/UKI, the machine from #10061):
bash -non both scripts; drop-in logic unit-tested in isolation (kms stripped, resume + omarchy-defer-gpu appended, MODULES untouched).mkinitcpio -Dwith the new hook): zero GPU modules in the image (production image on the same machine carries amdgpu), blacklist present atetc/modprobe.d/99-omarchy-defer-gpu.conf,hooks/resume+systemd-hibernate-resume+ Plymouth all present. Side effect: image size dropped 61 MB → 24 MB.resume=-free rescue boot entry proposed in Hibernate restore hangs on iMac17,1 (amdgpu Bonaire/CIK), and every Limine entry carries resume= — no bootable menu entry left after a failed resume #10061 as the safety net.Open questions for maintainers
omarchy hibernation remove+setup?kmsfrom the initramfs unconditionally (smaller images, faster boots, deletes the NVIDIA kms-drop special case inomarchy_hooks.conf). This PR deliberately stays scoped to hibernation.P.S. Greetings to @dhh from Max — Omarchy brought this 2015 iMac gloriously back to life; this PR is for the one button that tried to take it back down. ;-)
Analysis and patch machine-authored by Claude Fable 5 via Claude Code, driven and reviewed by the account owner.
🤖 Generated with Claude Code
https://claude.ai/code/session_01K9mJ7cVrfJxovv31CaN7NF