Live data from Hacker News

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

nyanpasu64.gitlab.io

31–40 of 218 posts

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

#32
post #2

Fantastic 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.

My luck has been a little less good. Latest problem I'm having is the driver spamming my logs after waking from sleep with "[drm] scheduler comp_1.0.n is not ready, skipping" after "WARNING: CPU: 12 PID: 11871 at drivers/gpu/drm/amd/amdgpu/../display/dc/dc_helper.c:100 generic_reg_update_ex+0x1d2/0x290 [amdgpu]"

https://gitlab.freedesktop.org/drm/amd/-/issues/3911

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

#33

Apple became a trillion dollar company by mastering sleeping / waking up of electronic devices. why nobody else sees this?

I still have i9 2018 that will drain overnight in sleep mode, and that sleep discharge put the most battery cycles on the device. I think they only fixed it when they ditched the x86 ecosystem.

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

#34
post #14

I have an Nvidia GPU and a sporadic crash (black screen) with no logs on Linux. I suspect it's a driver issue too. Going to try some of these tips to enable the debug shell, but I'm not sure if they'll be effective. Anyone have other tips for this type of thing? I did try upgrading drivers/kernels already

Run a memtest. Graphics cards usually crash badly when given invalid data, which can happen sporadically if you have bad RAM. If memtest shows a specific memory region as failing, swap out sticks to check which it is, and buy a new one. (Or if you're on a tight budget, you can disable that region with kernel boot options.) If memtest gives errors in lots of places, might be a bad overclock. Loosen timings or give it…

This.

I would also recommend running it on one memory slot only (do this one by one).

Recently it happened that even a multi-day memtest run did not catch the defect in one of my ram slots.

But when I emptied it, all the gpu driver problems immediately stopped.

The symptom was a crash followed by garbage on screen and a "zzzz" sound. Sometimes followed by a shutdown.

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

#35

Since a couple Linux versions something around 6.10 IIRC I've had it where my Nvidia system wakes into a black screen, but with a cursor and alt shells work, specifically KDE Plasma seems bugged here, but they say it's a kernel issue, or at least there are dozens of separate issues open about this kind of bug and it's rather annoying that I can't put my machine to sleep. If anyone has ideas what could fix this I'd re…

I have a similar issue. When turning off the monitor using its power button, the system semi-crashes. After powering the monitor back on, I have to go into an alt shell and kill lightdm, which also kills all running GUI applications. Not the greatest workflow.

    $ uname -a
    Linux hostname 6.13.1-arch1-1 #1 SMP PREEMPT_DYNAMIC Sun, 02 Feb 2025 01:02:29 +0000 x86_64 GNU/Linux

    NVIDIA-SMI 570.86.16
    Driver Version: 570.86.16
    CUDA Version: 12.8
Instead of powering off the monitor, I've created an alias:

    alias off='xset dpms force off && await.sh && xset -dpms'
And shell script (press any key to unblank the screen):

    $ cat ~/bin/await.sh 
    #!/usr/bin/env bash

    xinput test-xi2 --root 2>&1 | \
      grep --line-buffered -m 1 'EVENT type 2 (KeyPress)' &> /dev/null
This allows me to run "off", a comromise to put the monitor in low-power mode. This solves the problem of having to kill lightdm, which improves the workflow. Still, sometimes I have to open an alt shell and then press Alt+F7 to return to X. Rarely, I'll have to go to the alt shell/Alt+F7 a second time to suppress sporadic screen glitching.

Adding nomodeset to the GRUB configuration was another suggestion:

    # grep vmlinuz /boot/grub/grub.cfg | head -1
    linux /vmlinuz-linux root=UUID=... rw nomodeset quiet resume=UUID=...
Hope it helps.

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

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

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 supposed to provide to OSes, and no one is really checking them, so it’s very common for devices to have only partial support for things they supposedly do.

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

#37
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!

I think it it's because there are too many subsystems involved in sleep/resume all being worked on as independent projects (kernel, drivers which sometimes have both kernel and user space components, init system, display server, desktop environment, probably others I'm not aware of). That said, I've had my share of sleep issues on Windows as well over the years, I suspect for the same reasons.

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

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

This space is problematic enough that you could reliably segfault 2017-2019 Intel MacBooks by closing the lid before unplugging HID peripherals, preventing suspend (and cooking it in your bag on the commute home).

It also plagues Windows on custom PC builds, even when there are vendor drivers. Not every component plays nicely with suspend states, ASPM, C-sates, load line calibration, etc. And while often the capability exists natively to address issues (in BIOS, Linux, etc), how many people know how to start looking?

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

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

This space is problematic enough that you could reliably segfault 2017-2019 Intel MacBooks by closing the lid before unplugging HID peripherals, preventing suspend (and cooking it in your bag on the commute home). It also plagues Windows on custom PC builds, even when there are vendor drivers. Not every component plays nicely with suspend states, ASPM, C-sates, load line calibration, etc. And while often the capabili…

Hmm I thought that was a feature, not a bug. I used to leave everything plugged and close the lid if I wanted big downloads to keep going or wanted an even quicker start up.

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

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

It doesn't work right on Windows either to be fair. With a mixed laptop fleet at work, we've just disabled sleep/hibernate company wide because it causes way too many problems.

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