Host-memory leak in Wayland explicit-sync present path (eglgears_wayland repro, RTX 5080 / 610.43.02)

Host-memory leak in the Wayland explicit-sync present path (RTX 5080 / 610.43.02)

Summary

On Wayland, any GL client that presents continuously leaks host (CPU) RSS at a fixed rate of ~2 MiB/min as long as explicit sync (linux-drm-syncobj-v1) is in use. Setting __NV_DISABLE_EXPLICIT_SYNC=1 (falling back to implicit sync) eliminates the growth entirely. The leak is reproducible with the stock Mesa eglgears_wayland demo — no application code required — and the rate is independent of window size, which points to per-present sync-fence tracking inside libEGL_nvidia/libnvidia-eglcore.

This appears to be a host-memory variant of the explicit-sync resource leak tracked as bug 5352012 / 5556719 (which is documented as a sync_file file-descriptor leak). In this case fd count stays flat and host RSS grows instead.

Environment

  • GPU: NVIDIA GeForce RTX 5080
  • Driver: 610.43.02, NVIDIA Open Kernel Module (build Thu May 28 2026)
  • Kernel: 7.0.10-2-cachyos (x86_64)
  • Compositor: Hyprland 0.55.2 (Wayland), linux-drm-syncobj-v1 advertised
  • EGL external platform: egl-wayland2 1.0.2 (libnvidia-egl-wayland2.so.1.0.2; also reproduced on a build from main @ commit 8feda53, which includes the recent frame-callback / dmabuf-leak fixes — they do not resolve this)
  • wayland 1.25.0, wayland-protocols 1.48, mesa-utils 9.0.0 (for eglgears_wayland)

Minimal reproduction (no application code)

# 1. Leaks: stock Mesa EGL/Wayland demo, continuous eglSwapBuffers, explicit sync ON (default)
eglgears_wayland &
pid=$!
while kill -0 $pid 2>/dev/null; do grep -H VmRSS /proc/$pid/status; sleep 30; done
# RssAnon climbs ~2 MiB/min, indefinitely.

# 2. Does NOT leak: identical run with explicit sync disabled
__NV_DISABLE_EXPLICIT_SYNC=1 eglgears_wayland &
# RssAnon flat.

Measured evidence (RssAnon, kB)

eglgears_wayland (tiny window):

t (s) explicit sync ON __NV_DISABLE_EXPLICIT_SYNC=1
30 39,152 26,072
90 40,896 26,072
150 43,068 26,072
180 44,160 26,072
slope +2.0 MiB/min (linear) 0 (flat)

A full desktop-shell client (continuous 144 fps) leaks at ~2.4 MiB/min with the same on/off behavior — i.e. the per-present cost is essentially constant regardless of draw size/complexity.

Characterization (what it is and isn’t)

  • Not file descriptors: fd count is flat throughout (distinguishes it from the documented sync_file FD leak).
  • Not the application’s heap: under a jemalloc heap profiler, live malloc grew only ~1.5 MB while process RSS grew ~10 MB over the same window — i.e. the growth is anonymous memory mapped outside malloc (driver-internal mmap), invisible to the app allocator.
  • Not allocator retention: unaffected by background_thread:true and by dirty_decay_ms:0,muzzy_decay_ms:0 (immediate page return). The pages are not reclaimable because they are not freed.
  • Not the EGL platform’s own bookkeeping: egl-wayland2’s protocol objects (frame callback / presentation-feedback / sync) are bounded at swap interval 0, and its syncobj/fence handles don’t leak (fd flat).
  • Not the compositor: Hyprland (DRM/KMS present path) shows zero RSS growth over ~2 h.
  • Triggered purely by explicit-sync present volume: scales with present count; a silent/static client does not grow.

Conclusion: a fixed-size host allocation per present in the explicit-sync (linux-drm-syncobj) path of the closed driver that is never released for the lifetime of the wl_display/EGL surface.

Workaround

__NV_DISABLE_EXPLICIT_SYNC=1 (per-app or session-wide). Eliminates the leak; falls back to implicit sync.

Request

Please confirm whether this host-memory leak is the same root cause as bug 5352012 / 5556719 or a separate defect, and whether a fix is targeted for an upcoming 610.x / production driver.

nvidia-bug-report.log.gz (496.4 KB)

1 Like