Repository navigation
Description
What happens
On Ubuntu 26.04 (GNOME, Wayland) with an NVIDIA RTX 5090 driving the displays and an AMD Radeon iGPU (Ryzen 9 9950X) also present, Hex 3.2.0 (.deb) starts, but its Rune app panics as soon as the HUD overlay is created (at launch, or at the first dictation):
ERROR hex::app_paths: panic: panicked at wgpu-30.0.1/src/backend/wgpu_core.rs:3981:18:
wgpu error: Validation Error
In Surface::configure
Invalid surface
ERROR hex::linux::app: the Hex window failed; Hex keeps running without it
WARN hex::linux::rune_hud: HUD unavailable: Rune could not open the overlay (no reason given); dictation still works
Dictation keeps working, but the Settings window dies (or never opens) and there is no HUD. hex status shows Recording HUD unavailable: the overlay could not open (no reason given).
Cause
- GNOME has no layer-shell, so the HUD is an override-redirect ARGB X11 window on XWayland (
platform/x11/xwayland.rs). gpu::pickcorrectly picks the compositor's GPU (NVIDIA,0000:01:00.0).- NVIDIA's Vulkan driver reports only
OPAQUEcomposite alpha for that X11 surface, sorender::translucency::preferlooks for another adapter that claims a translucent mode. RADV (the AMD iGPU) reportsPRE_MULTIPLIED | INHERITandis_surface_supported= true, so the overlay moves to the iGPU, even though the sort prefers the compositor's device. - RADV can't create a swapchain on an XWayland that NVIDIA drives:
vkCreateSwapchainKHRreturnsVK_ERROR_INITIALIZATION_FAILED. wgpu-hal maps that toSurfaceError::Lost, and wgpu-core toConfigureSurfaceError::InvalidSurface. wgpu's default uncaptured-error handler panics, and the panic takes the whole Rune app down with it.
I reproduced step 4 outside Hex with a small C program. It creates the same depth-32 override-redirect window on XWayland and calls vkCreateSwapchainKHR:
- NVIDIA: caps
alpha=0x1(opaque only), swapchainVK_SUCCESS - RADV: caps
alpha=0xa(premultiplied | inherit), swapchain-3(VK_ERROR_INITIALIZATION_FAILED)
Confirmation in the running app:
VK_LOADER_DRIVERS_DISABLE=*radeon*→ no panicWGPU_ADAPTER_NAME=nvidia(pins the pick, sopreferis skipped) → no panic at launch; the first HUD show works (but see the second crash below)DISPLAY=(no XWayland) → no panic, no HUD
Second crash once the first is avoided: Cannot get non-existent resource BufferId(3,1)
With the overlay pinned to NVIDIA (WGPU_ADAPTER_NAME=nvidia), the HUD shows once. The next time it shows, the app panics in wgpu-core-30.0.1/src/storage.rs:143 with Cannot get non-existent resource BufferId(3,1).
- NVIDIA's surface never
servesa translucent overlay, soOverlay::attachmakes a newGpu(instance + device) on every show (theNonebranch). - It keeps
self.rendererfrom the previous show and only callsrebuild_renderer(set_format/set_srgb_blend), so the renderer's buffers belong to the old device's hub. - Hex's
HudCompositor(src/rune_hud.rs) caches itsPainter(uniform buffers, bind group, pipeline) keyed only on the target format, so it has the same problem.
So the workaround stops the window from dying at launch, but the HUD still can't be shown twice.
Workaround
# ~/.config/systemd/user/hex.service.d/workaround-hybrid-gpu.conf
[Service]
Environment=WGPU_ADAPTER_NAME=nvidiathen systemctl --user daemon-reload && systemctl --user restart hex.
Proposed fix (Rune)
translucency::prefer: when the compositor named its GPU, don't consider adapters on other GPUs (the rulegpu/pick.rsalready states: only the compositor's GPU's buffers can be shown). The overlay draws opaque on the compositor's GPU instead of failing.Overlay::attach: configure the surface inside a validation error scope, andfail()the overlay on error instead of letting wgpu's default handler panic the app.Overlay::attach: when it makes a newGpu, drop the old renderer so it is rebuilt (with the atlases) on the new device. Document onCompositor::renderthatf.devicecan change between frames.
Proposed fix (Hex)
HudCompositor: rebuild thePainterwhenf.devicechanges, not only when the format does.
Environment
- Hex 3.2.0 (
hex_3.2.0-1_amd64.deb), Rune pinf5def6d, wgpu 30.0.1 - Ubuntu 26.04.1, kernel 7.0.0-42, GNOME (Mutter, experimental
scale-monitor-framebuffer,xwayland-native-scaling), Wayland + XWayland - NVIDIA GeForce RTX 5090, driver 595.58.03 (displays on this card); AMD Radeon iGPU (RADV, Mesa 26.0.8)
Activity
ship-it-mind commentedon Nov 2, 2026
Rune fix: anomalyco/rune#73 (issue anomalyco/rune#72).
Hex also needs this: the HUD's
Painteris cached by format only, so after Rune gives the overlay a new device it draws with the old device's buffers. Proposed change (not compiled here: this machine lacks the native build dependencies):Rune 53c0c9ac: an overlay surface the GPU refuses fails alone, overla…
Rune 53c0c9ac: an overlay surface the GPU refuses fails alone, overla…
thdxr commentedon Nov 2, 2026
thanks, the swapchain repro on radv vs nvidia was exactly the missing piece. same bug as #979, so closing this as a duplicate.
fixed in #986 (rune 53c0c9ac), written along the lines you proposed:
translucency::preferonly considers adapters on the compositor's gpu once it named one, so the hud stays on nvidia and draws opaque-alphanot tested on a hybrid nvidia machine. once the next dev build is out you should be able to drop the WGPU_ADAPTER_NAME override; if the hud still fails the log will now say why
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
Invalid surfacepanic on XWayland kills the Hex window at startup #979ship-it-mind commentedon Nov 2, 2026
Thanks for picking this up so quickly. One correction to the Hex diff I posted above, which #986 adopted:
device != f.deviceinHudCompositorcan't detect a device change. wgpu comparesDevices by their id alone (impl_eq_ord_hash_proxy!(CoreDevice => .id)inwgpu-30.0.1/src/backend/wgpu_core.rs). Each new RuneGpuhas its ownwgpu::Instance, and each instance numbers its devices from the same id, so a new device compares equal to the old one.I hit this while testing on the affected machine. With per-show new devices plus that check, the HUD still panicked on its third show with
Cannot get non-existent resource RenderPipelineId(1,1). The cached painter was reused because the "different" device compared equal.Since 53c0c9ac keeps the overlay's own device across shows, this is dormant now: it only matters if an overlay actually moves to a new device. When that happens, the stale painter comes back. The
Compositordoc ("keep resources made on it with the device they belong to") suggests the same comparison, so other compositors would hit it too.What worked in my test was an explicit signal instead of a comparison. Rune adds
Compositor::new_device(&mut self) {}, whichOverlay::attachcalls when it makes a newGpuafter an earlier show, and Hex implements it asself.gpu = None. With that change on top of your fix, the HUD showed reliably across repeated dictations on GNOME + RTX 5090 + AMD iGPU, with no panics.Rune c8f2888e: the HUD painter follows Rune's device key, not wgpu de…
Rune c8f2888e: the HUD painter follows Rune's device key, not wgpu de…
thdxr commentedon Nov 2, 2026
you're right, checked it in wgpu 30.0.1:
CoreDevicecompares by.idonly, and every rune gpu has its own instance, so a new gpu's first device equals the old one. the check in #986 could never fire.fixed in #993 (rune c8f2888e): rune frames now carry
f.device_key(), unique per device for the whole process, and the hud and the sounds preview key their painter on that instead of the device. there's a rune test showing two instances' devices compare equal while their keys differ, and theCompositordocs now say to use the key, not device equality.i went with a key over a
new_devicehook since a compositor can't miss it, it's just part of the frame. not tested on nvidia here. since 53c0c9ac keeps the overlay on one device it should stay dormant, but if you get a chance to run the next dev build withoutWGPU_ADAPTER_NAMEthat'd confirm it. leaving this closed as a duplicate of #979, say if it still panics and i'll reopen— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊
ship-it-mind commentedon Nov 2, 2026
Confirmed on the affected machine (GNOME Wayland, RTX 5090 driving the displays plus an AMD iGPU, NVIDIA 595.58.03): I ran a local release build of
devat 8104af6 (#986 + #993, Rune c8f2888e) as the Hex service, with noWGPU_ADAPTER_NAMEoverride. Rune picks the NVIDIA GPU as the compositor's. With the window open, five dictations through the normal shortcut each showed the HUD, with no panics; the window stayed open and the HUD looks right. Thanks for the quick fixes.