Public bug reported:

[ Impact ]

With HDR (BT.2100) enabled, gnome-shell leaks GPU memory every time the
monitor reconnects. A reconnect happens when the monitor wakes from deep
standby or is power-cycled, i.e. it is a DP hotplug. The memory is only
freed by logging out. On my system gnome-shell reached 4.3 GiB of VRAM
after ~31 h (19 monitor reconnects), and over 5 GiB during testing.

Both causes are fixed upstream in mutter 50.5 (gnome-50 branch). Neither
fix is in 50.1-0ubuntu2.5:

1. clutter/stage-view: Fix offscreen pipeline leak
   gnome-50: 36174d283 (main: cccc430b3500a79678c50f41191911b3e856ccdd)
   https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5235
   `ensure_stage_view_offscreen_pipeline()` leaks a reference to the offscreen 
pipeline, which holds the view's offscreen texture. With HDR the view renders 
through an FP16 offscreen, so every view rebuild leaks one 3840x2160 FP16 
texture (~64 MiB). Regression from 40eb77cb9 (50.beta), so it affects 50.1.

2. renderer/native: Don't keep around detached onscreens in power saving
   gnome-50: af0c9808d (main: af926cffa0702d1fbd0f2b87f9adbfcb8be0e9f6)
   https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5285
   Closes upstream #4101 and #5008: the detached_onscreens list (and its 
scanout buffers) grows without limit on hotplug during power saving.

Both patches are small (1 and 17 lines) and apply cleanly to 50.1 (`git
apply --check`, only line offsets).

Upstream report with full measurements:
https://gitlab.gnome.org/GNOME/mutter/-/work_items/5220

[ Test Plan ]

1. Wayland session, a 4K monitor on DisplayPort, Settings → Displays → Color 
mode: HDR.
2. Measure gnome-shell VRAM (amdgpu): sum `drm-total-vram` over unique 
`drm-client-id` in `/proc/$(pgrep -x gnome-shell)/fdinfo/*`.
3. Switch the monitor off with its power button, wait ~15 s, switch it on. Wait 
1 min, measure again. Repeat 3 times.
4. Without the fix, VRAM grows ~60-140 MiB per cycle and is never released. 
With the fix, it should stay flat (as it already does with HDR off).

Measured on 50.1-0ubuntu2.5, from attached logs at 15 s resolution:
- HDR on, reconnect: +142, +63, +307 MiB (the third coincided with a session 
unlock; the increase was still allocated >90 s later)
- HDR on, all extensions disabled: +276 MiB over 2 cycles
- HDR off, reconnect: -7, +9 MiB (flat)
- HDR on, DPMS off/on without disconnect, or lock/unlock: flat

[ Where problems could occur ]

- Fix 1 changes reference handling of the stage view offscreen pipeline. A 
mistake would show up as rendering problems or crashes on outputs that use an 
offscreen (HDR, rotated or transformed monitors, some fractional-scale setups), 
especially after monitor changes.
- Fix 2 changes when detached onscreens are released around power-save 
transitions. A mistake could show up as flicker, a black screen or a crash when 
monitors are hotplugged while in power save, or on resume from DPMS.
- Both have been in upstream stable 50.5/50.6 since September/October 2026.

[ Other Info ]

- Ubuntu 26.04.1 LTS, mutter 50.1-0ubuntu2.5, gnome-shell 50.1-0ubuntu1.5, 
kernel 7.0.0-43-generic
- AMD Radeon RX 7900 XTX (amdgpu), Mesa 26.1.7 (kisak PPA)
- LG UltraFine 4K over DisplayPort, 3840x2160 @ 120 Hz, scale 1.25, HDR 
(BT.2100)
- gnome-shell's GEM objects after ~31 h: 35 × 64 MiB (4K FP16) and 19 × 34 MiB 
(4K scanout) buffers, total 4.3 GiB
- Workaround: disable HDR, or disable the monitor's deep standby

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: mutter (not installed)
ProcVersionSignature: Ubuntu 7.0.0-43.43-generic 7.0.14
Uname: Linux 7.0.0-43-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Mon Nov 16 21:54:36 2026
InstallationDate: Installed on 2026-04-28 (202 days ago)
InstallationMedia: Ubuntu 24.04.4 LTS "Noble Numbat" - Release amd64 (20260210)
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
RebootRequiredPkgs: Error: path contained symlinks.
SourcePackage: mutter
UpgradeStatus: Upgraded to resolute on 2026-08-26 (83 days ago)

** Affects: mutter (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute

** Attachment added: "Logs with the measurements."
   
https://bugs.launchpad.net/bugs/2174664/+attachment/6018648/+files/vram-logs.tar.gz

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

Title:
  Title: gnome-shell leaks VRAM (~64-140 MiB) on every monitor reconnect
  with HDR enabled - please backport upstream fixes from mutter 50.5

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2174664/+subscriptions


-- 
desktop-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/desktop-bugs

Reply via email to