verify: present through X images when --adapter is not Xwayland's GPU #221

Manually merged
github merged 1 commit from github-bot/gh-221 into main 2026-11-26 11:23:33 +00:00 AGit
Owner

@⁠NickStallman on GitHub · 2026-11-26 10:42 UTC · original
NickStallman:fix/guest-present-local → main · +130 −33 · 4 files · 1 commits · merged 2026-11-26 11:19 UTC

On a dual-GPU desktop with an NVIDIA primary, check --adapter <AMD iGPU> failed all five guest-present* gates.

Cause: the private rootful Xwayland renders on the compositor's GPU, here the 5090. RADV can't create an X11 swapchain on it: vkCreateSwapchainKHR returns VK_ERROR_INITIALIZATION_FAILED. PresentX still returned S_OK, so the gates sampled an unpainted window (0xf5f5f5).

Change:

  • private_x_server now reads which GPU Xwayland opened.
  • When --adapter names a different, non-NVIDIA GPU, it restarts Xwayland with -glamor off and gives the guest MESA_VK_WSI_DEBUG=sw, so Mesa presents through plain X images. The evidence record says so.
  • NVIDIA adapters and runs without --adapter start Xwayland exactly as before.
  • frame_present.cpp: pump the message queue once after PresentX, so guest-present-4k-oversized measures the window after the provider's asynchronous resize. Without this it failed 2 of 4 runs once frames were visible.

This only affects the test harness, not games.

Tested with GE-Proton11-14, Linux 7.0.0, KDE Wayland:

  • AMD Raphael iGPU (1002:13c0): three full python tuxbox.py check --adapter 1002:13c0 runs in a row, all passed. Before this change, all five guest-present* gates failed.
  • RTX 5090 (10de:2b85), driver 595.99.02: full check, all 100 gates passed.
  • python -m unittest discover -s tests: passes, including a new test of when the fallback applies.

Relates to the dual-GPU reports in #180.

🤖 Generated with Claude Code

**@⁠NickStallman** on GitHub · 2026-11-26 10:42 UTC · [original](https://github.com/brcly/TuxBox/pull/221) `NickStallman:fix/guest-present-local` → `main` · +130 −33 · 4 files · 1 commits · merged 2026-11-26 11:19 UTC On a dual-GPU desktop with an NVIDIA primary, `check --adapter <AMD iGPU>` failed all five `guest-present*` gates. **Cause:** the private rootful Xwayland renders on the compositor's GPU, here the 5090. RADV can't create an X11 swapchain on it: `vkCreateSwapchainKHR` returns `VK_ERROR_INITIALIZATION_FAILED`. PresentX still returned S_OK, so the gates sampled an unpainted window (`0xf5f5f5`). **Change:** - `private_x_server` now reads which GPU Xwayland opened. - When `--adapter` names a different, non-NVIDIA GPU, it restarts Xwayland with `-glamor off` and gives the guest `MESA_VK_WSI_DEBUG=sw`, so Mesa presents through plain X images. The evidence record says so. - NVIDIA adapters and runs without `--adapter` start Xwayland exactly as before. - `frame_present.cpp`: pump the message queue once after PresentX, so `guest-present-4k-oversized` measures the window after the provider's asynchronous resize. Without this it failed 2 of 4 runs once frames were visible. This only affects the test harness, not games. **Tested** with GE-Proton11-14, Linux 7.0.0, KDE Wayland: - AMD Raphael iGPU (1002:13c0): three full `python tuxbox.py check --adapter 1002:13c0` runs in a row, all passed. Before this change, all five `guest-present*` gates failed. - RTX 5090 (10de:2b85), driver 595.99.02: full `check`, all 100 gates passed. - `python -m unittest discover -s tests`: passes, including a new test of when the fallback applies. Relates to the dual-GPU reports in #180. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The private rootful Xwayland renders with the compositor's GPU. On a
dual-GPU desktop where that is an NVIDIA card, RADV cannot create an X11
swapchain against it (VK_ERROR_INITIALIZATION_FAILED over DRI3), so the
guest-present gates sampled only the unpainted window on the AMD iGPU.
When --adapter names another Mesa-driven GPU, restart the server without
glamor and ask Mesa to present through X images instead.

The 4K oversized check measured the title window right after the present
that resized it asynchronously; pump once more before measuring.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:55:58 +00:00
github manually merged commit d1112f925a into main 2026-11-26 11:23:33 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.