Live data from Hacker News

I helped fix sleep-wake hangs on Linux with AMD GPUs

nyanpasu64.gitlab.io

111–120 of 218 posts

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#111
post #24

For all the years I've been using Linux, I've always had some kind of sleep issues. I've used Intel, AMD, ATI, and NVIDIA hardware across countless distros and setups, yet nothing seems to make a difference, there's always something that doesn’t work properly with sleep or hibernation. Honestly, it's one of the main issues I wish the Linux community would take a closer look at and finally fix!

Interestingly sleep/wake is something I've found to work almost always just fine out of the box in Linux, including on machines Windows has sleeping issues! It used to be quite bad but things has improved heaps over the last 10 or so years -- however I've also stuck with Lenovo laptops which does generally seem to have better support in Linux.

Indeed, whatever Lenovo has seems mostly good. Not perfect, but does the right thing 19 out of 20 times, maybe more. Unfortunately that one time it doesn't work and roasts in my backpack it's a catastrophe :-(

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#112
Ugh the first time I was debugging problems like this, it was in production and for some IoT hardware we had deployed in the field.

Fortunately, although that's not the focus of this article, system hibernate is WAY more reliable than system sleep in Linux due to the way it works.

Use system hibernate if your SSD is fast enough. It works better than system sleep and isn't a ton slower.

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#113
post #24

For all the years I've been using Linux, I've always had some kind of sleep issues. I've used Intel, AMD, ATI, and NVIDIA hardware across countless distros and setups, yet nothing seems to make a difference, there's always something that doesn’t work properly with sleep or hibernation. Honestly, it's one of the main issues I wish the Linux community would take a closer look at and finally fix!

[dead]

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#114
post #108
post #36

Earlier quoted context omitted.

Sleep & suspend doesn’t work on Windows either. Power control is the kind of stuff that benefits from very tight integration, and PCs just don’t have that. Firmware is seen by most vendors as a pure cost to minimize, so you get a fragmented market full of subcontractors delivering the bare minimum that is considered “working”. Manufacturers also know most people aren’t going to use a big part of the functions they’re…

Are there issues in Windows? Sure but if you give me 100 laptops, 80% will do this right without any issue. Maybe 30% of those laptops will work right on any Linux distro without major fucking around with bullshit trying to make it work. Yes those numbers are made up but I have been running versions of Linux since Slackware in the 90s. I still have a desktop with an amd cpu and nvidia gpu that I can’t get to sleep/su…

Oh no, Windows Modern Standby is infamously terrible and unreliable. Here is a youtube video with millions of views explaining the problems in detail: https://youtu.be/OHKKcd3sx2c

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#115
post #36
post #23

Earlier quoted context omitted.

Remarkable that it's 2025 and laptop sleep/suspend still doesn't work right on linux. I think the first time I encountered this was probably 15 years ago now?

Sleep & suspend doesn’t work on Windows either. Power control is the kind of stuff that benefits from very tight integration, and PCs just don’t have that. Firmware is seen by most vendors as a pure cost to minimize, so you get a fragmented market full of subcontractors delivering the bare minimum that is considered “working”. Manufacturers also know most people aren’t going to use a big part of the functions they’re…

I was amazed when I got an 11th-generation Intel NUC and it didn't sleep/wake properly.

I would have expected it with a cheap clone, but this was a fully integrated computer made by the same people who designed and manufactured the processor itself!

I can't remember if it ever fixed it - maybe after a year or two there were finally newer EFI and graphics drivers that fixed the issue, but maybe it never did? In the end I ended up getting a newer machine to replace it anyway and it became my home server so just runs Proxmox now and doesn't need to ever sleep...

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#116

Earlier quoted context omitted.

> Sleep & suspend doesn’t work on Windows either. Or Macintosh. My $DAYJOB Macbook sleeps properly about about 2 out of 10 times, at best. Most of the time it fails to sleep and by the next morning when I open it up, the battery is dead. :-( For comparison, my System76 laptop running PopOS! sleeps perfectly, every time with no issues. shrug

> Or Macintosh. My $DAYJOB Powerbook... You use a 20+ year old[1] PowerPC laptop for your dayjob? Talk about hardware longevity! [1]: Powerbooks were last made in 2006 I think?

Typo/brainfart/whatever. I meant to say Macbook. It's about 2 years old.

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#117
post #3

> Through some digging, I found that when a desktop enters S3 sleep, the system cuts power to PCIe GPUs I 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…

Hmm, on my motherboard I had to disable spontaneous wake by adding to /etc/udev/rules.d/: ACTION=="add", KERNELS=="0000:00:01.1", ATTR{power/wakeup}="disabled" And my Logitech Bolt receiver wakes multiple of my Linux computers instantly, I don't know why it doesn't do that on Windows and haven't tried doing a USB capture (and don't know what equipment I'd need to try it out, logic analyzer? Glasgow?). In the meantime…

Good tip!

KERNELS=="0000:00:01.1" sounds like an interesting way to do it, since you can target separate functions of the PCI device (in this case: domain 0, bus 0, slot 1, function 1).

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#118
post #23
post #16

This is amazing work! If folks have ever wondered why suspend is so difficult to get working on linux and why debugging it is equally difficult, this is a single datapoint with lots of information about all the things that can go wrong. Even now I have a thinkpad P1G4 where the fans won't turn off automatically unless I turn them off before going into suspend. Recently I also started having crackling issues with my b…

Remarkable that it's 2025 and laptop sleep/suspend still doesn't work right on linux. I think the first time I encountered this was probably 15 years ago now?

Even hibernate has problems. The power features are some of the things I wish worked better in Linux in general :(

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#119

I wonder if this will help a similar problem i have with my AMD GPU: very often when i wake/resume the PC, the output is almost frozen. "Almost" because it actually isn't frozen, if there is any output/animation/etc going on it plays fine, but once i try to move the mouse it freezes and everything updates at a single frame per couple of seconds - sometimes freezing completely. I can usually Ctrl+Alt+Fn to another vir…

I've heard reports of reduced frame rate issues on laptops from DMUB/DMCUB/panel self-refresh, though your issue sounds different and I probably can't usefully debug it without a full dmesg/journalctl --system log.

Re: I helped fix sleep-wake hangs on Linux with AMD GPUs

#120
post #24

For all the years I've been using Linux, I've always had some kind of sleep issues. I've used Intel, AMD, ATI, and NVIDIA hardware across countless distros and setups, yet nothing seems to make a difference, there's always something that doesn’t work properly with sleep or hibernation. Honestly, it's one of the main issues I wish the Linux community would take a closer look at and finally fix!

This. Linux users must resort to bronze-age tooling in 2025; Crafting and launching handmade scripts by candlelight to diagnose their plethora of sleep issues. But the community likes it this way. Meanwhile, Mac users continue to have sleep that 'just works' and Windows users have an entire sleep troubleshooting toolkit: https://learn.microsoft.com/en-us/windows-hardware/design/de...

I once ran into a corporate laptop that had been downgraded from Windows 11 to 10, that would burn up its CPU during Modern Standby and eventually enter hibernate after burning a good fraction of its battery. The sleep study identified various PCIe devices and I tried installing drivers but they did not help. I wonder if it would've worked better on Windows 11 with stock drivers.
Post reply on HN