Skip to content

Desktop: stop the NVIDIA X11 flicker on WebKitGTK 2.54 (#16318) - #16322

Merged
danielhanchen merged 3 commits into
unslothai:mainfrom
indrajeetapache:fix/linux-nvidia-x11-flicker-dmabuf-16318
Nov 1, 2026
Merged

danielhanchen merged 3 commits into
unslothai:mainfrom
indrajeetapache:fix/linux-nvidia-x11-flicker-dmabuf-16318

Conversation

@indrajeetapache

@indrajeetapache indrajeetapache commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #16318. Same cause as the flicker in #16028.

On NVIDIA X11 the app turns WebKit compositing off below driver 610, which avoids the 580 driver's sync_file leak (#10795). The plan it uses (WEBKIT_DMABUF_RENDERER_FORCE_SHM + WEBKIT_FORCE_DMABUF_RENDERER + WEBKIT_DISABLE_COMPOSITING_MODE) works up to WebKitGTK 2.52, but on 2.54 the window stops presenting what WebKit draws. The report's video alternates between the UI and a blank off-white window 82 times in 11 seconds. WEBKIT_DISABLE_COMPOSITING_MODE=1 alone is enough to trigger it on 2.54 with NVIDIA's libraries; with Mesa it renders.

Who gets it: NVIDIA X11 hosts below driver 610 with a system WebKitGTK 2.54 (Debian 13, Fedora 43/44, Arch). Deb users there have had it since their distribution moved to 2.54. AppImage users there got it in v0.1.913, when the AppImage started running on the host's WebKitGTK 2.54 (#15503); v0.1.912's bundled 2.50.4 renders. The "Off" setting, "On" below driver 610 and UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1 all reached the same plan, so none of them helped.

Fix

Every NVIDIA X11 path that turns compositing off now turns the DMA-BUF renderer off instead on WebKitGTK 2.54 and newer: Auto below driver 610, Off, On below 610, and UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1. This is the WEBKIT_DISABLE_DMABUF_RENDERER=1 workaround the report confirmed. Below 2.54 those paths keep the shared-memory plan, which renders there and is what #10964 chose because disabling DMA-BUF could leave Debian and Ubuntu's patched WebKit without a transport. Wayland, non-NVIDIA hosts and NVIDIA X11 at driver 610 or newer are unchanged.

A/B results

v0.1.912 and v0.1.913 release builds, and this branch before and after the follow-up commit, built with the Linux x64 steps of release-desktop.yml, ran in Debian 13, Fedora 44 and Ubuntu 24.04 containers with NVIDIA's userspace on an Xvfb display, with a fake driver 595 version file for the below-610 paths. Without a compositor, the broken presentation shows as a window that stays blank rather than flickering.

WebKitGTK Auto, driver 595 On, driver 595 Off UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1
2.54.0 (Debian 13), v0.1.913 Blank Blank Blank Blank
2.54.0 (Debian 13), this PR Renders Renders Renders Renders
2.54.2 (Fedora 44), this PR Renders Renders Renders Renders
2.52.6 (Ubuntu 24.04), this PR Renders, unchanged plan Renders, unchanged plan Renders, unchanged plan Renders, unchanged plan
2.50.4 (bundled), this PR Renders, unchanged plan Renders, unchanged plan Renders, unchanged plan Renders, unchanged plan

The first commit alone left On below 610 and UNSLOTH_WEBKIT_DISABLE_COMPOSITING=1 blank on 2.54.0 and 2.54.2. The v0.1.912 deb is blank on Debian 13's 2.54.0 as well.

Disabling DMA-BUF also stays clear of the 580 leak. On a GeForce MX150 with driver 580.178.04, the same continuous-scroll workload grew the web process to 367 sync_file descriptors in about 2 minutes with compositing on, and stayed at 0 for 5 minutes with WEBKIT_DISABLE_DMABUF_RENDERER=1, at 59 fps.

Validation

  • Rust tests: all 837 studio/src-tauri binary tests pass, including a new case for each of the four paths on 2.50.4, 2.52.6, 2.54.0 and 2.54.2.
  • Builds: verify-complete-appimage.sh passed on both A/B builds.
  • Not tested: the flicker itself on an NVIDIA X server below driver 610 with WebKitGTK 2.54 (the test machine has driver 615), and Debian or Ubuntu's NVIDIA DMA-BUF patch on real NVIDIA hardware with WebKitGTK 2.52 or older.

…slothai#16318)

Compositing-off with FORCE_DMABUF still left the DMA-BUF renderer active on
NVIDIA X11, which flickered badly (photosensitivity risk) on drivers below
610 — including the reporter's 595. Off also used that same path, so the
CPU setting did not apply the known workaround. Use WEBKIT_DISABLE_DMABUF
for Auto below the compositing floor and for Off on NVIDIA X11, matching
the path that fixed unslothai#16028. On + old driver and an explicit compositing
opt-in keep the SHM compositing-off fallback.
@oobabooga oobabooga changed the title Studio: disable DMA-BUF on NVIDIA X11 Auto/Off to stop UI flicker (#16318) Desktop: stop the NVIDIA X11 flicker on WebKitGTK 2.54 (#16318) Nov 1, 2026
@oobabooga

Copy link
Copy Markdown
Member

Reached Codex review convergence at oobabooga#442.

@shimmyshimmer

Copy link
Copy Markdown
Member

Review record for #16322, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#673.

Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found.

Round 1: reviewed mirror 2e99f47d0e (this PR's 8a359f74e)

chatgpt-codex-connector[bot] (on the mirror)

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 2e99f47d0e

No triage reaction was recorded on the mirror

Verdict

The round converged at mirror 2e99f47d0e (this PR's 8a359f74e).

This is the review as it stood at that commit. Anything pushed to this PR afterwards was not part of it.

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.

[Bug] Flickering on Linux (EPILEPSY WARNING)

4 participants