Skip to content

fix: keep DMA-BUF renderer on Wayland + NVIDIA, disable explicit sync - #315

Merged
kipavy merged 1 commit into
devfrom
fix/224-nvidia-explicit-sync
Sep 18, 2026
Merged

kipavy merged 1 commit into
devfrom
fix/224-nvidia-explicit-sync

Conversation

@kipavy

@kipavy kipavy commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Refs #224. Complements #313, which is still needed.

What

When linux_gfx.rs detects NVIDIA on a native Wayland session, it now sets __NV_DISABLE_EXPLICIT_SYNC=1 and leaves WebKit's DMA-BUF renderer on. Before, it set WEBKIT_DISABLE_DMABUF_RENDERER=1.

Everything else is unchanged:

  • X11 + NVIDIA still disables DMA-BUF.
  • AppImages still disable DMA-BUF. Their bundled GTK hook exports GDK_BACKEND=x11, so they always run on X11.
  • Non-NVIDIA systems are not affected.
  • Env vars set by the user still win, and VOLTIUS_NO_LINUX_GFX_WORKAROUNDS=1 still turns everything off.
  • If the user explicitly sets __NV_DISABLE_EXPLICIT_SYNC to 0 or to an empty value, DMA-BUF is disabled as before.

Why

On Wayland + NVIDIA, the DMA-BUF renderer fails because the compositor raises a protocol error and disconnects the app:
wp_linux_drm_syncobj_surface_v1 error 4, "explicit sync is used, but no acquire point is set".
NVIDIA's egl-wayland turns on explicit sync for the GTK toplevel surface. GTK then commits a wl_shm buffer to that same surface without an acquire point. Upstream bug: https://bugs.webkit.org/show_bug.cgi?id=324551

The fallback renderer (DMA-BUF off) shows WebGL canvases one frame late (https://bugs.webkit.org/show_bug.cgi?id=324549). That caused the ~0.6 s terminal echo lag in #224. With explicit sync disabled, the DMA-BUF renderer works and WebGL frames appear on time.

Testing

Tested on an RTX 5070 with driver 610.57.04, KDE Plasma 6.7.4 and webkit2gtk-4.1 2.52.6.

Config Result
Wayland, DMA-BUF off (current dev) ~0.5 s echo lag; with cursor blink off, each key shows the previous character
Wayland, DMA-BUF on, no env var App exits with the protocol error above
Wayland, DMA-BUF on + __NV_DISABLE_EXPLICIT_SYNC=1 Renders correctly, instant echo even without #313, no protocol error in WAYLAND_DEBUG
X11, DMA-BUF on + the env var Blank page ("Failed to create GBM buffer"), so DMA-BUF stays off on X11
X11, DMA-BUF off Echo 559–640 ms on dev, 22–34 ms with #313 (measured by injecting keys and polling screen pixels)
  • Wayland latency was checked by eye; there's no pixel-polling probe for Wayland.
  • Resizing, maximizing and switching between terminal tabs all looked fine.
  • CPU use was lower with the env var than with DMA-BUF off:
    • Idle, app + web process: ~1% vs ~8–9%.
    • seq 1 1000000 drains in 2.3 s vs 2.8 s.
    • I don't know why.
  • Using the new binary with no env overrides: the web process gets __NV_DISABLE_EXPLICIT_SYNC=1 and DMA-BUF stays on. GDK_BACKEND=x11 and a user-set WEBKIT_DISABLE_DMABUF_RENDERER=1 still turn DMA-BUF off.
  • New unit tests for the decision logic and for GDK_BACKEND parsing.
  • cargo fmt, cargo clippy --all-targets, cargo build, cargo test for linux_gfx (8/8) and pnpm run build all pass.

#313 is still needed for X11 + NVIDIA, for all AppImage users, and for anyone who sets WEBKIT_DISABLE_DMABUF_RENDERER=1 themselves.

🤖 Generated with Claude Code

On native Wayland with the NVIDIA driver, WebKitGTK's DMA-BUF renderer
dies with a wp_linux_drm_syncobj_surface_v1 "no acquire point" protocol
error, so we disabled DMA-BUF there. The fallback path presents WebGL
canvases one frame late (#224). Setting __NV_DISABLE_EXPLICIT_SYNC=1
avoids the protocol error and keeps DMA-BUF, which renders on time.

X11 + NVIDIA and AppImages (forced to X11 by the GTK hook) still disable
DMA-BUF, which shows a blank page there. User-set env vars still win; an
explicit __NV_DISABLE_EXPLICIT_SYNC of "0" or "" falls back to disabling
DMA-BUF.
@kipavy
kipavy merged commit 367d741 into dev Sep 18, 2026
4 checks passed
@kipavy
kipavy deleted the fix/224-nvidia-explicit-sync branch September 18, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant