Desktop PC Nvidia suspend issue

Need some help. The issue I am facing is I have a desktop PC with i5 12th gen and Nvidia 3050. When I sleep the PC it doesn’t wake up properly. The PC turns on but the display is not. It seems as if there is no output from GPU as the display is still in suspend mode.
I have nvidia-hibernate, nvidia-suspend, nvidia-resume services enabled.

I have added nvidia modules to mkinitcpio.conf
nvidia nvidia_modeset nvidia_uvm nvidia_drm

also added a modprobe file based on some suggestions in nvidia forum

cat /etc/modprobe.d/nvidia-kms.conf 
options nvidia_drm modeset=1
➜  ~ inxi -Fza  
System:
  Kernel: 5.17.5-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/vmlinuz-linux-zen
    root=UUID=9d659da7-1b42-4a43-a123-6371785cd845 rw rootflags=subvol=@
    resume=UUID=ed057872-87dc-47b7-85ec-3958a861f810 loglevel=3 nowatchdog
    nvme_load=YES nvidia-drm.modeset=1
  Desktop: KDE Plasma v: 5.24.5 tk: Qt v: 5.15.3 wm: kwin_x11 vt: 1
    dm: SDDM Distro: EndeavourOS base: Arch Linux
Machine:
  Type: Desktop Mobo: Gigabyte model: H610M S2 DDR4 v: x.x
    serial: <superuser required> BIOS: American Megatrends LLC. v: F5
    date: 01/10/2022
CPU:
  Info: model: 12th Gen Intel Core i5-12600K bits: 64 type: MST AMCP
    arch: Alder Lake family: 6 model-id: 0x97 (151) stepping: 2 microcode: 0x18
  Topology: cpus: 1x cores: 10 mt: 6 tpc: 2 st: 4 threads: 16 smt: enabled
    cache: L1: 864 KiB desc: d-4x32 KiB, 6x48 KiB; i-6x32 KiB, 4x64 KiB
    L2: 9.5 MiB desc: 6x1.2 MiB, 1x2 MiB L3: 20 MiB desc: 1x20 MiB
  Speed (MHz): avg: 4221 high: 4500 min/max: 800/4900:3600 scaling:
    driver: intel_pstate governor: powersave cores: 1: 4500 2: 4500 3: 4500
    4: 4500 5: 4500 6: 4500 7: 4500 8: 4500 9: 4500 10: 4500 11: 4500
    12: 4352 13: 3379 14: 3400 15: 3460 16: 3452 bogomips: 117964
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2
    mitigation: Enhanced IBRS, IBPB: conditional, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel AlderLake-S GT1 vendor: Gigabyte driver: i915 v: kernel
    ports: active: none empty: DP-4 bus-ID: 00:02.0 chip-ID: 8086:4680
    class-ID: 0300
  Device-2: NVIDIA GA106 [Geforce RTX 3050] driver: nvidia v: 510.68.02
    alternate: nouveau,nvidia_drm pcie: gen: 4 speed: 16 GT/s lanes: 8
    link-max: lanes: 16 ports: active: none off: HDMI-A-1
    empty: DP-1,DP-2,DP-3 bus-ID: 01:00.0 chip-ID: 10de:2507 class-ID: 0300
  Device-3: Lenovo FHD Webcam Audio type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-7:5 chip-ID: 17ef:4831
    class-ID: 0102 serial: <filter>
  Display: x11 server: X.Org v: 21.1.3 with: Xwayland v: 22.1.1
    compositor: kwin_x11 driver: X: loaded: intel,nvidia unloaded: modesetting
    alternate: fbdev,nouveau,nv,vesa gpu: nvidia,nvidia-nvswitch
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2560x1440 s-dpi: 108 s-size: 602x342mm (23.70x13.46")
    s-diag: 692mm (27.26")
  Monitor-1: HDMI-A-1 mapped: HDMI-0 note: disabled model: Acer VG271U
    serial: <filter> built: 2020 res: 2560x1440 hz: 144 dpi: 109 gamma: 1.2
    size: 597x336mm (23.5x13.23") diag: 685mm (27") ratio: 16:9 modes:
    max: 2560x1440 min: 640x480
  OpenGL: renderer: NVIDIA GeForce RTX 3050/PCIe/SSE2
    v: 4.6.0 NVIDIA 510.68.02 direct render: Yes
Audio:
  Device-1: Intel Alder Lake-S HD Audio vendor: Gigabyte
    driver: snd_hda_intel v: kernel alternate: snd_sof_pci_intel_tgl
    bus-ID: 00:1f.3 chip-ID: 8086:7ad0 class-ID: 0403
  Device-2: NVIDIA driver: snd_hda_intel v: kernel pcie: gen: 4
    speed: 16 GT/s lanes: 8 link-max: lanes: 16 bus-ID: 01:00.1
    chip-ID: 10de:228e class-ID: 0403
  Device-3: Lenovo FHD Webcam Audio type: USB
    driver: snd-usb-audio,uvcvideo bus-ID: 1-7:5 chip-ID: 17ef:4831
    class-ID: 0102 serial: <filter>
  Sound Server-1: ALSA v: k5.17.5-zen1-1-zen running: yes
  Sound Server-2: PulseAudio v: 15.0 running: no
  Sound Server-3: PipeWire v: 0.3.51 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Gigabyte driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: 3000 bus-ID: 03:00.0 chip-ID: 10ec:8168 class-ID: 0200
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
Bluetooth:
  Device-1: TP-Link UB500 Adapter type: USB driver: btusb v: 0.8
    bus-ID: 1-6:4 chip-ID: 2357:0604 class-ID: e001 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 715.41 GiB used: 134.89 GiB (18.9%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Seagate model: XPG GAMMIX S5
    size: 238.47 GiB block-size: physical: 512 B logical: 512 B
    speed: 31.6 Gb/s lanes: 4 type: SSD serial: <filter> rev: V9002s85
    temp: 41.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: A-Data model: SU650 size: 476.94 GiB
    block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD
    serial: <filter> rev: 0241 scheme: GPT
Partition:
  ID-1: / raw-size: 205.97 GiB size: 205.97 GiB (100.00%)
    used: 14.15 GiB (6.9%) fs: btrfs dev: /dev/nvme0n1p4 maj-min: 259:4
  ID-2: /boot raw-size: 512 MiB size: 487.2 MiB (95.16%)
    used: 326 MiB (66.9%) fs: ext4 dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-3: /home raw-size: 476.94 GiB size: 468.38 GiB (98.21%)
    used: 120.42 GiB (25.7%) fs: ext4 dev: /dev/sda1 maj-min: 8:1
  ID-4: /var/log raw-size: 205.97 GiB size: 205.97 GiB (100.00%)
    used: 14.15 GiB (6.9%) fs: btrfs dev: /dev/nvme0n1p4 maj-min: 259:4
Swap:
  Kernel: swappiness: 60 (default) cache-pressure: 100 (default)
  ID-1: swap-1 type: partition size: 32 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p3 maj-min: 259:3
Sensors:
  System Temperatures: cpu: 50.0 C mobo: 16.8 C gpu: nvidia temp: 45 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 31%
Info:
  Processes: 457 Uptime: 2m wakeups: 0 Memory: 31.13 GiB
  used: 9.32 GiB (29.9%) Init: systemd v: 250 tool: systemctl Compilers:
  gcc: 11.2.0 clang: 13.0.1 Packages: 1190 pacman: 1179 lib: 355 flatpak: 11
  Shell: Zsh v: 5.8.1 running-in: konsole inxi: 3.3.15

Please guide me on what am I missing.

Not sure if you need all those things set up on nvidia. Looks like drivers are installed. Did you try setting these?

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

reboot

1 Like

Was it there from first installation or is it new and if so, which related packages were recently upgraded?

It may be a new bug…

yeah, i have those enabled

Yes, I have all the latest packages, updated just today morning.

This wasn’t my question, though.
How old is your installation and when the issue started happening?

Its a new machine and just 2 weeks old installation. The sleep, hibernate is not working from day 1.

Note: You can post answers in the same post and also can edit an old post, if you need to make it better.

You still answer only one question…

updated my reply above

1 Like

I would blame nvidia.
You can never be wrong doing it :stuck_out_tongue_winking_eye:

should I try lts kernel?

1 Like

hmm that didn’t help either

Did you install it with swap and hibernation options?

As I have two storage drives, a nvme and a SSD(home drive) I did a custom install and created a swap as big as the ram which is 32gb

Maybe this helps you.

https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate

tried almost all the suggestions there, and enabled Nvidia systems services. mkinitcpio config addition …

That could also mean your solution is in one of the rest, not tried :laughing:

Nevertheless, this topic might give you more ideas to try:

Maybe you could try this:

  • mkdir /tmp-nvidia
  • create/edit the file /etc/modprobe.d/nvidia-power-management.conf
  • insert into that file the line options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/tmp-nvidia

This makes the NVIDIA driver preserve video memory when suspending/hibernating.

If you use suspend-then-hibernate you’ll need more tweaks, but if you’re on desktop I guess you don’t need it.

so that didn’t work. No did the suggestion here https://forums.developer.nvidia.com/t/systemds-suspend-then-hibernate-not-working-in-nvidia-optimus-laptop/213690.

➜  ~ cat /lib/systemd/system-sleep/nvidia                                                  
#!/bin/sh

case "$1" in
    pre)
        case "$SYSTEMD_SLEEP_ACTION" in
            suspend|hibernate)
                /usr/bin/nvidia-sleep.sh "$SYSTEMD_SLEEP_ACTION"
                ;;
            suspend-after-failed-hibernate)
                /usr/bin/nvidia-sleep.sh "suspend"
                ;;
        esac
        ;;
    post)
        /usr/bin/nvidia-sleep.sh "resume"
        ;;
esac
➜  ~ 

It’s so weird, suspend resume works better on my Lenovo laptop than on my custom desktop. Both have Nvidia graphic cards. I wonder why. Anyways may have to move back to windows, cant keep closing and opening apps.

Thanks for the help guys

They are totally different HW!!!
And suspend/sleep/hibernate is focused on laptops for battery saving, which is not a real issue on desktops, apart for global energy consumption, global warming, etc.


Both have Nvidia graphic cards

The system is working fine. Only the monitor is black.
Which GPU/port is the monitor connected on?
Have you read MB manual?
Did you try connecting the monitor to the other GPU?


Naahh! Just use WinOS… :rofl: It suits better to your workflow!