System not waking from sleep sometimes

I am running endevouros on a Thinkpad P52. I face a problem once or twice a week whereby the system fails to resume from sleep (suspend). I have no idea what’s causing it and I always have to force restart. Today, I lost unsaved documents.

You can have a look at the output of journalctl here. I suspended the laptop at 17:46 and tried to resume at 18:35. Let me know if you find something suspicious.

Maybe this is what you are running into https://bugs.kde.org/show_bug.cgi?id=477738

I am not using Wayland.

So what are you using? Output from inxi -Gb will be helpful :slight_smile:

I also found this bug after diagnosing another user, but it may also be unrelated to your issue since this isn’t really about sleep, but the lock screen https://bugs.kde.org/show_bug.cgi?id=483163

I am using i3wm, not KDE.

System:
  Host: P50 Kernel: 6.6.32-1-lts arch: x86_64 bits: 64
  Desktop: i3 v: 4.23 Distro: EndeavourOS
Machine:
  Type: Laptop System: LENOVO product: 20MAS0CU00 v: ThinkPad P52
    serial: <superuser required>
  Mobo: LENOVO model: xx v: xx WIN
    serial: <superuser required> UEFI: LENOVO v: N2CET68W (1.51 )
    date: 09/05/2023
Battery:
  ID-1: BAT0 charge: 59.5 Wh (72.6%)
    condition: 81.9/90.0 Wh (91.0%)
CPU:
  Info: 6-core Intel Xeon E-2176M [MT MCP] speed (MHz): avg: 850
    min/max: 800/4400
Graphics:
  Device-1: Intel Coffee Lake-S GT2 [UHD Graphics P630]
    driver: i915 v: kernel
  Device-2: NVIDIA GP107GLM [Quadro P2000 Mobile] driver: nvidia
    v: 535.179
  Device-3: Chicony Integrated Camera (1280x720@30)
    driver: uvcvideo type: USB
  Display: x11 server: X.Org v: 21.1.13 with: Xwayland v: 24.1.0
    driver: X: loaded: modesetting,nvidia dri: iris gpu: i915
    resolution: 1920x1080~60Hz
  API: EGL Message: No EGL data available.
  API: OpenGL v: 4.6 vendor: intel mesa v: 24.1.1-arch1.1
    renderer: Mesa Intel UHD Graphics P630 (CFL GT2)
  API: Vulkan v: 1.3.279 drivers: nvidia surfaces: xcb,xlib
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi
  Device-2: Intel Ethernet I219-LM driver: e1000e
Drives:
  Local Storage: total: 4.55 TiB used: 844.01 GiB (18.1%)
Info:
  Memory: total: 32 GiB note: est. available: 30.98 GiB
    used: 12.61 GiB (40.7%)
  Processes: 401 Uptime: 3d 21h 23m Shell: Zsh inxi: 3.3.34

Try setting up " Preserve video memory after suspend" as described in this article: NVIDIA/Tips and tricks - ArchWiki

You can add a kernel module parameter by creating a config in etc/modprobe.d/ with an editor like Nano:

sudo nano /etc/modprobe.d/nvidia-preserve-memory.conf

Paste in the options for the kernel module parameter:

options nvidia NVreg_PreserveVideoMemoryAllocations=1

Save and exit out of the file. Then rebuild the initramfs.

sudo dracut-rebuild

Finally, enable the services mentioned in the article.

sudo systemctl enable --now nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service

Thanks, I’ll try it and report back here. However, as I mentioned in my original post, this happens once a week or so. I have no idea how to reproduce it.