[RESPONDED] Arch hibernation woes on AMD 13

Hey,

Been trying to track down a problem with Hibernation on arch, in an effort to extend standby battery life (s2idle isnt cutting it for me yet)

Im on 6.7.5-arch1 with the following kernel params:

root=/dev/nvme0n1p3 rw resume=/dev/nvme0n1p2 drm.vblankoffdelay=0 rtc_cmos.use_acpi_alarm=1 pcie_aspm.policy=powersupersave amdgpu.abmlevel=3 iomem=relaxed amdgpu.ppfeaturemask=0xffffffff 

I had terrible Hibernation problems with wifi and have moved on from the Media Tek to an Intel Wifi card which improved Wifi stability greatly with Hibernation cycles, however I still have hangs with about every 1 in 6 or 7 cycles, symptoms include a screen freeze at either the tail end of the Hibernation cycle or at the start of the resume cycle. The screen would be exactly the point where Hibernate was initiated.

Feels like an amdgpu problem but can’t be sure. Anyone any ideas?

2 Likes

One interesting feature of the failure case is that the screen seems to be at full brightness…

1 Like

I’m assuming you used the Arch Wiki to set this up. Looks like you are using a partition based on your kernel parms. What do you have for mkinitcpio hooks? I’m hibernating to a swap file and all I have for a kernel parm is the offset and offset resume indicators and mine suspends perfectly.

1 Like
HOOKS=(base udev autodetect modconf kms keyboard keymap consolefont block filesystems resume fsck)

These are my mkinitcpio hooks.

I have 64G of memory with a 68G swap partition at /dev/nvme0n1p2 but only use a fraction of the memory for these tests.

Crucial P3 Plus 2TB M.2 PCIe Gen4 NVMe

KDE w/Xorg

1 Like

So far have not had any issues with hybernation on arch but I use a swap file instead of a partition cause it’s just easier with encryption.

1 Like

Nothing to add here, but the thoughts on trying a swap file is one idea.

this is my fstab file contents

~ 
❯ cat /etc/fstab                                                                        
# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
## ROOT ## /dev/nvme0n1p5 LABEL=ARCH_ROOT
UUID=93c86984-fc4f-454a-8e3b-7973c50aaec6	/         	ext4      	defaults,relatime	     0 1
## BOOT ## /dev/nvme0n1p2 LABEL=ARCH_BOOT
UUID=c41be70e-0c04-4703-a423-9e436dcb5583	/boot     	ext4      	defaults,relatime	     0 2
## ESP  ## /dev/nvme0n1p1 LABEL=ESP
UUID=18C4-5D0A      	/boot/efi 	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro	0 2
## SWAP ##
UUID=ec8d38c8-0686-4685-81c5-725762d6a0da       none            swap            sw,defaults,relatime         0 2
## TempFS ##
#tmpfs                                          /tmp            tmpfs           defaults,relatime,mode=1777  0 0

## DATA ## /dev/nvme0n1p11 LABEL=DATA
UUID=44e835d7-9b7d-439b-bb3f-dfa9eecf429f	/mnt/data 	ext4      	defaults,relatime,nofail,x-systemd.device-timeout=5 0 2

contents of my /etc/default/grub

~ 
❯ cat /etc/default/grub           
# GRUB boot loader configuration

## Linux Zen
GRUB_DEFAULT=0
## Linux LTS
#GRUB_DEFAULT="2"
## Linux Stable
#GRUB_DEFAULT="4"
##
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR="Arch Linux"
#GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=ec8d38c8-0686-4685-81c5-725762d6a0da loglevel=3 quiet splash"
#GRUB_CMDLINE_LINUX_DEFAULT="loglevel=3 quiet resume=UUID=ec8d38c8-0686-4685-81c5-725762d6a0da"
GRUB_CMDLINE_LINUX_DEFAULT="rtc_cmos.use_acpi_alarm=1 loglevel=3 quiet resume=UUID=ec8d38c8-0686-4685-81c5-725762d6a0da"
GRUB_CMDLINE_LINUX=""

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Set to 'countdown' or 'hidden' to change timeout behavior,
# press ESC key to display menu.
#GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT_STYLE='countdown'
#GRUB_TIMEOUT_STYLE='hidden'

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `videoinfo'
#GRUB_GFXMODE=auto
GRUB_GFXMODE=1024x768x32,auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires
# setting 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT=true

# Uncomment to disable submenus in boot menu
GRUB_DISABLE_SUBMENU=y

# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
#GRUB_DISABLE_OS_PROBER=false
GRUB_DISABLE_OS_PROBER=true

HOOKS line in the /etc/mkinitcpio.conf

HOOKS=(base udev autodetect modconf kms keyboard keymap block filesystems resume fsck)

Hope this would be helpful.

1 Like

@David_Markey I’ve been thinking about it and I believe your block device naming is wrong. I think you need to supply the UUID of your swap device to both the fstab and cmd line.

edit: to expand UUID

I’ll expand it to UUID but IMO if something like that was wrong it would either work or not work…

This works like 5 out of 6 times.

Yeah still a problem, it’s also a problem with:

  • LTS Kernel
  • Expansion cards removed
  • wifi kernel module blacklisted.

Easily reproducible for me by stress testing hibernate with this simple script(about 4-5 cycles):

#!/bin/sh
echo test_resume > /sys/power/disk
i=1
while [ : ]; do

  echo "Starting cycle $i"
  echo disk > /sys/power/state
  echo "Ending cycle $i"
  i=$((i+1))
  sleep 5
done

Hard to rule out some kind of hardware issue if nobody else can reproduce this…

I can tell as soon as it’s about to happen as the screen brightness burns my retinas.

Also happens with no display manager running (console mode) but seems to get 7-9 cycles without crashing the machine.

Incredibly hard to debug as the machine hard locks.

I believe I have seen this happen. I didn’t try to “stress hibernate” yet, but when I was testing the wifi card issues (which should be fixed in 6.8) I noticed I got a hard freeze on resume. Same as you it showed the screen ok but the mouse never “unstuck” and I could just powercycle. Nothing else worked. Happened 2x so far.

Same here. My laptop hibernates quite often and most times, everything works as expected, but sometimes (2-3 times until now) it locks up completely on resume, forcing me to powercycle.

I though my setup (swap on LVM on LUKS) triggered a bug somewhere, but it sounds like it is the same problem you all have…

2 Likes

At least I’m not suffering alone.

1 Like

OK, I’ve had a small breakthrough, moving to linux-firmware-git to pull in the latest GPU blobs has certainly improved the situation… I’ve gotten to about 25 cycles before locking up (at my best attempt).

It seems this GPU firmware is buggy for hibernation. Also the backlight went a big crazy one time and the laptop rebooted so I think this is definitely something to do with the backlight.

Framework support: Do you need me to open a bug somewhere for AMD?

Alright so just to update, @Mario_Limonciello has been able to reproduce this here AMD7840U/ GPD Win Max 2 (2023)/ DMI board G1619-04: Hibernation (S4, suspend to disk) or resume hang randomly. (#3168) · Issues · drm / amd · GitLab

Apparently looks like a BIOS bug. FYI @Matt_Hartley

2 Likes

Same issue here. Happy to see it at least is reproducible and has a report upstream. Looking forward to the fix.

Also curious if there’s any workaround in the near term.

Hibernation used to work but stopped working some weeks ago (AMD13). Suspend works fine. The hibernation problem persists after updating to the new BIOS (3.05). The screen goes black, then is restored, but neither mouse nor keyboard respond, and only shutting down by long power button press and restarting works.

BIOS 3.05? Really?

Confirmed still a problem on 3.05 FYI @Mario_Limonciello