Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Laptop with NVIDIA can't suspend. (Read 1001 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Laptop with NVIDIA can't suspend.

Hello, I'm having trouble putting my laptop to sleep, even though it used to work before I updated the packages. Could you please advise me on what the problem might be, and is it possible to do this on systems without systemd, or is it better to return to a standard distribution?

I'm using this script:
/lib64/elogind/system-sleep/nvidia
Code: [Select]
#!/bin/sh
NVSLEEP="/usr/bin/nvidia-sleep.sh"
logger -t "elogind/system-sleep" -s "nvidia $1 $2"
case "$1" in
pre)
            case "$2" in
                        suspend|hibernate)
                                "${NVSLEEP}" "$2"
                        ;;
                esac
        ;;
post)
             case "$2" in
                        suspend|hibernate)
                                sleep 1
                                "${NVSLEEP}" resume &
                        ;;
                esac
        ;;
esac

inxi
Code: [Select]
Machine:
  Type: Laptop System: ASUSTeK product: TUF GAMING FX504GD_FX80GD v: 1.0
    serial: <superuser required>
  Mobo: ASUSTeK model: FX504GD v: 1.0 serial: <superuser required>
    UEFI: American Megatrends v: FX504GD.322 date: 08/23/2021
Battery:
  ID-1: BAT1 charge: 19.3 Wh (73.9%) condition: 26.1/48.1 Wh (54.4%)
    volts: 3.4 min: 11.7 model: ASUS A32-K55 status: discharging
CPU:
  Info: quad core model: Intel Core i5-8300H bits: 64 type: MT MCP
    arch: Coffee Lake rev: A cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 1500 min/max: 800/2300 cores: 1: 1500 2: 1500 3: 1500
    4: 1500 5: 1500 6: 1500 7: 1500 8: 1500 bogomips: 36799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: ASUSTeK
    driver: i915 v: kernel arch: Gen-9.5 bus-ID: 00:02.0
  Device-2: NVIDIA GP107M [GeForce GTX 1050 Mobile] vendor: ASUSTeK
    driver: nvidia v: 570.133.07 arch: Pascal bus-ID: 01:00.0
  Device-3: Azurewave USB2.0 HD UVC WebCam driver: uvcvideo type: USB
    bus-ID: 1-7:4
  Display: wayland server: X.org v: 1.21.1.16 with: Xwayland v: 24.1.6
    compositor: kwin_wayland driver: X: loaded: modesetting,nvidia dri: iris
    gpu: i915 resolution: 1920x1080~60Hz
  API: EGL v: 1.5 drivers: iris,nouveau,nvidia,swrast platforms:
    active: gbm,wayland,x11,surfaceless,device inactive: N/A
  API: OpenGL v: 4.6.0 compat-v: 4.5 vendor: intel mesa v: 25.0.4-arch1.1
    glx-v: 1.4 direct-render: yes renderer: Mesa Intel UHD Graphics 630 (CFL
    GT2)
  Info: Tools: api: eglinfo,glxinfo de: kscreen-console,kscreen-doctor
    gpu: nvidia-settings,nvidia-smi x11: xprop,xrandr
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: ASUSTeK driver: snd_hda_intel
    v: kernel bus-ID: 00:1f.3
  API: ALSA v: k6.14.2-artix1-1 status: kernel-api
  Server-1: PipeWire v: 1.4.2 status: active
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3
  IF: wlan0 state: up mac: <filter>
  Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
    vendor: ASUSTeK driver: r8169 v: kernel port: 3000 bus-ID: 03:00.0
  IF: eth0 state: down mac: <filter>
Bluetooth:
  Device-1: N/A driver: btusb v: 0.8 type: USB bus-ID: 1-14:5
  Report: rfkill ID: hci0 rfk-id: 0 state: up address: see --recommends
Drives:
  Local Storage: total: 1.8 TiB used: 177.3 GiB (9.6%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: SSD 980 500GB size: 465.76 GiB
    temp: 28.9 C
  ID-2: /dev/sda vendor: Western Digital model: WD10SPZX-22Z10T1
    size: 931.51 GiB
  ID-3: /dev/sdb vendor: Kingston model: SA400S37480G size: 447.13 GiB
    type: USB
Partition:
  ID-1: / size: 48.91 GiB used: 27.3 GiB (55.8%) fs: ext4 dev: /dev/sdb2
  ID-2: /boot/efi size: 147.7 MiB used: 283 KiB (0.2%) fs: vfat
    dev: /dev/sdb1
  ID-3: /home size: 171.2 GiB used: 150 GiB (87.6%) fs: ext4 dev: /dev/sdb3
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: 50.0 C pch: 56.0 C mobo: N/A
  Fan Speeds (rpm): cpu: 0

dmesg

Re: Laptop with NVIDIA can't suspend.

Reply #1
Uncomment and change the order of SuspendMode values (deep s2idle) in /etc/elogind/sleep.conf.d/10-elogind.conf. If that doesn't fix it, then it's probably the kernel.

Re: Laptop with NVIDIA can't suspend.

Reply #2
I have the same issue, laptop is a Dell G5.
I installed Artix on it today, before that I was using Garuda (Arch based with systemd) and was having the same problem.

Re: Laptop with NVIDIA can't suspend.

Reply #3
Try the LTS or some other kernel.

Re: Laptop with NVIDIA can't suspend.

Reply #4
Check cat /proc/driver/nvidia/params and make sure you have PreserveVideoMemoryAllocations: 1 and InitializeSystemMemoryAllocations: 0. You can set those in /etc/modprobe.d/69-nvidia-regs.conf (I'm adding some useful stuff there, so make sure you check those links out):
Code: [Select]
# References:
# https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks
# https://forums.developer.nvidia.com/t/does-modprobe-d-nvidia-conf-nvreg-enablestreammemops-need-to-be-set-for-gpudirect-to-work/79511
# https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers/en
# https://github.com/ventureoo/nvidia-tweaks
# https://nvdam.widen.net/s/k8vrp9xkft/tech-overview-magnum-io-1790750-r5-web
# https://developer.download.nvidia.com/devzone/devcenter/cuda/docs/GPUDirect_Technology_Overview.pdf
# https://docs.nvidia.com/nvshmem/pdf/NVSHMEM-Installation-Guide.pdf

# Explainations:
# https://github.com/NVIDIA/open-gpu-kernel-modules/blob/main/src/nvidia/interface/nvrm_registry.h
# https://github.com/NVIDIA/open-gpu-kernel-modules/blob/main/kernel-open/nvidia/nv-reg.h

options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_InitializeSystemMemoryAllocations=0

 

Re: Laptop with NVIDIA can't suspend.

Reply #5
I've tried all the advices, thanks very much. Nothing worked, but I find solution.
Code: [Select]
# pacman -Rns nvidia-dkms
# pacman -S nvidia
IDK, why, but DKMS API is probably broken. It might be the kernel or driver that's causing problems, but it seems connected to this somehow.