Skip to content

fix(linux): disable WebKit DMA-BUF renderer to prevent Wayland crash#474

Open
Charlisim wants to merge 2 commits into
mountain-loop:mainfrom
Charlisim:fix/wayland-webkit-dmabuf-crash
Open

fix(linux): disable WebKit DMA-BUF renderer to prevent Wayland crash#474
Charlisim wants to merge 2 commits into
mountain-loop:mainfrom
Charlisim:fix/wayland-webkit-dmabuf-crash

Conversation

@Charlisim

@Charlisim Charlisim commented Jun 16, 2026

Copy link
Copy Markdown

Summary

On Nvidia GPUs running Wayland, WebKit2GTK's DMA-BUF renderer triggers a protocol error (71) due to an explicit sync conflict between WebKit's ANGLE implementation and Nvidia's egl-wayland library. This sets `__NV_DISABLE_EXPLICIT_SYNC=1` only when Nvidia drivers are active and a Wayland display is present, avoiding the crash without disabling hardware acceleration.

Submission

  • This PR is a bug fix or small-scope improvement.
  • If this PR is not a bug fix or small-scope improvement, I linked an approved feedback item below.
  • I have read and followed CONTRIBUTING.md.
  • I tested this change locally.
  • I added or updated tests when reasonable.

Approved feedback item (required if not a bug fix or small-scope improvement):

Related

WebKit upstream bug: https://bugs.webkit.org/show_bug.cgi?id=280210

…ol error

WebKit2GTK's DMA-BUF renderer causes a protocol error (71) on some Wayland
compositors (e.g. Hyprland), crashing the app on startup. Fall back to SHM
rendering by default; users can opt back in by setting the variable themselves.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@gschier

gschier commented Jun 17, 2026

Copy link
Copy Markdown
Member

I've been avoiding doing this because I don't want to disable hardware acceleration for users that don't have this bug.

I've been thinking of maybe trying to catch the error by maybe setting a flag on launch and unsetting if the app actually showed a window. Then, next launch could check that flag and prompt the user with a native confirmation to set the flag for them.

… crash

The DMA-BUF renderer in WebKit2GTK triggers a Wayland protocol error (71)
on Nvidia GPUs due to an explicit sync conflict (WebKit bug #280210).
Setting __NV_DISABLE_EXPLICIT_SYNC=1 targets only affected systems
(Nvidia drivers + Wayland) and avoids disabling hardware acceleration.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Charlisim

Copy link
Copy Markdown
Author

Thanks for the feedback — that's a fair concern, and I looked into it further.

After digging into the upstream WebKit bug tracker, this issue is tracked at https://bugs.webkit.org/show_bug.cgi?id=280210. The root cause is specific to Nvidia GPUs on Wayland: there's an explicit sync conflict between WebKit's ANGLE implementation and Nvidia's egl-wayland library (wp_linux_drm_syncobj_surface_v1). It's not a general compositor issue.

That also means there's a more targeted workaround: __NV_DISABLE_EXPLICIT_SYNC=1 disables the explicit sync path on the Nvidia driver side without touching the DMA-BUF renderer itself, so hardware acceleration is preserved.

I've updated the PR to use that approach instead — the variable is only set when:

  • We're on Linux
  • A Wayland display is active (WAYLAND_DISPLAY is set)
  • Nvidia drivers are loaded (/sys/module/nvidia exists)
  • The user hasn't already set the variable themselves

Users on AMD/Intel are completely unaffected. Happy to adjust if you'd prefer a different detection strategy.

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.

2 participants