Skip to content

fix(desktop): use WEBKIT_DMABUF_RENDERER_FORCE_SHM for NVIDIA/AppImage (#3654) - #4505

Merged
wpfleger96 merged 8 commits into
block:mainfrom
Chessing234:fix/webkit-force-shm-3654
Aug 7, 2026
Merged

fix(desktop): use WEBKIT_DMABUF_RENDERER_FORCE_SHM for NVIDIA/AppImage (#3654)#4505
wpfleger96 merged 8 commits into
block:mainfrom
Chessing234:fix/webkit-force-shm-3654

Conversation

@Chessing234

@Chessing234 Chessing234 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Test plan

WEBKIT_DISABLE_DMABUF_RENDERER=1 no longer falls back to shared memory on
current WebKitGTK — it empties the transport mode and SIGSEGVs (block#3654).

Signed-off-by: Taksh <takshkothari09@gmail.com>
Keep user overrides of the legacy DISABLE_DMABUF var standing the
heuristic down, and assert --safe-rendering no longer sets it.

Signed-off-by: Taksh <takshkothari09@gmail.com>
Stop recommending WEBKIT_DISABLE_DMABUF_RENDERER=1 — on current WebKitGTK
it empties the transport mode and SIGSEGVs instead of falling back.

Signed-off-by: Taksh <takshkothari09@gmail.com>
Keep the RDNA4 recipe aligned with the block#3654 WebKit transport fix.

Signed-off-by: Taksh <takshkothari09@gmail.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

nvidia/appimage webkit shm force — small linux desktop fix if anyone on the oss team is in that area.

@kwsantiago

kwsantiago commented Aug 3, 2026

Copy link
Copy Markdown

Tested this branch on the hardware from #3654: Ubuntu 24.04 x86_64, WebKitGTK 2.52.3, GeForce RTX 3050 Ti (driver 580.173.02), X11, proprietary NVIDIA driver. Local build, no environment overrides at all.

The heuristic does the right thing:

buzz-desktop: WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 — NVIDIA GPU

It still SIGSEGVs on the first workspace switch, at the same crash site as #3654 (AcceleratedBackingStore::update with a null this).

The reason is downstream of this change. Debian and Ubuntu ship disable-nvidia-dmabuf.patch in webkit2gtk, which inserts an isNVIDIA() check into rendererBufferTransportMode() that returns before mode.add(SharedMemory). On a machine where that check fires, the transport mode is empty no matter which of the two variables is set, so the backing store is still never created.

What works here is this branch plus pinning EGL to Mesa, which makes the distro patch's isNVIDIA() false:

__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json

Worth noting the difference from @orestes74's report: Mesa EGL failed on their ARM64 hardware and FORCE_SHM alone was enough, which suggests the distro patch's check does not fire there. So the two cases need different things.

Not asking for a change to this PR. It is the right fix, it is what the module's own docs describe, and it helps every case where the distro patch does not trigger. Flagging only so #3654 is not closed as fully resolved by it: on Debian and Ubuntu with the proprietary driver, users will still hit the crash until the distro patch is fixed. That side is reported to Debian separately.

@wpfleger96 wpfleger96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Thanks for the fix. I verified the core claim at WebKit source (tag webkitgtk-2.52.5): WEBKIT_DISABLE_DMABUF_RENDERER returns before SharedMemory is added to the transport set (the #3654 null-deref), while WEBKIT_DMABUF_RENDERER_FORCE_SHM is read after it, so it only excludes the hardware dmabuf path. This is the right replacement, and the Plan/user-takeover semantics are preserved — keeping DISABLE_DMABUF in OWNED so =0/=1 still stands the heuristic down is the right call.

Requesting changes for one trivial CI blocker and two doc/UX issues (inline).

One scope note that doesn't need a code change: this is a mitigation, not a universal fix. On machines where WebKit's EGL platform-extension gate fails, the transport set ends up empty regardless of any env var (consistent with the "FORCE_SHM alone wasn't enough" report on #3654), and some distro NVIDIA dmabuf patches can bail out before SharedMemory is added. So I'd frame this as fixing the paths our heuristic covers and not close #3654 from this PR alone.

Comment thread desktop/src-tauri/src/webkit_rendering.rs Outdated
Comment thread desktop/src-tauri/src/webkit_rendering.rs
Comment thread desktop/src-tauri/src/webkit_rendering/tests.rs
Comment thread docs/linux-rendering-troubleshooting.md
Comment thread docs/linux-rendering-troubleshooting.md Outdated
@orestes74

Copy link
Copy Markdown

Tested this branch (Chessing234:fix/webkit-force-shm-3654) on DGX Spark (NVIDIA GB10, Grace Blackwell, ARM64), Ubuntu 24.04, WebKitGTK 2.52.3, X11, PCI ID 10de:2e12. No environment variable overrides.

Heuristic correctly logs:

buzz-desktop: WEBKIT_DMABUF_RENDERER_FORCE_SHM=1 — NVIDIA GPU

App renders correctly on first frame (previously needed a devtools-open workaround to force a repaint on this build/patch combo — not needed with this PR). Workspace switching repeated several times with no SIGSEGV.

This matches @orestes74's ARM64 report — confirming FORCE_SHM alone is sufficient on this hardware, no Mesa EGL pin needed.

Separately, unrelated observation: I occasionally see the window fail to repaint when raising it from behind other windows (not a workspace switch). Happens rarely (a few times a day), no crash log or coredump captured yet, so not clear if it's the same root cause or something else. Will file separately with more detail if I can pin it down.

Rust Lint failed desktop-tauri-fmt-check on the double blank after OWNED.

Signed-off-by: Taksh <takshkothari09@gmail.com>
@Chessing234
Chessing234 force-pushed the fix/webkit-force-shm-3654 branch from 1275ff6 to f4350d7 Compare August 5, 2026 13:00
@Chessing234

Copy link
Copy Markdown
Contributor Author

rustfmt blank-line fix is on tip with dco — needs workflow approval to re-run rust lint.

Warn when Leave keeps crashy DISABLE_DMABUF, cover FORCE_SHM takeover in
tests, and mark the RDNA4 recipe as unverified with a WebKitGTK ≥2.44 note.

Signed-off-by: Taksh <takshkothari09@gmail.com>
@Chessing234

Copy link
Copy Markdown
Contributor Author

@wpfleger96 addressed the review notes on tip — DISABLE_DMABUF leave warning, FORCE_SHM takeover test, RDNA4 recipe marked unverified, and the ≥2.44 note. rustfmt/dco already fixed earlier. ready for another look / merge when you have a minute (also needs workflow approval on the fork).

Chessing234 and others added 2 commits August 7, 2026 20:29
Signed-off-by: Taksh <takshkothari09@gmail.com>
…A guard (block#3654)

Debian/Ubuntu's downstream NVIDIA dmabuf patch can return before SharedMemory is added, so FORCE_SHM is a mitigation there, not a fix. Reproduced on the PR head in block#3654.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96
wpfleger96 enabled auto-merge (squash) August 7, 2026 15:32
@wpfleger96
wpfleger96 disabled auto-merge August 7, 2026 16:24
@wpfleger96
wpfleger96 merged commit 60ae74b into block:main Aug 7, 2026
27 checks passed
atishpatel added a commit that referenced this pull request Aug 7, 2026
…-log-harness

* origin/main:
  feat(desktop): adding rich link previews to messages (#3818)
  fix(buzz-agent): Responses reasoning summary, Anthropic display:summarized, ACP v2 messageId (#5195)
  fix(desktop): retain distinct agent instances in autocomplete (#5202)
  fix(desktop): defer channel visibility change to Save (#5203)
  feat(desktop): Projects follow-ups — access restrictions, fast loading, activity feed polish (#5073)
  refactor(cli): replace probe/decider/detail split with single typed extractor (#5191)
  fix(desktop): drop unhandled rejection from throwing window.Notification (#5143)
  fix(desktop): fence localStorage SecurityError from killing the React tree (#5142)
  fix(desktop): make terminal output selectable (#4980)
  fix(desktop): use WEBKIT_DMABUF_RENDERER_FORCE_SHM for NVIDIA/AppImage (#3654) (#4505)
  Make public starter channels best effort (#5192)
  Mobile: add anchored reaction popover (#5025)
  feat(mobile): add bee pull-to-refresh (#5059)

Signed-off-by: Atish Patel <atish@squareup.com>
wpfleger96 pushed a commit that referenced this pull request Aug 7, 2026
* origin/main: (32 commits)
  Recover from max-token response truncation (#5223)
  chore(release): release Buzz Desktop version 0.5.6 (#5214)
  fix(mobile): keep latest messages above composer (#4981)
  fix(sdk): preserve self-mention p tags in message and forum event builders (#4975)
  bump @tauri-apps/cli to ~2.11.4 to fix linux app icon issue (#4858)
  feat(desktop): adding rich link previews to messages (#3818)
  fix(buzz-agent): Responses reasoning summary, Anthropic display:summarized, ACP v2 messageId (#5195)
  fix(desktop): retain distinct agent instances in autocomplete (#5202)
  fix(desktop): defer channel visibility change to Save (#5203)
  feat(desktop): Projects follow-ups — access restrictions, fast loading, activity feed polish (#5073)
  refactor(cli): replace probe/decider/detail split with single typed extractor (#5191)
  fix(desktop): drop unhandled rejection from throwing window.Notification (#5143)
  fix(desktop): fence localStorage SecurityError from killing the React tree (#5142)
  fix(desktop): make terminal output selectable (#4980)
  fix(desktop): use WEBKIT_DMABUF_RENDERER_FORCE_SHM for NVIDIA/AppImage (#3654) (#4505)
  Make public starter channels best effort (#5192)
  Mobile: add anchored reaction popover (#5025)
  feat(mobile): add bee pull-to-refresh (#5059)
  Remove agent creation success modal (#5063)
  fix(buzz-agent): escalate LLM timeouts per retry and log per-call latency (#5130)
  ...

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>

# Conflicts:
#	desktop/src/shared/api/tauri.ts
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.

4 participants