I helped fix sleep-wake hangs on Linux with AMD GPUs
nyanpasu64.gitlab.io
I helped fix sleep-wake hangs on Linux with AMD GPUs
1–10 of 218 posts
Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#2Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#3I am not sure how correct this assumption is. S3 is supposed to cut power to everything but RAM, but for example Gigabyte Aorus motherboards are notorious for an NVMe SSD sleep bug that randomly prevents the system from properly sleeping or waking.
This is fixed by adding the following udev rule:
# Generic PCIe fix for sleep bugs by preventing wakeup from any PCIe port
ACTION=="offline", SUBSYSTEM=="pci", DRIVER=="pcieport", ATTR{power/wakeup}="disabled"
or more targeted: # Gigabyte sleep fix by preventing wakeup from problematic PCIe port, depends on motherboard model
ACTION=="offline", SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{device}=="0x43bc", ATTR{power/wakeup}="disabled"
You can find any glitched PCIe wakeup device with: 1. cat /proc/acpi/wakeup (you'll have to trial and error your way through the wakeup devices if it isn't immediately clear)
2. cat /sys/class/pci_bus/*/*/yourWakeupDevicePci/uevent | grep PCI_ID
3. prepend "0x"
You also have the option of: udevadm info --attribute-walk /dev/whatever
but for that you need to know some basic identifier of your glitchy device.Or if you want to shellscript it (less reliable than letting udev do it for you and needs to be done via systemd service file or another automation):
# Gigabyte sleep fix, port depends on mobo model
/bin/bash -c 'if grep 'RP05' /proc/acpi/wakeup | grep -q 'enabled'; then echo 'RP05' > /proc/acpi/wakeup; fi'";
Yes I really hate this (and other) Linux sleep issues.Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#4Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#5Fantastic news. AMD's linux graphics drivers have mostly worked great for me but this has been the one exception that I've hit multiple times.
Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#6Lol, I remember.
Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#7Anyone have other tips for this type of thing? I did try upgrading drivers/kernels already
Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#8Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#9Re: I helped fix sleep-wake hangs on Linux with AMD GPUs
#10Fantastic news. AMD's linux graphics drivers have mostly worked great for me but this has been the one exception that I've hit multiple times.
Same great experience, but I experience similar issues when I disconnect thunderbolt with monitors when my machine is asleep. Laptop though, so very different driver set, no GPU via pci
"offline" is for when your system turns off or suspends, "online" vice versa, and "remove" is self-explanatory.
If you go with "offline", I'd look into hard disconnecting the monitors. This might cause monitor rearrangement (= you'll need to manually assign) or blinking on laptop bootup. Might also stop any charging. But that could be mitigated by checking the "subsystems" attribute.
If you go with "online", you probably need run some sort of clean-up / refresh script or rule
If you go with "remove", you'll need the same clean-up / refresh script.
It'll take some trial-and-error, but it'll be satisfying once it works. Also highly recommended to check the NixOS repositories and official wiki and Arch wiki to see if your laptop or monitors have workarounds for their quirks.