-
Star
(120)
You must be signed in to star a gist -
Fork
(3)
You must be signed in to fork a gist
-
-
Save bmcbm/375f14eaa17f88756b4bdbbebbcfd029 to your computer and use it in GitHub Desktop.
| # Use systemd for managing NVIDIA driver suspend in drivers ====>>> PRIOR to version 470 <<<===== | |
| # https://download.nvidia.com/XFree86/Linux-x86_64/450.66/README/powermanagement.html | |
| # https://forums.developer.nvidia.com/t/unable-to-set-nvidia-kernel-module-parameters/161306 | |
| # Please note: In Fedora Linux you may need to just install the xorg-x11-drv-nvidia-power pakage | |
| # as sugested by @goombah88 in the comments below. | |
| TMP_PATH=/var/tmp | |
| TMPL_PATH=/usr/share/doc/nvidia-driver-460/ | |
| echo "options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=${TMP_PATH}" | sudo tee /etc/modprobe.d/nvidia-power-management.conf | |
| sudo install --mode 644 "${TMPL_PATH}/nvidia-suspend.service" /etc/systemd/system | |
| sudo install --mode 644 "${TMPL_PATH}/nvidia-hibernate.service" /etc/systemd/system | |
| sudo install --mode 644 "${TMPL_PATH}/nvidia-resume.service" /etc/systemd/system | |
| sudo install "${TMPL_PATH}/nvidia" /lib/systemd/system-sleep | |
| sudo install "${TMPL_PATH}/nvidia-sleep.sh" /usr/bin | |
| sudo systemctl enable nvidia-suspend.service | |
| sudo systemctl enable nvidia-hibernate.service | |
| sudo systemctl enable nvidia-resume.service | |
@Thermionix I have the same laptop model with the same suspend black screen problem. Tried a bunch of different distros (Fedora, Ubuntu, CachyOS) to no avail. Are there any known fixes so far that you have found?
@atirutw and @Thermionix, you might want to look at NVIDIA/open-gpu-kernel-modules#1142.
Setting NVreg_UseKernelSuspendNotifiers=0 and NVreg_PreserveVideoMemoryAllocations=1 in the kernel parameters as recommended in NVIDIA/open-gpu-kernel-modules#1142 (comment) fixed the issue on my laptop:
$ cat /sys/class/dmi/id/product_version
Legion 5 Pro 16ACH6H
$ cat /sys/class/dmi/id/bios_version
GKCN65WW
$ lsb-release -dr
Description: openSUSE Tumbleweed
Release: 20260603
$ uname -r
7.0.10-2-default
$ mokutil --sb-state
SecureBoot enabled
$ nvidia-smi --version
NVIDIA-SMI version : 595.80
NVML version : 595.80
DRIVER version : 595.80
CUDA Version : 13.2
$ systemctl is-enabled nvidia-{suspend,suspend-then-hibernate,hibernate,resume,persistenced,powerd}.service
enabled
disabled
disabled
enabled
enabled
enabled
$ cat /etc/modprobe.d/nvidia.conf
blacklist nouveau
options nouveau modeset=0
options nvidia NVreg_DynamicPowerManagement=0x02
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/var/tmp
options nvidia NVreg_EnableS0ixPowerManagement=1
options nvidia NVreg_UsePageAttributeTable=1
options nvidia NVreg_UseKernelSuspendNotifiers=0
options nvidia-drm modeset=1
options nvidia-drm fbdev=1
$ sort /proc/driver/nvidia/params | grep -iE 'Preserve|Kernel|Temp'
PreserveVideoMemoryAllocations: 1
TemporaryFilePath: "/var/tmp"
UseKernelSuspendNotifiers: 0
The issue seems to be related to SELinux and I guess we can only wait for newer drivers to manage the issue in a better way.
Note that I have SecureBoot (and full disk encryption) enabled on my system, so hibernation is not possible (hence the suspend-then-hibernate and hibernate services are disabled).
nil change, interestingly NVreg_UseKernelSuspendNotifiers=0 won't change the loaded value for me
$ uname -r
7.0.12-arch1-1
$ nvidia-smi --version
NVIDIA-SMI version : 610.43.02
NVML version : 610.43
$ bootctl
...
Secure Boot: disabled
$ systemctl is-enabled nvidia-suspend.service nvidia-hibernate.service nvidia-resume.service
enabled
enabled
enabled
$ cat /etc/modprobe.d/nvidia.conf
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/var/tmp
options nvidia NVreg_UseKernelSuspendNotifiers=0
$ sort /proc/driver/nvidia/params | grep -iE 'Preserve|Kernel|Temp'
PreserveVideoMemoryAllocations: 1
TemporaryFilePath: "/var/tmp"
UseKernelSuspendNotifiers: 1
Attempting to solve wake to unresponsive blackscreen on a Acer Nitro ANV16S-41 (Latest BIOS is 1.12) w/ RTX 5050
Archlinux w/ KDE 6.6.3
Not responsive to TTY swithc or SSH upon wake; have to SysRq reboot
Following ArchWiki - Preserve_video_memory_after_suspend
No useful errors in journalctl output?