Laptop unable to suspend

I think wuqso means the “Suspend” option located in the ‘Power Off/Log Out’ menu entry, not difficulty logging out or shutting down itself

Ah, yes, that might be so. I don’t see that menu (running KDE) and I never use the gui for such things. I read it as a misspelled “or”.

We’ll see if the OP is running intel or amd graphics I guess : )

I do have a Nvidia card. I created the file nvidia.conf as you suggested and now the system can be suspended. Thank you very much!

Glad to hear that too worked. If you wish you can ls the /usr/lib/modprobe.d/ dir, as mentioned in the thread I linked to a recent update either added or altered /usr/lib/modprobe.d/nvidia-power-management.conf so that it contained options nvidia NVreg_PreserveVideoMemoryAllocations=1 . To keep using the old nvidia power save mode I merely changed that to 0, I didn’t need to create a new config file.

In the end a suggestion in the thread made me lookup what this parameter does when the new power save mode is fully enabled and it preserves OpenCL for me in Darktable when the machine suspends. Merely changing the /usr/lib/modprobe.d/nvidia-power-management.conf param to 0 in order to keep using the old nvidia power save mode made suspend work but OpenCL was lost until relog if Darktable was running when the machine suspended.

Anyway, glad that your machine works either way.

Also fixed it for me. :+1:

Works like a charm on RTX 3070! Thanks for sharing!

Same issue here on ThinkPad t580 & Nvidia mx150. Your solution worked for me also.

BTW, what is the default behavior on laptop with two graphics card. It uses the Intel one unless I start an application with “launch with discrete graphics card”?

/usr/lib/modprobe.d/nvidia-power-management.conf doesn’t exist if one uses the nvidia drivers from rpmfusion (like i do), guess if you use the proprietary nvidia driver that file does exist and peeps better follow your suggestion to alter that file.

Yes
The IGP is the default, the discrete is for special needs.

Nippur: I am using the nvidia driver via rpmfusion. There’s just the one (proprietary) nvidia driver as far as I know. I installed it via

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fed 
ora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm 

sudo dnf install akmod-nvidia 

It seems the common consensus is that the update set

options nvidia NVreg_PreserveVideoMemoryAllocations=1

somewhere, in my case nvidia-power-management.conf.
Your post says where to set options nvidia NVreg_PreserveVideoMemoryAllocations=0 but not explicitly where options nvidia NVreg_PreserveVideoMemoryAllocations=1 is found…so where was that set for everyone but my machine? In what config file, /etc/modprobe.d/nvidia.conf ? I only saw the gentoo bug thread referring to that https://bugs.gentoo.org/763129
, others are referring to Occassional failure to resume: pci_pm_suspend(): nv_pmops_suspend+0x0/0x20 [nvidia] returns -5 - Linux - NVIDIA Developer Forums

nvidia-power-management.conf …at least for setting the variable.

I checked my terminal’s history just in case I had a mild case of amnesia and forgot that I made that file …(which would be weird since I found the gentoo bug and looked for the param and found it there but anyway) …but it went update, suspend, and then look for the param, where the first reference to nvidia-power-management.conf was to cat its contents.

So I don’t know whether you and everyone else in this thread have that file too and that the file you advice to create/edit overrides it or whether my machine is the only one who has that file. That feels wrong though since I installed via rpmfusion and there’s just the one proprietary nvidia driver afaik and the problem, very much echoed over the internet, is that the options nvidia NVreg_PreserveVideoMemoryAllocations=1 is set and it has to be set in a config file.

(I don’t want to argue or anything like that I’d just like to think the bug affected most people on fedora with the propriatery nvidia driver the same and would like to get to the bottom of it :slight_smile: )

For all i know you can put all the options in /etc/modprobe.d/ in only one file. The fact one puts them in different files is just for our convenience.
So having a module option put in a different named file doesn’t matter, as long you don’t contradict (same option set in different files with different values). See man modprobe.d on your system.

So your options nvidia NVreg_PreserveVideoMemoryAllocations=1 line must be somewhere in a *.conf file located in /etc/modprobe.d/

1 Like

Good point, this also should survive future updates better.

Good suggestion.

Yeah. You mentioned nvidia-power-management.conf doesn’t exist for …and I’m still not certain what propietary nvidia driver or method your are referring to.

I don’t know that or whether the mentioned file does exist on other machines (I have no reason to believe it doesn’t); or indeed where the parameter line appeared on your machine after the update.

It doesn’t look as if this thread will provide answers, people are happy to create a new file and keep on using the old way to powersave nvidia cards. I’m merely glad I learnt about the new way as it has practical implications for me (and everyone else who likes to keep CUDA or OpenCL apps running when suspending their machine).

Peace out

I had the same problem, I fixed it just by activating the nvidia-suspend service.

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

This is describe in nvidia documentation Chapter 21. Configuring Power Management Support

1 Like

well, the real proprietary nvidia drivers are found here: https://www.nvidia.com/Download/Find.aspx?lang=en-us; but i always use the rpms found at rpmfusion.

lol, i didn’t know i had those services (install on this hard drive dates back to F18 = pre-systemd); i 'll check them out and shall use these if they work as you say, Jérémie, tyvm.

The nvidia driver is proprietary. There isn’t a less proprietary driver and a more proprietary nvidia driver unless you referring to noveau. There are different ways of installing it.

[/quote]lol, i didn’t know i had those services (install on this hard drive dates back to F18 = pre-systemd); i 'll check them out and shall use these if they work as you say, Jérémie, tyvm.[quote]

I did mention them in my first post.

1 Like

Partly true. Rpmfusion makes those drivers available for .rpm based linux flavours only, esp. Fedora. The “real” nvidia drivers I mentioned are general and to be used by every Linux flavour using nvidia cards.

Funny thing is, I didn’t had those files on my system at that time, later on I thought I just didn’t searched well enough because suddenly I had (at the time of that quoted post), today however they are gone again (??), probably because I had an update of xorg-x11-drv-nvidia c.s. yesterday (just guessing here).
Suspend doesnt work today (I get a Failed to enable unit: Unit file nvidia-suspend.service does not exist when i try to enable the service; when i do a locate nvidia-suspend.service I get a /usr/lib/systemd/system/nvidia-suspend.service as (former) location, but after manually updating the locate database I do get /etc/systemd/system/systemd-suspend.service.requires/nvidia-suspend.service as location (which is a dead link to /usr/lib/systemd/system/nvidia-suspend.service).

Falling back to line in /etc/modprobe.d/nvidia.conf as mentioned above is still the best solution for me.

Yesh, there are most like several benefits of the experimental nvidia systemd way but if you aren’t aware or feel the need of any of them then whatever as long as the machine suspends and wakes okay, I think.

Hahahaha I had just gotten suspend and wake to work better than ever (OpenCL remained when machine awoke after being suspended) (via the experimental nvidia systemd way ) and after today’s update swoosh no more /usr/lib/modprobe.d/nvidia-power-management.conf (no /etc/modprobe.d/nvidia* either) and dead links to missing nvidia-suspend.service and company.
The machine refused to suspend. Fannastic.

I went to toss the nvidia card in a lake but now is perhaps not the best time… so I created nvidia.conf and nvidia-power-management.conf in the two modprobe.d folders mentioned above with options nvidia NVreg_PreserveVideoMemoryAllocations=0 and rebooted four times, one for each, and the machine failed to suspend throughout. I tried the same with just NVreg_PreserveVideoMemoryAllocations=0 - nope.

sep 03 18:08:10 feds systemd-logind[11624]: Error during inhibitor-delayed operation (already returned success to client): Unit nvidia-resume.service not found. sep 03 18:08:10 feds baloorunner[12538]: The X11 connection broke (error 1). Did the X11 server die? No, just my hope of a great weekend… or something. So anyway I removed the four nvidia*.conf files, followed Howto/NVIDIA - RPM Fusion and reinstalled xorg-x11-drv-nvidia-power and reenabled the now existing three nvidia systemd services and rebooted and there still isn’t a nvidia.conf, not in /usr/lib and not in /etc , but my old friend nvidia-power-management.conf was in /usr/lib/(modprobe.d) and now suspend works, with OpenCL still available upon wakeup if in use when suspended.

Huzzah, and don’t we lead interesting lives with linux and the nvidia driver :slight_smile:

Same as you, I followed Howto/NVIDIA - RPM Fusion and now all rework correctly.
Thank you both !