Live data from Hacker News

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

nyanpasu64.gitlab.io

131–140 of 218 posts

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

#132
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…

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 en…

I know the NUC I had had it's ethernet port put PERMANENTLY to sleep.

There was, eventually, a Windows program which hacked the device to take it out of sleep. But I had no Windows OS on it. Before I got around to installing enough Windows, the NUC died for other reasons :-(

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

#133

AMD GPU linux drivers are (were?) a nightmare in general, and this includes iGPUs in their processors. Sadly, I don't have the impression that AMD is actively working on fixing this. Just to make sure I'm not griping over something long fixed, I took a quick look and instantly found someone with a very similar issue to the one I ran into happening on a semi-recent kernel: https://community.amd.com/t5/pc-drivers-softw…

> It looks to me that if you want to have a working computer under Linux, it's worth the extra cost to avoid AMD. I think this is a rather hasty conclusion. The popular opinion is the opposite. If you want a working computer under Linux, it's worth it to avoid NVIDIA, especially for laptops. Sure, AMD are not perfect contributors to the kernel, but they are contributing more than NVIDIA[0]. NVIDIA has made some moves…

In my case, the choice wasn't between AMD and Nvidia but between the iGPUs included in the CPUs, i.e. AMD or Intel.

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

#134
post #40

Earlier quoted context omitted.

That seems like a good way to cook your laptop when you throw it into a bag with the CPU pegged.

Not if you turn it off first.

For some reason, people really insist on being able to put their machines to sleep, I honestly don't know why. Long boot times, maybe?

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

#135
I guess "hibernating" (writing VRAM to swap) works better than expecting userspace to gracefully handle device resets. One linear read vs. a thundering herd of processes re-initialising, decompressing, etc. should be more predictable/reliable at least.

I do wonder however how much VRAM is "volatile" - ie. framebuffers - and could just be thrown away. And web browsers seem to handle GPU resets just fine, so maybe they could opt-in?

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

#136

Earlier quoted context omitted.

If you have a modern machine with S0 sleep, which is "modern standby" it's very much solved. What it does is it pauses all userspace processes, disables all cores but one and keeps it running on the lowest frequency. The system stays "on" but all devices go in power-saving state which is good enough for days. So it's not really a problem unless you really wanna do deeper sleeps.

> so it's not really a problem unless you really wanna do deeper sleeps. the way I parsed this was; so it's not really a problem unless you want to use your computer the way you want to use it. I get things are complicated, and hardware support is a mixed bag. But it doesn't have to be this way.

My honest experience is that S0 is a godsend, when you use a device on a weekly basis S0 is good enough and it just works, no messing and fiddling and tweaking, just running.

Chasing "real sleep" gives me nothing but pain. Also Android devices "sleep" fully awake so it's really "what people are doing".

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

#137

Earlier quoted context omitted.

Not if you turn it off first.

For some reason, people really insist on being able to put their machines to sleep, I honestly don't know why. Long boot times, maybe?

I mean I totally get it. At the end of the day I have a billion tabs open and 14 instances of notepad. But after getting burned by sleep failing enough times, you gotta change your habits.

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

#138
post #135

I guess "hibernating" (writing VRAM to swap) works better than expecting userspace to gracefully handle device resets. One linear read vs. a thundering herd of processes re-initialising, decompressing, etc. should be more predictable/reliable at least. I do wonder however how much VRAM is "volatile" - ie. framebuffers - and could just be thrown away. And web browsers seem to handle GPU resets just fine, so maybe they…

I didn't mention in the article but the Nvidia drivers at one point would drop VRAM rather than preserving it, leading to corrupted RGB noise textures in window managers and browsers (and potential crashes though I don't think I encountered them). I suggested doing this on the AMD bug tracker (https://gitlab.freedesktop.org/drm/amd/-/issues/2362#note_20...), but the amdgpu developers weren't interested.

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

#139

what is 'agd5f/linux'?

As I understand https://gitlab.freedesktop.org/agd5f/linux is Alex Deucher (amdgpu maintainer)'s personal Git tree/repo (https://docs.kernel.org/process/maintainers.html#radeon-and-...), where amdgpu changes get merged into before they reach the main Linux tree (and/or the drm/tip repo, I'm not sure their relationship).

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

#140
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?

Recent Windows laptops have even more issues. My wife literally never suspends her Windows laptop for this reason. Meanwhile my Intel/Nvidia laptop running Debian works flawlessly (albeit with Nouveau drivers, gave up on the proprietary ones for reasons unrelated to suspend).
Post reply on HN