NVreg_PreserveVideoMemoryAllocations=1 should be the default

Bug #2052597 reported by Tom Cook
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-535 (Ubuntu)
New
Undecided
Unassigned

Bug Description

As far as I can tell, any system with an NVIDIA graphics card won't resume from sleep correctly when running mantic unless the NVIDIA driver has the option `NVreg_PreserveVideoMemoryAllocations=1` set. This is because by default most video memory allocations are not preserved on suspend and the user space needs to handle the case where (from the application's point of view) they suddenly and mysteriously go missing.

The GNOME shell fails to do this and fails fairly spectacularly. This results in a wide variety of visual defects but leaves the system unusable.

The suggested option works around this by making the driver write video memory out to file while suspending and restoring video memory from file when resuming. It's important that the path where this temporary file is written out has enough free space to hold all of video memory; on mantic, `/tmp` (the default) seems appropriate as it is not a ramfs but this could be configured elsewhere.

While there are obviously cases where this behaviour is not desired (mainly where GPUs are used for non-display purposes), it seems likely that in the vast majority of cases where such a GPU is present and the system is regularly put into a sleep state that the GPU will be used for display and not as a GPGPU. Systems that are put into sleep states tend to be portables, where the GPU is primarily for display; systems used for GPGPU tend not to be portable and are not usually put into sleep states where the GPU is shut down. Obviously these are generalisations, but they are _generally_ true. It's also likely that users doing GPGPU will already have to go and reconfigure their systems for optimal performance whereas desktop users generally expect the system to work correctly out of the box. I'm a long-term Ubuntu user and software engineer and it took me a couple of weeks to figure out that suspend isn't broken on my new laptop, I just need to set GPU driver options; the chances of a normal user figuring this out are slim.

I'd suggest that putting the option in /etc/modprobe.d/nvidia-graphics-drivers-kms.conf is likely to be the right way to achieve this.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 23.10
Release: 23.10
Codename: mantic

$ apt-cache policy nvidia-kernel-common-535
nvidia-kernel-common-535:
  Installed: 535.154.05-0ubuntu0.23.10.1
  Candidate: 535.154.05-0ubuntu0.23.10.1
  Version table:
 *** 535.154.05-0ubuntu0.23.10.1 500
        500 http://gb.archive.ubuntu.com/ubuntu mantic-updates/restricted amd64 Packages
        500 http://security.ubuntu.com/ubuntu mantic-security/restricted amd64 Packages
        100 /var/lib/dpkg/status
     535.113.01-0ubuntu3 500
        500 http://gb.archive.ubuntu.com/ubuntu mantic/rest

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.