Preserving memory allocation with Nvidia and suspend

Hello, everyone.

I’m trying to fix the issue where the Wayland session comes back from suspend with a broken screen when using the Nvidia proprietary drivers. For that I came up with the article on the wiki that seems to point towards a solution but with no success.

I did create a file on /etc/modprobe.d/nvidia-power-management.conf with

options nvidia NVreg_PreserveVideoMemoryAllocations=1 NVreg_TemporaryFilePath=/var/tmp

as pointed out by the article, and enabled both the nvidia-suspend and nvidia-resume services, but still no dice.

I guess I didn’t understand how am I supposed to deal with this temporary file, because from what I’ve seen from other posts, this should fix it.

I am using all the latest drivers and kernels, and I’m on a desktop with a Nvidia RTX 2070 card, so no hybrid graphics.

What I’m doing wrong here?

Hi,

It looks like you are doing nothing wrong :slight_smile:

How much video memory do you have on your graphics card? Do you have enough free space on the partition where the /var/tmp is located? What filesystem are you using there?

Can you show the output of this

glxinfo -B | grep -i memory

and this command

df -hT

Have you checked if your kernel module is loaded with correct params

sudo systool -m nvidia -av

Can you provide some more details from logs, for example

journalctl -b -0 --grep=nvidia --no-hostname
1 Like

Hello!

So it turns out I don’t have enough space inside of /var/tmp for that, huh. I was counting with the whole root filesystem as available space :sweat_smile:

The output of

glxinfo -B | grep -i memory

is

Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 8192 MB
    Total available memory: 8192 MB
    Currently available dedicated video memory: 7603 MB

df -hT

Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  4.0M     0  4.0M   0% /dev
tmpfs          tmpfs     7.8G  252M  7.6G   4% /dev/shm
tmpfs          tmpfs     3.2G  1.9M  3.2G   1% /run
/dev/nvme0n1p7 xfs       103G   24G   80G  23% /
tmpfs          tmpfs     7.8G  9.3M  7.8G   1% /tmp
tmpfs          tmpfs     1.6G  120K  1.6G   1% /run/user/1000

For the Nvidia kernel modules I had to enable the usual

nvidia nvidia_modeset nvidia_uvm nvidia_drm

inside of /etc/dracut.conf to even have the Wayland session available on gdm, however df -hT only shows the nvidia kernel module enabled… I have also enabled nvidia-drm.modeset=1and NVreg_PreserveVideoMemoryAllocations=1 inside of /etc/kernel/cmdline but I don’t remember if I was supposed to do that. I’m used to edit mkinitcipio.conf and actually just used dracut and systemd-boot for the first time this week for my recent install. There might be some problem here as well.

Just for further reference if someone ever stumble upon this with the same issue, I fixed it.

Besides the steps above I was missing both additional steps:

  • Increase the size of /var/tmp.

  • Include the kernel modules properly.

In my case, I’m just using dracut and systemd-boot as defaults, so according to this and this article I created a file under /etc/dracut.conf.d/ named nvidia.conf with the options

force_drivers+=" nvidia nvidia_modeset nvidia_uvm nvidia_drm "

then regenerated the initrd.

I haven’t tested this with mkinitcpio but I guess if the /var/tmp partition was big enough it would be enough to just pass the Nvidia modules above as usual.

Thank you @jake99 for the tips and help!

2 Likes

http://us.download.nvidia.com/XFree86/Linux-x86_64/470.63.01/README/powermanagement.html#Backgroundc73a7

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.