Linux: launch on NVIDIA + Wayland; webAppUrl for "call in browser" #23

Merged
jared merged 1 commits from linux-nvidia-wayland into main 2026-09-27 17:10:52 -04:00
Owner

1. NVIDIA + Wayland: the app never opened

Reported on CachyOS (KDE Wayland, RTX 3070, driver 615.71.09, webkit2gtk 2.52.6):

  • natively, GDK dies with Error 71 (Protocol error) dispatching to Wayland display
  • with GDK_BACKEND=x11, WebKit fails with Failed to create GBM buffer of size … Invalid argument
  • WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11 cinny works normally.

gpu_workarounds::apply() runs first thing in main(), before GTK/WebKit start. Only when the NVIDIA driver is loaded (/proc/driver/nvidia/version or /sys/module/nvidia):

  • It sets WEBKIT_DISABLE_DMABUF_RENDERER=1.
  • On a Wayland session with XWayland available (DISPLAY set), it also sets GDK_BACKEND=x11. Without XWayland it stays on Wayland, since there's nothing to fall back to.
  • Values the user already set win, and LOTUS_NO_GPU_WORKAROUNDS=1 turns it all off, for when a newer driver or WebKit fixes this.
  • It logs what it set to stderr.

Non-NVIDIA systems are untouched: DMA-BUF stays on, for performance.

Tests: 7 unit tests for the decision:

  • nothing happens without NVIDIA
  • NVIDIA on Wayland gets both variables
  • NVIDIA on an X11 session gets only the DMA-BUF one
  • Wayland without XWayland stays on Wayland
  • XDG_SESSION_TYPE=wayland is detected
  • the user's own values win
  • the opt-out works.

cargo test passes and clippy is clean for the new module.

Not tested here: there's no NVIDIA GPU on the build machine. The workaround is exactly the reporter's, so the real check is the reporter launching the next Arch build with no environment variables set.

2. webAppUrl in config.json

https://chat.lotusguild.org, used by cinny's "Open in browser" call fallback (cinny calls-open-in-browser, cinny-desktop #21).

Notes

  • Release CI only runs on main. Merging this ships in the next desktop release; the web part arrives through the nightly cinny submodule catch-up once the cinny PR is merged.
  • The "fall back automatically when Wayland init fails" part of the report: GDK aborts on protocol error 71 mid-run rather than returning an error, so we can't catch it in-process. Choosing XWayland up front on NVIDIA avoids it.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA

## 1. NVIDIA + Wayland: the app never opened Reported on CachyOS (KDE Wayland, RTX 3070, driver 615.71.09, webkit2gtk 2.52.6): - natively, GDK dies with `Error 71 (Protocol error) dispatching to Wayland display` - with `GDK_BACKEND=x11`, WebKit fails with `Failed to create GBM buffer of size … Invalid argument` - `WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11 cinny` works normally. `gpu_workarounds::apply()` runs first thing in `main()`, before GTK/WebKit start. Only when the NVIDIA driver is loaded (`/proc/driver/nvidia/version` or `/sys/module/nvidia`): - It sets `WEBKIT_DISABLE_DMABUF_RENDERER=1`. - On a Wayland session with XWayland available (`DISPLAY` set), it also sets `GDK_BACKEND=x11`. Without XWayland it stays on Wayland, since there's nothing to fall back to. - Values the user already set win, and `LOTUS_NO_GPU_WORKAROUNDS=1` turns it all off, for when a newer driver or WebKit fixes this. - It logs what it set to stderr. Non-NVIDIA systems are untouched: DMA-BUF stays on, for performance. **Tests:** 7 unit tests for the decision: - nothing happens without NVIDIA - NVIDIA on Wayland gets both variables - NVIDIA on an X11 session gets only the DMA-BUF one - Wayland without XWayland stays on Wayland - `XDG_SESSION_TYPE=wayland` is detected - the user's own values win - the opt-out works. `cargo test` passes and clippy is clean for the new module. **Not tested here:** there's no NVIDIA GPU on the build machine. The workaround is exactly the reporter's, so the real check is the reporter launching the next Arch build with no environment variables set. ## 2. `webAppUrl` in config.json `https://chat.lotusguild.org`, used by cinny's "Open in browser" call fallback (cinny `calls-open-in-browser`, cinny-desktop #21). ## Notes - Release CI only runs on `main`. Merging this ships in the next desktop release; the web part arrives through the nightly cinny submodule catch-up once the cinny PR is merged. - The "fall back automatically when Wayland init fails" part of the report: GDK aborts on protocol error 71 mid-run rather than returning an error, so we can't catch it in-process. Choosing XWayland up front on NVIDIA avoids it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
jared added 1 commit 2026-09-27 16:57:40 -04:00
NVIDIA + Wayland (reported on CachyOS/KDE, driver 615.71, webkit2gtk
2.52.6): no window. GDK dies with "Error 71 (Protocol error) dispatching to
Wayland display"; forced onto XWayland, WebKit's DMA-BUF renderer then fails
with "Failed to create GBM buffer … Invalid argument". The reporter's
workaround, WEBKIT_DISABLE_DMABUF_RENDERER=1 GDK_BACKEND=x11, runs fine.

gpu_workarounds::apply(), first thing in main() (before GTK/WebKit init):
when the NVIDIA driver is loaded (/proc/driver/nvidia/version or
/sys/module/nvidia), set WEBKIT_DISABLE_DMABUF_RENDERER=1, and on a Wayland
session that has XWayland (DISPLAY set) also GDK_BACKEND=x11. Values the user
already set win; LOTUS_NO_GPU_WORKAROUNDS=1 turns it all off. Logs what it
set to stderr. Non-NVIDIA systems are untouched. Unit tests for the decision.

config.json: webAppUrl = https://chat.lotusguild.org, used by the web client
(cinny `calls-open-in-browser`) to send calls this WebKitGTK build can't make
to the web app in the browser.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
jared merged commit 5b4528e4e5 into main 2026-09-27 17:10:52 -04:00
Sign in to join this conversation.