Laptop unable to suspend

Closing the lid or clicking the ‘Suspend’ of ‘Power Off/Log Out’ just makes the screen dark for about 2 seconds and then the screen brightens again into screen lock state.

I’m using F34 now and the system is fully updated. The laptop has been used for more than 3 years and various versions of Fedora have been installed on it. This is the first time I found this problem.

1 Like

BTW, the problem appeared just recently, maybe after a system updating.

If you use nvidia, you might be helped by adding the line

options nvidia NVreg_PreserveVideoMemoryAllocations=0

to the file /etc/modprobe.d/nvidia.conf (create file if it doesnt exist yet). Then reboot. This solved the same issue for me.

You might want to create a new initrd file aswell by running (as root or sudo) # dracut -f

My /etc/modprobe.d/nvidia.conf looks like this by the way:

# Enable DynamicPwerManagement
# http://download.nvidia.com/XFree86/Linux-x86_64/440.31/README/dynamicpowermanagement.html
options nvidia NVreg_DynamicPowerManagement=0x02
options nvidia_drm modeset=1
options nvidia NVreg_PreserveVideoMemoryAllocations=0

first line has to do with backlight ajustment during boot
second line shall take care of a nice plymouth boot after sequence ‘kernel update - reboot (broken plymouth animations) - # dracut -f (new initrd file with restored plymouth animation)’
third line solved my hibernation & suspend issue that suddenly occured after an update this week

Maybe it works for you too; i have read it is a nvidia issue (just passing the solution, credits to others)

4 Likes

I encountered the nvidia suspend issue too and there seems to be two ways of dealing with it(fully enable the experimental power management or fully disable it, the update enables PreserveVideoMemoryAllocations but doesn’t enable the three nvidia systemd services that are needed for that option), detailed in Fedora 34 KDE unable to suspend after nvidia driver update - #5 by lampahojd . What to do depends on your OpenCL/CUDA usage.

This does assume your machine has a nvidia graphics card though and it has nothing that I know of to do with being unable to power off or log out of the machine :slight_smile:

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.