-
-
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 | |
The method works. In case you need fresh files install the services, you can get your driver version from NVIDIA. Use
nvidia-smi
to get the exact version and then run the.run
file with--extract-only
flag:sudo bash NVIDIA-Linux-x86_64-515.65.01.run --extract-only
.该方法有效。如果您需要新文件,请安装服务,您可以从 NVIDIA 获取您的驱动程序版本。使用nvidia-smi
获取确切版本,然后使用.run
文件和--extract-only
标志运行:sudo bash NVIDIA-Linux-x86_64-515.65.01.run --extract-only
。
Then you run the given commands setting theTMPL_PATH
to the path where you've extracted the files. Keep in mind that the files for this driver (515.65.01) have a slightly different locations as stated in the original post. So the updated commands should be like this:然后,您运行给定的命令,将TMPL_PATH
设置为您提取文件的路径。请记住,此驱动程序 (515.65.01) 的文件位置与原始帖子中所述略有不同。因此,更新后的命令应如下所示:TMPL_PATH=/home/user/Downloads/NVIDIA-Linux-x86_64-515.65.01/systemd sudo install --mode 644 "${TMPL_PATH}/system/nvidia-suspend.service" /etc/systemd/system sudo install --mode 644 "${TMPL_PATH}/system/nvidia-hibernate.service" /etc/systemd/system sudo install --mode 644 "${TMPL_PATH}/system/nvidia-resume.service" /etc/systemd/system sudo install "${TMPL_PATH}/system-sleep/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
535.183.01 works! thanks !535.183.01 有用!谢谢!
Sadly,it doesn't work for me.same is 535.183.01. Until now ,I have tried almost all methods ,no one work for me.It's so terrible.
same with me - Gentoo fully up to date as of today. - I'm not able to go past over 535.183.01 or kernel 6.9. Terrible.
Fix also stopped working for me. Frustrating. @chanh2018 what do these changes do?
Fix also stopped working for me. Frustrating. @chanh2018 what do these changes do?
To preserve video memory for NVIDIA. It works for me.
After a completely new install of Ubuntu, which was needed as my NVME SSD WD 750 1TB completely died suddenly, I reinstalled 24.04 on a new Samsung 780 1TB. Most worked smoothly except the Suspend. Resume gave me a black screen with
DMAR: DRHD: handling fault status reg 2
DMAR: [INTR-REMAP] REquest device [fo:1f.0] fault index 0x0 [fault reason 0x25] Blocked compatibility format interrupt request
I just tried the following from @chanh2018 and I just got my first successful resume. 😀
sudo nano /etc/modprobe.d/nvidia-graphics-drivers-kms.conf
and add these lines into it:
options nvidia-drm fbdev=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/var/tmp
Note: the error messages still appear quickly on screen, but the system no longer hangs after that...
I also have Mint 22 based on ubuntu 24.04 and had the same problem. This solved the problem for me:
Any news on this? Recently my new Working Notebook with dedicated nvidia gpu worked fine (with Ubuntu 23.04 and proprietary nvidia drivers). But after some update of Kernel and/or nvidia drivers my Notebook didn't wake-up from sleep mode. It's still available by SSH! But monitors keep off/no-signal whatever I do.
It totally sucks as I have to reboot (REISUB-Reboot) my Workstation nearly every morning and every morning I'm praying monitors won''t keep blank giving me the chance just to start working.
Any solution that works? I've tried nearly everything and now I'm even trying to totally disable sleep/hibernate/standby stuff.
Btw. I have linux-kernel 6.8.0-101041(-tuxedo) and (ubuntu/dpkg) nvidia drivers 560.
apparently fix is going to be available in upcoming 565 linux driver release. NVIDIA/open-gpu-kernel-modules#662 (comment)
sudo nano /etc/modprobe.d/nvidia-graphics-drivers-kms.conf
and add these lines into it:
options nvidia-drm fbdev=1 options
nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/var/tmp
I can confirm this also fixes the resume from suspend problem for me:
Ubuntu 24.04, Nvidia Quadro M2000M, with the latest nvidia driver 560 and it works also on wayland
thank you @chanh2018!
For info. I'm on nvidia driver version 555.58.02
After a lot of trial, error and luck, I commented out the fbdev=1 line in the /etc/modprobe.d/nvidia-graphics-drivers-kms.conf file and resume started to work again. Oh and don't forget to sudo update-initramfs -u and reboot first of course......
options nvidia-drm modeset=1
#options nvidia-drm fbdev=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/var/tmp
I can confirm this also fixes the resume from suspend problem for me: Ubuntu 24.04, Nvidia Quadro M2000M, with the latest nvidia driver 560 and it works also on wayland
thank you @chanh2018!
it worked on Ubuntu 24.04 but broke again on 24.10 :-(
what fixed it for me again - for now - was
- Switching to the Nouveau driver in "Software & Updates" > Additional drivers
- and then purge all nvidia packages...
sudo apt --purge remove "*nvidia*"
This is my current setting and it's working for me (Linux Mint 22, Nvidia GeForce GTX 745 using Nvidia 550.107.02 driver)
sudo nano /etc/modprobe.d/nvidia-graphics-drivers-kms.conf
and add these lines into it:
options nvidia-drm fbdev=1 options nvidia NVreg_PreserveVideoMemoryAllocations=1 options nvidia NVreg_TemporaryFilePath=/var/tmp
Thanks!
Configuration: NVIDIA GeForce RTX™ 3050 Laptop GPU | Fedora 41 | Kernel GNU/Linux 6.11.7-300
As I've tried many things, I had to do a cleanup first.
sudo dnf remove \*nvidia\* --exclude nvidia-gpu-firmware
Check if the nouveau driver is disabled.. Follow up the section 2.6.
Install the nvidia drivers from RPM repository.
sudo dnf install akmod-nvidia
Remove nvidia sleep service.
sudo rm /lib/systemd/system-sleep/nvidia
For what I've been experienced, I think that what causes the problem is the "integration of all" and the nvidia sleep service.
Okay, clearing things up the issue has been resolved:
- Either use LTS kernel (6.6) or 6.12rc.
- Make sure to enable nvidia-suspend, nvidia-resume and nvidia-hibernate systemd services.
- Make sure you have fbdev and NVreg_PreserveVideoMemoryAllocations=1 (and /var/tmp path etc)
- Use nvidia open dkms 565 drivers.
As a side note, mind that a GNOME extension or another program may interfere with suspend by failing to release the /dev/nvidia
handle (you will see wait
requests sent by the driver to the shell in the logs). In my case it was the Vitals GNOME extension. Once I removed it, Ubuntu 24.04.1 suspends and resumes without any issues.
Okay, clearing things up the issue has been resolved:
- Either use LTS kernel (6.6) or 6.12rc.
- Make sure to enable nvidia-suspend, nvidia-resume and nvidia-hibernate systemd services.
- Make sure you have fbdev and NVreg_PreserveVideoMemoryAllocations=1 (and /var/tmp path etc)
- Use nvidia open dkms 565 drivers.
Finally! I had issues for a really long time, had been thru this topic several times but always failed and thus stayed with X11. Now, after upgrading to ubuntu 24.10 I had and additional reason why I needed wayland und installing the 6.12(.3) kernel fixed my problem. This kernel is not yet officially available for 24.10 but there is a decent way with this kernel maintainer's script.
This is my P500 GPU suspend error on Lenovo T580 with Linux t580 6.8.0-52-generic
running Driver Version: 570.86.15:
[ 570.725953] nvidia 0000:02:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x50 [nvidia] returns -5
[ 570.726746] nvidia 0000:02:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x1b0 returns -5
[ 570.726752] nvidia 0000:02:00.0: PM: failed to suspend async: error -5
[ 573.624219] PM: Some devices failed to suspend, or early wake event detected
[ 574.560997] nvidia 0000:02:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x50 [nvidia] returns -5
[ 574.561678] nvidia 0000:02:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x1b0 returns -5
[ 574.561684] nvidia 0000:02:00.0: PM: failed to suspend async: error -5
[ 574.824971] PM: Some devices failed to suspend, or early wake event detected
This is my P500 GPU suspend error on Lenovo T580 with
Linux t580 6.8.0-52-generic
running Driver Version: 570.86.15:[ 570.725953] nvidia 0000:02:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x50 [nvidia] returns -5 [ 570.726746] nvidia 0000:02:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x1b0 returns -5 [ 570.726752] nvidia 0000:02:00.0: PM: failed to suspend async: error -5 [ 573.624219] PM: Some devices failed to suspend, or early wake event detected [ 574.560997] nvidia 0000:02:00.0: PM: pci_pm_suspend(): nv_pmops_suspend+0x0/0x50 [nvidia] returns -5 [ 574.561678] nvidia 0000:02:00.0: PM: dpm_run_callback(): pci_pm_suspend+0x0/0x1b0 returns -5 [ 574.561684] nvidia 0000:02:00.0: PM: failed to suspend async: error -5 [ 574.824971] PM: Some devices failed to suspend, or early wake event detected
This is what helped me:
sudo systemctl unmask nvidia-suspend
sudo systemctl enable nvidia-suspend
sudo systemctl unmask nvidia-resume
sudo systemctl enable nvidia-resume
sudo systemctl unmask nvidia-hibernate
sudo systemctl enable nvidia-hibernate
Crossposting on Ask Ubuntu.
@dmikushin
Thanks, that worked for me. I have a 1080ti using driver version 570.86.15. This is on Fedora 41.
sudo systemctl unmask nvidia-suspend
sudo systemctl enable nvidia-suspend
sudo systemctl unmask nvidia-resume
sudo systemctl enable nvidia-resume
sudo systemctl unmask nvidia-hibernate
sudo systemctl enable nvidia-hibernate
Thanks! It worked on a Lenovo P1G7 with kubuntu 24.04 and Driver Version: 570.124.06 CUDA Version: 12.8
sudo systemctl unmask nvidia-suspend
sudo systemctl enable nvidia-suspend
sudo systemctl unmask nvidia-resume
sudo systemctl enable nvidia-resume
sudo systemctl unmask nvidia-hibernate
sudo systemctl enable nvidia-hibernate
Did not work for me. Using Ubuntu 24.10 and nvidia-driver-560.
As for the responses of tommyliu and pgbarletta, I am unsure whether they are helpful, because they are using driver 570, and the problem has been fixed starting from driver 565 according to ethan2009.
Also the disabling of the services and the editing of nvidia-sleep.sh suggested by bilallamal07 did not work for me.
Ubuntu 24.10 did allow me to choose the nvidia-driver-570-server, which solved the problem, probably because it contains the fix starting from driver 565.
For me on driver 535.216.03 and GeForce RTX 2070 Mobile / Max-Q the following services where located under /usr/lib/systemd/system/
:
- nvidia-hibernate.service
- nvidia-persistenced.service
- nvidia-resume.service
- nvidia-suspend.service
This meant taht I only had to enable them with
sudo systemctl enable nvidia-hibernate.service
sudo systemctl enable nvidia-persistenced.service
sudo systemctl enable nvidia-resume.service
sudo systemctl enable nvidia-suspend.service
This is my current setting and it's working for me (Linux Mint 22, Nvidia GeForce GTX 745 using Nvidia 550.107.02 driver)
sudo nano /etc/modprobe.d/nvidia-graphics-drivers-kms.conf
and add these lines into it:
options nvidia-drm fbdev=1 options nvidia NVreg_PreserveVideoMemoryAllocations=1 options nvidia NVreg_TemporaryFilePath=/var/tmp
This fixed my issues!
Laptop: Lenovo p16v Gen 1
System:
Kubuntu 24.04.2 LTS, noble
AMD Ryzen 7 7840HS w/ Radeon 780M Graphics
Nvidia rtx A500: Driver 570.133.07
Kernel: 6.11.0-24-generic
(Issue remaining: "unable to change power state from D3hot to D0")
I also tried the answer from dmikushin, but it didn't change anything!
sudo systemctl unmask nvidia-suspend sudo systemctl enable nvidia-suspend sudo systemctl unmask nvidia-resume sudo systemctl enable nvidia-resume sudo systemctl unmask nvidia-hibernate sudo systemctl enable nvidia-hibernate
This is my current setting and it's working for me (Linux Mint 22, Nvidia GeForce GTX 745 using Nvidia 550.107.02 driver)
sudo nano /etc/modprobe.d/nvidia-graphics-drivers-kms.conf
and add these lines into it:
options nvidia-drm fbdev=1
options nvidia NVreg_PreserveVideoMemoryAllocations=1
options nvidia NVreg_TemporaryFilePath=/var/tmp