NVreg_PreserveVideoMemoryAllocations behaves well with the 570 driver
and kernel 6.14 as in plucky.

Because it works by dumping the allocated memory to a filesystem, here
are the edge case scenarios to consider:

1) If NVreg_TemporaryFilePath points to disk-backed storage and the free
space on the filesystem is not enough to hold the entirety of the GPU
memory used, unpon resume the nvidia-drm driver fails with:

nvidia-modeset: ERROR: GPU:0: Failed to bind display engine notify surface 
descriptor: 0x1a (Ran out of a critical resource, other than memory 
[NV_ERR_INSUFFICIENT_RESOURCES])
nvidia-modeset: ERROR: GPU:0: Failed to allocate display engine core DMA push 
buffer
nvidia-modeset: ERROR: GPU:0: Failed to bind display engine notify surface 
descriptor: 0x1a (Ran out of a critical resource, other than memory 
[NV_ERR_INSUFFICIENT_RESOURCES])
nvidia-modeset: ERROR: GPU:0: Failed to allocate display engine core DMA push 
buffer
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state
[drm:__nv_drm_connector_detect_internal [nvidia_drm]] *ERROR* [nvidia-drm] [GPU 
ID 0x00002900] Failed to detect display state


2) If NVreg_TemporaryFilePath points to tmpfs and the free space on the 
filesystem is not enough, unpon resume we're presented with the same issue as 
(1). This is solvable by creating an ad-hoc tmpfs that is guaranteed to be as 
big as the sum of all NVIDIA GPUs' memory, but then we might enter issue (3).


3) If NVreg_TemporaryFilePath points to tmpfs and the free system memory+swap 
space is not enough, the system hangs while trying to enter sleep and the only 
option is to force reboot.


For desktop users this is arguably not much worse than the status quo.
However, for laptop users (where the primary GPU is the integrated one) 
enabling NVreg_PreserveVideoMemoryAllocations risks worsening the experience if 
they hit the analyzed edge case scenarios.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to mutter in Ubuntu.
https://bugs.launchpad.net/bugs/1876632

Title:
  [nvidia] Corrupted/missing textures when switching users, switching
  VTs or resuming from suspend

Status in GNOME Shell:
  New
Status in Mutter:
  Fix Released
Status in OEM Priority Project:
  Confirmed
Status in Release Notes for Ubuntu:
  Fix Released
Status in gnome-shell package in Ubuntu:
  Triaged
Status in gtk4 package in Ubuntu:
  Confirmed
Status in mutter package in Ubuntu:
  Triaged
Status in nvidia-graphics-drivers-440 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-460 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-470 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-510 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-525 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-535 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-550 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-560 package in Ubuntu:
  Won't Fix
Status in nvidia-graphics-drivers-570 package in Ubuntu:
  In Progress

Bug description:
  [Impact]

  The Nvidia driver corrupts and/or forgets its textures when resuming
  from suspend, by design. Documented here:

  
https://www.khronos.org/registry/OpenGL/extensions/NV/NV_robustness_video_memory_purge.txt

  *NOTE* that this is actually not a common problem because the system
  must be using Nvidia as the primary GPU to be affected. So generally
  only desktop users will encounter the bug, not laptops. And even then,
  only desktops that use suspend/resume or VT switching may trigger it,
  if ever.

  [Workarounds]

  * Always log into a Xorg session and if corruption occurs then type:
  Alt+F2, R, Enter

  *
  
https://download.nvidia.com/XFree86/Linux-x86_64/510.54/README/powermanagement.html#PreserveAllVide719f0

  [Test Plan]

  [Where problems could occur]

  [Original Bug Report]

  I recently installed ubuntu 20.04 on my computer, and I am running
  into an issue when I do the following:

  * Login with a user on desktop
  * Select switch user, and login as second user
  * Switch user again, and return to original user

  At this point, text and icons in the menubar / sidebar are corrupted.
  Text and icons in normal windows appear correctly. I have attached a
  screenshot of what this looks like.

  Screenshots: https://imgur.com/a/3ZFDLMc

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: xorg 1:7.7+19ubuntu14
  ProcVersionSignature: Ubuntu 5.4.0-28.32-generic 5.4.30
  Uname: Linux 5.4.0-28-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  .proc.driver.nvidia.gpus.0000.09.00.0: Error: [Errno 21] Is a directory: 
'/proc/driver/nvidia/gpus/0000:09:00.0'
  .proc.driver.nvidia.registry: Binary: ""
  .proc.driver.nvidia.suspend: suspend hibernate resume
  .proc.driver.nvidia.suspend_depth: default modeset uvm
  .proc.driver.nvidia.version:
   NVRM version: NVIDIA UNIX x86_64 Kernel Module  440.64  Fri Feb 21 01:17:26 
UTC 2020
   GCC version:
  ApportVersion: 2.20.11-0ubuntu27
  Architecture: amd64
  BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
  CasperMD5CheckResult: skip
  CompositorRunning: None
  CurrentDesktop: ubuntu:GNOME
  Date: Sun May  3 18:12:45 2020
  DistUpgraded: Fresh install
  DistroCodename: focal
  DistroVariant: ubuntu
  ExtraDebuggingInterest: Yes
  GraphicsCard:
   NVIDIA Corporation GP104 [GeForce GTX 1070] [10de:1b81] (rev a1) (prog-if 00 
[VGA controller])
     Subsystem: ASUSTeK Computer Inc. GP104 [GeForce GTX 1070] [1043:85a0]
  InstallationDate: Installed on 2020-05-03 (0 days ago)
  InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
  MachineType: Gigabyte Technology Co., Ltd. AX370-Gaming
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.4.0-28-generic 
root=/dev/mapper/vgubuntu-root ro quiet splash vt.handoff=7
  SourcePackage: xorg
  Symptom: display
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 06/19/2017
  dmi.bios.vendor: American Megatrends Inc.
  dmi.bios.version: F3
  dmi.board.asset.tag: Default string
  dmi.board.name: AX370-Gaming-CF
  dmi.board.vendor: Gigabyte Technology Co., Ltd.
  dmi.board.version: se1
  dmi.chassis.asset.tag: Default string
  dmi.chassis.type: 3
  dmi.chassis.vendor: Default string
  dmi.chassis.version: Default string
  dmi.modalias: 
dmi:bvnAmericanMegatrendsInc.:bvrF3:bd06/19/2017:svnGigabyteTechnologyCo.,Ltd.:pnAX370-Gaming:pvrDefaultstring:rvnGigabyteTechnologyCo.,Ltd.:rnAX370-Gaming-CF:rvrse1:cvnDefaultstring:ct3:cvrDefaultstring:
  dmi.product.family: Default string
  dmi.product.name: AX370-Gaming
  dmi.product.sku: Default string
  dmi.product.version: Default string
  dmi.sys.vendor: Gigabyte Technology Co., Ltd.
  version.compiz: compiz N/A
  version.libdrm2: libdrm2 2.4.101-2
  version.libgl1-mesa-dri: libgl1-mesa-dri 20.0.4-2ubuntu1
  version.libgl1-mesa-glx: libgl1-mesa-glx 20.0.4-2ubuntu1
  version.nvidia-graphics-drivers: nvidia-graphics-drivers-* N/A
  version.xserver-xorg-core: xserver-xorg-core 2:1.20.8-2ubuntu2
  version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
  version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-1
  version.xserver-xorg-video-intel: xserver-xorg-video-intel 
2:2.99.917+git20200226-1
  version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.16-1

To manage notifications about this bug go to:
https://bugs.launchpad.net/gnome-shell/+bug/1876632/+subscriptions


-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to