13" AMD Framework w/ Ubuntu won't suspend, immediately wake up again (amdgpu)

Hey folks,

for a while now I’ve regularly run into the issue that my 13" AMD 7040 series Framework machine that’s running Ubuntu 24.04.2 won’t properly go to sleep but instead immediately wake up again after trying to sleep (which explains why it often ran out when just closing the lid).

After digging a bit in the log files, it seems that the amdgpu is to blame, as it will fail to suspend, leading to waking up again (see the log file excerpt below).

I’m wondering, has anyone else run into this issue too? And if so, did anyone manage to solve it? My attempts at finding any solutions on the web have not been successful, and I’m a bit too much of a linux newbie to have good ideas beyond that :wink:

Thanks for any suggestions already!

Here’s the log excerpt:

May 08 23:32:31 fw13 systemd[1]: Starting systemd-suspend.service - System Suspend...
May 08 23:32:31 fw13 rtkit-daemon[2984]: Successfully made thread 4549 of process 4520 owned by '1000' high priority at nice level 0.
May 08 23:32:31 fw13 rtkit-daemon[2984]: Supervising 2 threads of 2 processes of 1 users.
May 08 23:32:31 fw13 rtkit-daemon[2984]: Supervising 1 threads of 1 processes of 1 users.
May 08 23:32:31 fw13 rtkit-daemon[2984]: Supervising 1 threads of 1 processes of 1 users.
May 08 23:32:31 fw13 rtkit-daemon[2984]: Successfully made thread 4549 of process 4520 owned by '1000' RT at priority 20.
May 08 23:32:31 fw13 rtkit-daemon[2984]: Supervising 2 threads of 2 processes of 1 users.
May 08 23:32:31 fw13 systemd-sleep[208289]: Performing sleep operation 'suspend'...
May 08 23:32:31 fw13 systemd-sleep[208289]: Performing sleep operation 'suspend'...
May 08 23:32:31 fw13 kernel: PM: suspend entry (s2idle)
May 08 23:32:31 fw13 kernel: Filesystems sync: 0.003 seconds
May 08 23:32:31 fw13 kernel: Freezing user space processes
May 08 23:32:31 fw13 kernel: Freezing user space processes completed (elapsed 0.002 seconds)
May 08 23:32:31 fw13 kernel: OOM killer disabled.
May 08 23:32:31 fw13 kernel: Freezing remaining freezable tasks
May 08 23:32:31 fw13 kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
May 08 23:32:31 fw13 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
May 08 23:32:31 fw13 rtkit-daemon[2984]: Supervising 2 threads of 2 processes of 1 users.
May 08 23:32:31 fw13 systemd-sleep[208289]: Performing sleep operation 'suspend'...
May 08 23:32:31 fw13 kernel: PM: suspend entry (s2idle)
May 08 23:32:31 fw13 kernel: Filesystems sync: 0.003 seconds
May 08 23:32:31 fw13 kernel: Freezing user space processes
May 08 23:32:31 fw13 kernel: Freezing user space processes completed (elapsed 0.002 seconds)
May 08 23:32:31 fw13 systemd-sleep[208289]: Performing sleep operation 'suspend'...
May 08 23:32:31 fw13 kernel: PM: suspend entry (s2idle)
May 08 23:32:31 fw13 kernel: Filesystems sync: 0.003 seconds
May 08 23:32:31 fw13 kernel: Freezing user space processes
May 08 23:32:31 fw13 kernel: Freezing user space processes completed (elapsed 0.002 seconds)
May 08 23:32:31 fw13 kernel: OOM killer disabled.
May 08 23:32:31 fw13 kernel: Freezing remaining freezable tasks
May 08 23:32:31 fw13 kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
May 08 23:32:31 fw13 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
May 08 23:32:31 fw13 kernel: [drm] evicting device resources failed
May 08 23:32:31 fw13 kernel: amdgpu 0000:c1:00.0: PM: device_prepare(): pci_pm_prepare+0x0/0x80 returns -16
May 08 23:32:31 fw13 kernel: amdgpu 0000:c1:00.0: PM: not prepared for power transition: code -16
May 08 23:32:31 fw13 kernel: PM: Some devices failed to suspend, or early wake event detected
May 08 23:32:31 fw13 kernel: OOM killer enabled.
May 08 23:32:31 fw13 kernel: Restarting tasks ... done.
May 08 23:32:31 fw13 kernel: random: crng reseeded on system resumption
May 08 23:32:31 fw13 kernel: PM: suspend exit
May 08 23:32:31 fw13 kernel: PM: suspend entry (s2idle)
May 08 23:32:31 fw13 bluetoothd[2516]: Controller resume with wake event 0x0
May 08 23:32:31 fw13 kernel: Filesystems sync: 0.011 seconds
May 08 23:32:31 fw13 kernel: Freezing user space processes
May 08 23:32:31 fw13 kernel: Freezing user space processes completed (elapsed 0.002 seconds)
May 08 23:32:31 fw13 kernel: OOM killer disabled.
May 08 23:32:31 fw13 kernel: Freezing remaining freezable tasks
May 08 23:32:31 fw13 kernel: Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
May 08 23:32:31 fw13 kernel: printk: Suspending console(s) (use no_console_suspend to debug)
May 08 23:32:31 fw13 kernel: [drm] evicting device resources failed
May 08 23:32:31 fw13 kernel: amdgpu 0000:c1:00.0: PM: device_prepare(): pci_pm_prepare+0x0/0x80 returns -16
May 08 23:32:31 fw13 kernel: amdgpu 0000:c1:00.0: PM: not prepared for power transition: code -16
May 08 23:32:31 fw13 kernel: PM: Some devices failed to suspend, or early wake event detected
May 08 23:32:31 fw13 kernel: OOM killer enabled.
May 08 23:32:31 fw13 kernel: Restarting tasks ... done.
May 08 23:32:31 fw13 kernel: random: crng reseeded on system resumption
May 08 23:32:31 fw13 systemd-sleep[208289]: Failed to put system to sleep. System resumed again: Device or resource busy
May 08 23:32:31 fw13 bluetoothd[2516]: Controller resume with wake event 0x0
May 08 23:32:31 fw13 kernel: PM: suspend exit
May 08 23:32:31 fw13 systemd[1]: systemd-suspend.service: Main process exited, code=exited, status=1/FAILURE
May 08 23:32:31 fw13 systemd[1]: systemd-suspend.service: Failed with result 'exit-code'.
May 08 23:32:31 fw13 systemd[1]: Failed to start systemd-suspend.service - System Suspend.
May 08 23:32:31 fw13 systemd[1]: Dependency failed for suspend.target - Suspend.
May 08 23:32:31 fw13 systemd[1]: suspend.target: Job suspend.target/start failed with result 'dependency'.
May 08 23:32:31 fw13 systemd[1]: Stopped target sleep.target - Sleep.
May 08 23:32:31 fw13 systemd-logind[2546]: Operation 'suspend' finished.
May 08 23:32:31 fw13 ModemManager[2674]: <msg> [sleep-monitor-systemd] system is resuming
May 08 23:32:31 fw13 NetworkManager[2576]: <info>  [1746757951.7352] manager: sleep: wake requested (sleeping: yes  enabled: yes)
May 08 23:32:31 fw13 NetworkManager[2576]: <info>  [1746757951.7356] device (wlp1s0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')

The imho relevant bit is:

May 08 23:32:31 fw13 kernel: amdgpu 0000:c1:00.0: PM: device_prepare(): pci_pm_prepare+0x0/0x80 returns -16
May 08 23:32:31 fw13 kernel: amdgpu 0000:c1:00.0: PM: not prepared for power transition: code -16
May 08 23:32:31 fw13 kernel: PM: Some devices failed to suspend, or early wake event detected

Which Linux distro are you using?

Ubuntu

Which release version?

Ubuntu 24.04.2 LTS

Which kernel are you using?

Linux 6.8.0-41-generic

Which BIOS version are you using?

❯ sudo dmidecode | grep -A3 'Vendor:\|Product:' && sudo lshw -C cpu | grep -A3 'product:\|vendor:'
        Vendor: INSYDE Corp.
        Version: 03.07
        Release Date: 02/19/2025
        Address: 0xE0000
       product: AMD Ryzen 5 7640U w/ Radeon 760M Graphics
       vendor: Advanced Micro Devices [AMD]
       physical id: 4
       bus info: cpu@0
       version: 25.116.1

Which Framework Laptop 13 model are you using?

AMD Ryzen™ 7040 Series

Use s newer kernel. Not the 6.8 kernel. 6.11 OEM ideally.

This was my advice as well, BUT the official documentation for the 7040 series says that you should NOT use the OEM kernel.

linux-docs/Ubuntu24.04LTS-Setup-amd-fw13.md at main · FrameworkComputer/linux-docs · GitHub

However, not suspending is absolutely a kernel issue.

1 Like

So -16 is -EBUSY. It’s really weird that there is even eviction happening in the prepare step for s2idle. I don’t really understand how this happens. Even looking at the patches on Canonical’s kernel tree it explicitly is checking whether you are in s2idle or not. Are you trying hybrid sleep or something?

1 Like

I suggest installing this:

and sharing the output from amd-s2idle test

1 Like

Thanks, I’ll give amd-s2idle test a go! I guess it only makes sense to run the next time the issue occurs, right? (As the problem is that it’s an intermittent problem)

It’s only intermittent? I was expecting there was something fundamental going on here. Let me see what the report looks like from a single test run with the tool for hints.

Yes, it only happens sometimes and I’m not sure what change of state the machine goes through to end up in that place where it happens.

The full log of the run when it does correctly suspend is here as a gist as it was too long for inline quoting: amd-s2idle-output.txt · GitHub

Well from the failure you show there it is basically when there is memory pressure. Does that make sense?

Can you please check this is the latest 6.8 kernel in the repos? Are you fully up to date?

Yes, memory pressure makes sense, I had found some thread that would fit to that during my search, here.

I believe I should be on the latest kernel that Ubuntu provides:

❯ cat /proc/version_signature
Ubuntu 6.8.0-41.41-generic 6.8.12

I tried finding out what the latest version is for 6.8 but failed, if you’d have a pointer where I could find it, I’d be grateful and would look it up!

Thanks for all the help so far!

Just run sudo apt update && sudo apt upgrade. Make sure the kernel specifically is up to date.

1 Like

Ah, gotcha! Did that and there’s no newer kernel available!

That’s very weird. You should have been offered 6.8.0-59.61

Nonetheless, here’s the solution to your issue. This patch is missing which adjusts policy so it never runs during that stage for an APU.

1 Like

That’s indeed strange for the update, I’ll have to check that!

But if I see that correct, the fix would in any case not be part of that update, correct?

As a total noob: how would I go about applying your patch? :sweat_smile:

Right - It would not be part of that update.

TBH - if you’re new to Linux go and pick up Fedora. It has the newer kernel, it has hardware enabled video decode for Firefox.

1 Like

Thanks @Mario_Limonciello – really for all the input here (and if I’m not mistaken even being the author of that patch that solves the issue!) and also the good judgement on the solution. When I have some time I’ll try to pick up Fedora and move over from Ubuntu!