Edit for anybody who finds this post later: It was an Ubuntu specific issue. Swapping it for Fedora has allowed sleep to work perfectly. I suspect the Ubuntu kernels have an issue with certain motherboards.

So this is a problem I’ve had for a while, but I’ve finally decided I’m sick of it enough to see if anybody has any ideas.

Basically, I replaced my PCs motherboard and PSU to make them fit into a mini itx case so I’d have more space.

Ever since then, I’ve had an issue where putting my PC to sleep causes it to appear to sleep properly for a split second, all the lights and fans turning off. But then immediately after that, the lights and fans come back on as if it were trying to wake from sleep, except it just gets stuck like that, with no video output to the monitor, no audio output to the speakers, and unresponsive to any button presses. Even pressing and holding the power button does nothing.

I can restore it from this state by shutting off my power supply then immediately turning it back on. This results in the computer acting like I woke it up from sleep completely normally. Even the logs show no errors, saying that it went to sleep properly and that it woke up properly when I flicked the switch.

Weirdly, I had no issues having it sleep on Windows initially, displaying the expected behavior of all the fans and lights turning off and staying off, and coming back to life with video and audio when I tap the power button. This behavior started the first time I tried to put it to sleep in Ubuntu, where it did what I explained above. Since then, not even Windows will sleep properly anymore.

This behavior seems to exclusively happen when using suspend to ram. Hibernation works fine on Windows and Linux, as well as standby. As a result, I’ve been using those as a workaround.

My setup is the following:
Motherboard: Gigabyte a520i AC
PSU: Cooler Master v850 SFX
GPU: Radeon RX5700 XT (can’t remember the exact brand)
CPU: Ryzen 5 3500
RAM: 16 gigabytes. Corsair Vengeance sounds like the right one, but I don’t entirely remember.

Not sure if it’s important, but I’m also running an Samsung 970 Evo Plus NVME, a Samsung 860 Evo 2.5 inch SSD, some kind of western digital HDD, a Viotek monitor, and a wireless Logitech mouse and keyboard (which aren’t Bluetooth, they use receivers.) I’ve tested without the mouse and keyboard just in case though and the same behavior was exhibited.

Any help is appreciated. Even if nobody knows what’s going on, being a few steps closer to finally solving this would be nice. I’m posting this right before bed though, so I may not see any replies until tomorrow unless I end up too hyper focused on this to sleep.

EDIT: Issue was fixed on Windows by running “powercfg/a” to check sleep states, which shouldn’t have worked, so I think the windows issue was just a fluke since it didn’t start until Ubuntu started doing it.
Ubuntu’s still broken though. Nothing I do fixes it and I suspect there’s an incompatibility between it and my motherboard. Probably need to wait for a new kernel update that happens to fix it.

  • remotelove@lemmy.ca
    link
    fedilink
    arrow-up
    7
    ·
    edit-2
    5 months ago

    If you haven’t done your BIOS updates, you probably should.

    I Googled a little and there are some notes about needing to disable the ~~S5 and/or ~~ S3 sleep states in the BIOS as well. I already click away from the forum I saw that in, but it seems others were having similar issues in Linux as well.

    My initial impression is that the issue is pointed directly at the motherboard as the problem is similar between two different operating systems. The GPU would be next in line to check as it may not like the way the motherboard is trying to sleep. I am fairly sure there are sleep state flags for NVIDIA drivers, so it’s fair to assume that AMD would have something similar as well.

    Unless there are major compatibility issues between the other components, it fairly safe to say that those shouldn’t be causing problems. I mean, it’s still possible but it’s something to check last. (I believe your NVME might also have some type of sleep/idle state as well so we can’t completely discount anything else. I have 3 EVO 990’s and I seem to remember there being power savings/sleep settings for them. I could be wrong.)

    Edit: S5 is the powered off state. Lulz. Try disabling that!

    • SombyrOP
      link
      fedilink
      arrow-up
      3
      ·
      5 months ago

      I’ve been updating the bios every time a new version comes out hoping it fixes the issue, but unfortunately no luck so far. I also can’t find any options related to sleep states in my bios besides some energy saving settings that I’ve already tested and don’t fix the issue.

      As far as checking the sleep states of the GPU and potentially the NVME, I don’t know how to do that. I could see though that it’s possible the GPU and motherboard are trying to sleep in different ways.

      Oddly though, the one example I’ve found of the same issue occurring to other people was that it happened on certain AMD thinkpads on older versions of the Linux kernel. My issue seems a bit different though since it applies to windows too.

      • remotelove@lemmy.ca
        link
        fedilink
        arrow-up
        3
        ·
        5 months ago

        Here is the forum where I got the info about the S3 sleep state: https://bbs.archlinux.org/viewtopic.php?id=291345. It talks a little about NVIDIA, but obviously that won’t help you.

        You could also play around with powrcfg in Windows to see if here are errors. That’s all I got as I don’t know how to tinker with APM/ACPI in Linux.

        Quite frankly, when I have had sleep issues in the past, I just disabled it since power management can be extremely problematic in a lot of instances. (This might be related in some way: https://community.amd.com/t5/graphics-cards/graphic-card-prevents-windows-11-sleep-mode/td-p/576586)

        • SombyrOP
          link
          fedilink
          arrow-up
          2
          ·
          5 months ago

          Yeah, I’m suspecting now that some of my hardware just has incompatible sleep states with each other. Since hibernation and such work, it’s possible my motherboard tries to go into it’s sleep state, and gets interrupted by another piece of hardware that doesn’t support that sleep state and the whole thing just panics and dies.

          I’ll look into that tomorrow. I think if that’s the case the only possible solution is to just disable sleep entirely and rely on hibernation if I really need to suspend the system.

  • jgkawell@lemmy.world
    link
    fedilink
    English
    arrow-up
    4
    ·
    5 months ago

    I’ve had a similar issue before and it was wake-on-lan causing it. Disabling that feature (usually in the UEFI/BIOS) solved it.

    • SombyrOP
      link
      fedilink
      arrow-up
      4
      ·
      5 months ago

      Unfortunately, disabling wake on lane didn’t help the issue. It still won’t sleep properly. I think however that that solved a completely different issue I was having of my PC randomly turning on on occasion.

    • bobsuruncle@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      5 months ago

      That was my first thought too. Regardless it’s got to be uefi/bios related as it’s across OSes

  • SombyrOP
    link
    fedilink
    arrow-up
    1
    ·
    5 months ago

    An update: For some reason the issue was solved on Windows simply by running the “powercfg/a” command in the command prompt to check available sleep states. I no longer think the issue is with my motherboard, as it also slept fine on Windows before I’d started Linux. It’s possible the windows issue was just a fluke. It now sleeps properly.
    Ubuntu still will not sleep properly however. I could have sworn I previously found other people with the same issue, but I cannot find them anymore.

    Either way, the issue appears to be with Linux unlike previously thought. Possibly an incompatibility with my motherboard.