Skip to content

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
omacom:quattrofrom
madakas:hibernation-defer-gpu
Open

Hibernation: keep native GPU drivers out of the initramfs so resume runs before any GPU driver touches the hardware#10065
madakas wants to merge 1 commit into
omacom:quattrofrom
madakas:hibernation-defer-gpu

Conversation

@madakas

@madakas madakas commented Sep 3, 2026

Copy link
Copy Markdown

Problem

One mechanism sits behind #10061, #10039, #8352 and #7848: the initramfs loads the native GPU driver before the resume hook can run. The kms hook (or the NVIDIA MODULES+= 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 .freeze callback then suspends and ASIC-resets it (amdgpu does this unconditionally on dGPUs since kernel commit daf8de0874ab), 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 → -EIO on 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 without CONFIG_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-setup now writes a drop-in that adds the resume hook and strips kms, installs a new omarchy-defer-gpu initcpio hook that bakes an initramfs-only modprobe blacklist into the image (never into host /etc/modprobe.d, which modconf would copy in and which would affect the running system), and appends plymouth.use-simpledrm to the cmdline drop-in it already writes. The blacklist also covers the NVIDIA MODULES+= early load: mkinitcpio's init uses modprobe -qab, and -b applies blacklists to explicit names too — so install/hardware/nvidia.sh needs no change.
  • omarchy-hibernation-remove now deletes everything setup created — including the resume.conf and rtc-alarm.conf limine-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 leave resume= pointing at the deleted swapfile in every regenerated boot entry).
  • On normal boots the real root's udev loads the GPU driver right after 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):

Open questions for maintainers

  • Existing hibernation users keep the old (broken-on-this-class) drop-in until they re-run setup; both formats are recognized as "configured". Want a migration that rewrites it, or leave it to omarchy hibernation remove + setup?
  • Fedora documented two edge cases that may eventually want an opt-out: docks where the only monitor hangs off a secondary GPU (dark LUKS prompt), and rare AMD laptops needing amdgpu firmware in the initrd for USB-C boot.
  • The bolder version of this change is Fedora's: drop kms from the initramfs unconditionally (smaller images, faster boots, deletes the NVIDIA kms-drop special case in omarchy_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

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant