omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Hibernation aborts during image creation on ASUS ROG Zephyrus G14 (GA403UV); HibernateMode=shutdown fixes it

Open wjax opened this issue 3 months ago • 3 comments

Summary

On this machine, systemctl hibernate never powered off. The kernel aborted during image creation, unwound, and half-resumed: display dead, keyboard backlight lit, session frozen. Only a forced power-off recovered it.

Setting HibernateMode=shutdown fixes it completely.

System

Omarchy 4.0.1-1
Kernel 7.1.9-arch1-2
CPU AMD Ryzen 9 8945HS w/ Radeon 780M
GPU AMD HawkPoint1 (iGPU only, no dGPU)
Board ASUS ROG Zephyrus G14 GA403UV
BIOS GA403UV.311 (2025-06-09)
systemd 261.2-1-arch
/sys/power/mem_sleep [s2idle] — no deep, Modern Standby only

Hibernation was configured by omarchy-hibernation-setup: 30.6G btrfs swapfile, resume= + resume_offset= on the cmdline, zram at priority 100.

What happens

With the default platform mode, swsusp_save() aborts silently:

PM: hibernation: Creating image
PM: hibernation: Need to copy 3457488 pages
PM: hibernation: Normal pages needed: 3457488 + 1024, available pages: 4744684
ACPI: PM: Restoring platform NVS memory      <- next line; already unwinding

swsusp_save() has three exits — Image created (N pages copied), Not enough free memory, Memory allocation failed. None printed, with pm_debug_messages=1. Memory was not the constraint: ~1.29M spare pages (~5 GB).

It never reaches the image write or power-off, so the machine stays powered. Reproduced twice, identically.

Fix

# /etc/systemd/sleep.conf.d/hibernate-mode.conf
[Sleep]
HibernateMode=shutdown

Works first try, and the ACPI S4 bracketing disappears from the log:

PM: hibernation: Hibernation image restored successfully.

(That line is printed only on the resume-from-image path, so it confirms a real write + power-off + restore cycle.)

Scope — please judge this yourselves

This is n=1. One machine, one BIOS revision. I don't know whether it applies to all GA403UVs, all ASUS boards, or all Modern-Standby AMD laptops, and forcing shutdown globally could regress machines where platform works. You have the fleet visibility to decide; I don't. A conditional — e.g. apply when /sys/power/mem_sleep offers no deep — might be the safer shape.

One observation

default/systemd/system-sleep/keyboard-backlight says it exists because "the ASUS keyboard controller can block S4 shutdown if LEDs are active". On this machine S4 never got far enough to be blocked, and hibernation now works with that hook still not running (see #8588 — it is installed non-executable). That may mean the hook is treating a symptom of this same firmware problem.

Notes

Two pre-existing, non-blocking warts remain after the fix:

  • mt7921e ... PM: failed to restore async: error -110 — WiFi reloads firmware and recovers, so it blips on every resume
  • PM: freeze of devices complete after 5302.394 msecs — 5-7s device freeze (tpm_crb_acpi MSFT0101:00: Ignoring error -5 while suspending is in the same phase)

Happy to gather more logs or test patches.

wjax avatar Aug 27 '26 14:08 wjax

Adding a related issue for pre-T2 Intel Macs: https://github.com/omacom/omarchy/issues/10038

Same root cause (ACPI S4 platform mode fails), same fix (HibernateMode=shutdown). This suggests the issue may affect broader hardware beyond the ASUS ROG Zephyrus G14.

animadito avatar Sep 03 '26 17:09 animadito

Reviewed against quattro (c352b62d6) by Claude Opus 5.5, with Codex Medium as a second opinion. This was not reproduced: it depends on the GA403UV's firmware, and our test machines are VMs.

What Omarchy does today. Nothing in quattro chooses the hibernation mode: omarchy-hibernation-setup sets up the swapfile, the resume parameters and the keyboard-backlight hook, and leaves systemd's default HibernateMode=platform shutdown in place. So this is not already fixed since 4.0.1.

What the log shows. Your workaround is credible, but the log does not establish that swsusp_save() aborted. In the 7.1 kernel the Creating image / Need to copy / Image created lines are debug-level, and a failed swsusp_alloc() returns without a message of its own (create_image() then logs Error -12 creating image). ACPI: PM: Restoring platform NVS memory comes from platform_leave(), which runs after a successful snapshot as well, so it is not an abort marker. What the two modes differ in is ACPI S4 preparation (_PTS(4) and the NVS save before the snapshot) and S4 entry after the image is written; shutdown mode skips both, which fits your result, but the log cannot say which of them fails on this machine.

Related, not duplicates. #10038 (pre-T2 Macs reboot after writing the image) and #9696 (GA403UM hangs after a wakeup rolls back hibernation, from its NVIDIA dGPU) reach for the same HibernateMode=shutdown or touch the same model family, but the failures differ. PR #8017 applies the same setting gated to the ThinkBook X IMH only, so it would not cover this model.

One thing worth knowing. The GA403UV ships with an RTX 4060. If yours shows only the 780M because the dGPU is switched off (Integrated mode), the output of supergfxctl -g, lspci | grep -i nvidia, and whether /usr/lib/systemd/system-sleep/force-igpu exists would help separate a firmware S4 problem from the dGPU path in #9696. The full journalctl -k -b -1 from a failed attempt, including any Error ... creating image line, would too.

What happens next. How to apply the fix — gated to this model the way #8017 does it, gated on some broader signal (an s2idle-only mem_sleep describes suspend support, not whether S4 works), or shutdown everywhere — is a decision about hibernation on every machine, and it is waiting on the maintainer. No fix PR has been opened.

omarchybot avatar Oct 09 '26 04:10 omarchybot

This fixed Hibernation (suspend to disk) on ASUS Zenbook S16 (UM5606WA) with CachyOS (Arch based like omarchy)!!

cat /proc/cmdline
resume=UUID=<your id> resume_offset=<your offset> zswap.enabled=0 quiet splash rw rootflags=subvol=/@ root=UUID=<your id>
cat /etc/mkinitcpio.conf
HOOKS=(base udev autodetect microcode modconf keyboard keymap consolefont block filesystems resume fsck)
uname -a
6.18.60-2-cachyos-lts

Many Thanks!!!

caiacoa avatar Nov 16 '26 07:11 caiacoa