Skip to main content
Topic: [Solved] Laptop freezes when waking from sleep/suspend (when opening lid)? (Read 573 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

[Solved] Laptop freezes when waking from sleep/suspend (when opening lid)?

Setup:
Dinit + KDE + Wayland + SDDM + Lightly + gtk4 theme
If it happens to be relevant it has a 12th gen U series i5 and mobile 3050.

My laptop has been having a pretty bizarre issue. Every time I try to wake it from sleep by opening it or with the power button it displays the wrong lock screen (different to the one I set and the one I see when I simply log out (also different to sddm)). It freezes after about 1 second. The keyboard and mouse go unresponsive but if I hold the power button for about 5 seconds it unfreezes the keyboard only and I can get in but the settings are 'off' and the touch pad gets disabled if you do this. The other option is to hold power for 10s and turn it off and on. There are no issues if I just let it go to sleep without closing it, when booting, rebooting, logging in and out, after dimming the screen. What I described up to this point is what happens on Wayland. On x11 it doesn't freeze completely but it starts glitching out and having artifacts and freezes later?

To sum up it only happens if I close it or put it to sleep by pressing the power button and then try to wake it up.

What I've tried:
  • x11 instead of Wayland
  • disabling the lock screen (then it just freezes on the desktop)
  • usining nvidia options (nvidia_drm.modeset=1, NVreg_PreserveVideoMemoryAllocations=1), reinstalling drivers...
  • various sleep setting combinations
  • changing themes (gtk2, gtk4, qt5...)
  • updating things

I don't really think it's a nvidia issue but I did see some similar issues in the KDE subreddit with Walyand from 2 years ago with no real resolution. I went through logs a bit but if I'm honest I don't know what exactly I am looking for. I did see
Quote
dbus-deamon[623]: [system] Activated service 'org.freedesktop.login1' failed: Process org.freedesktop.login1 received signal 15
(ModemManager: 860): Glib-GIO-WARNING **:00:07:39.339: Error releasing name  org.freedesktop.ModemManager1: The connection is closed
. And there was also a [base-manager] couldn't check support for device in there somewhere.

Any clue to what could be wrong?

Re: Laptop freezes when waking from sleep (specifically when opening laptop)?

Reply #1
I do not know what is up, but I think you should try doing it with a different DE, like XFCE or GNOME. That will give us more info

Re: Laptop freezes when waking from sleep (specifically when opening laptop)?

Reply #2
Or maybe it really could be an nvidia suspend issue. It's the same as this thread.

Re: Laptop freezes when waking from sleep (specifically when opening laptop)?

Reply #3
Update: I made it work!

After going back to X11 and not enjoying it I decided to give it another go and was successful this time.

How I got nvidia+wayland+dinit working for me:
  • installed with KDE plasma + dinit stable release for convenience (tried with base but cfdisk kept saying that drive was in use and making only my USB stick available)
  • used pacman -Rsnc $(pacman -Qqs x) for everything DE related to completely strip plasma, xorg, sddm, wayland... everything
  • used pacman -Syyu to update existing packages or what was left
  • used pacman -Sy gnome gnome-extra sddm-dinit xorg wayland sof-firmware linux-firmware linux-firmware-qlogic + dinitctl enable sddm to set up gnome
  • IMPORTANT PART DOWN HERE
  • edited
    Code: [Select]
    /etc/default/grub
    (kernel parameters) to add
    Code: [Select]
    nvidia nvidia-drm.modeset=1 nvidia-drm.fbdev=1
  • used pacman -S linux-lts nvidia-dkms, pacman -R linux and grub-mkconfig -o /boot/grub/grub.cfg to get the lts kernel
  • finally I edited
    Code: [Select]
    /lib/elogind/system-sleep/nvidia
    to add
    Code: [Select]
    pre) /usr/bin/nvidia-sleep.sh "suspend"
    like this suggested

Right now I don't really know how much each of these helped but I'm assuming it might actually be linux-lts kernel and/or nvidia-dkms + the kernel parameters. When I tried gnome with regular nvidia drivers, kernel and without changing the sleep script it left me hanging on the sddm screen (I had to use x11). I'm guessing this should also be working on KDE but haven't tried it yet.