Skip to content

Linux/GNOME + NVIDIA: Invalid surface panic on XWayland kills the Hex window at startup #979

Closed

Description

@adelekeogunsona

Hex version: 3.2.0-1, installed from the .deb. Also reproduced on 3.1.1-1.

Platform: Linux Wayland

System details: Ubuntu 26.04.1 LTS, kernel 7.0.0-42, GNOME Shell 50.1 / Mutter 50.1, Xwayland 24.1.10. NVIDIA GeForce RTX 4060 Laptop GPU with no other GPU, nvidia-driver-595-open 595.99.02.

What happened?

The Hex window never appears. Clicking the dock icon does nothing. About 0.2 seconds after Hex starts, the main thread panics in Surface::configure, and the window and the overlays stop. The service keeps running.

hex window show still prints Opened the window and exits 0. hex status can also show Window open after the panic.

I expected the window to open. If an overlay cannot get a surface, I expected Hex to lose only that overlay.

INFO hex::linux::rune_hud: HUD shows on XWayland: compositor has no layer-shell
rune: GPU "NVIDIA GeForce RTX 4060 Laptop GPU" (wgpu; Vulkan, DiscreteGpu, 0000:01:00.0): the compositor's GPU; compositor on 0000:01:00.0
ERROR hex::app_paths: panic: panicked at wgpu-30.0.1/src/backend/wgpu_core.rs:3981:18:
wgpu error: Validation Error
Caused by:
  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

Steps to reproduce

  1. Use GNOME on Wayland with an NVIDIA GPU and no layer-shell, so that the HUD uses XWayland.
  2. Start Hex, or run hex restart.
  3. Click the dock icon, or run hex window show. No window appears.
  4. Run journalctl --user -u hex to see the panic.

Additional context

I stopped hex.service and ran hex service in the foreground with each setting:

Launch setting Result
Default Panic
WAYLAND_DISPLAY unset (XWayland only) Panic
WGPU_BACKEND=gl Panic, and Rune still logs Vulkan
WAYLAND_DISPLAY unset, VK_DRIVER_FILES set to Mesa lvp_icd.json No panic in an 8-second run
DISPLAY unset (Wayland only), then hex window show No panic, and Rune logs the NVIDIA GPU

These results point to the Vulkan surface on XWayland with the NVIDIA driver. I do not know why the surface is invalid.

With DISPLAY unset, the overlays log can't show: the platform could not create its window or surface, and the HUD is unavailable. This matches the layer-shell gap in #814. The service runs without a panic in this mode, so it is a usable workaround.

Timing of the panic in the logs:

  • On a first install (3.1.1), the window opened and onboarding completed. The panic came 3 seconds after the dictation listener started.
  • In a later run with live_text=false, the panic came about 7 minutes after startup.
  • Every run with live_text=true panics at startup. This suggests that the Live Text overlay opens early, but I did not test it directly.

Other checks:

Possible changes:

  1. Catch a surface failure for one overlay, so that it does not stop the main window.
  2. Make hex window show and hex status report the failed window.

Activity

  1. adelekeogunsona commented on Nov 2, 2026

    @adelekeogunsona
    Author

    Confirmed: with DISPLAY unset, the Hex window opens and renders normally.

  2. thdxr commented on Nov 2, 2026

    @thdxr
    Member

    run_window in src/linux/app.rs already wraps the whole rune app in catch_unwind, so the panic only ends the window and hud, not hex. but the window and the xwayland hud share one rune event loop and gpu device, so a failed surface configure on the x11 overlay takes the window down with it, and we can't drop just one overlay from hex's side. after that, hex window show still answers ok because show_window only queues onto a channel nobody reads anymore, and hex status reads a stale window_visible closure.

    • the panic is inside rune's wgpu surface setup, so keeping the window alive while losing only the hud needs a change in rune, not hex.

    • we have no gnome wayland + nvidia machine to confirm it's the xwayland hud surface and not the main wayland window failing on its own.

    • would be useful to have the full panic line from the log and your nvidia driver version.

    • if you can try with the indicator position set to hidden, or with DISPLAY unset for hex so the hud never goes to xwayland, does the window open then?

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

  3. added
    needs-repro
    on Nov 2, 2026
  4. adelekeogunsona commented on Nov 2, 2026

    @adelekeogunsona
    Author

    Results from the affected machine:

    NVIDIA driver: 595.99.02 (nvidia-driver-595-open). This is the only GPU in the machine.

    Full panic line:

    ERROR hex::app_paths: panic: panicked at /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/wgpu-30.0.1/src/backend/wgpu_core.rs:3981:18:
    wgpu error: Validation Error
    Caused by:
      In Surface::configure
        Invalid surface
    

    DISPLAY unset: the window opens and renders, with no panic. Rune logs the same NVIDIA GPU, so the main Wayland window works on this driver.

    WAYLAND_DISPLAY unset, DISPLAY set: panics with the same error.

    DISPLAY set, window opened:

    Live Text Indicator Dictation Result
    On Hidden None Panic at startup
    Off Top None No panic
    Off Top One short dictation Panic
    Off Hidden One short dictation No panic

    The startup panic comes from Live Text. On 3.2.0, src/rune_ui/live_text.rs sets prewarm: crate::labs::live_text() on a non-interactive overlay, which uses XWayland on GNOME. show() in src/rune_hud.rs returns early for Hidden, so a hidden HUD does not panic. The HUD shows on XWayland log line comes from an environment check and does not show that a surface exists.

    So the Wayland window works, and any overlay surface on XWayland panics: Live Text at startup, or the HUD at its first show. I don't know why the XCB Vulkan surface is invalid on this driver.

  5. thdxr commented on Nov 2, 2026

    @thdxr
    Member

    thanks for the digging, the live text / hidden hud table nailed it to the xwayland overlays.

    fixed in #986 (rune 53c0c9ac), in the next dev build:

    • the overlay's xwayland surface was being handed to another adapter that claims translucent alpha for it (lavapipe here, the amd igpu in Linux/GNOME + NVIDIA with an AMD iGPU: window and HUD crash (wgpu 'Invalid surface', then 'non-existent resource BufferId') #982) but can't actually make the swapchain on nvidia's xwayland. overlays now stay on the compositor's gpu and draw opaque-alpha there
    • if a surface still gets refused, that overlay just fails and logs wgpu's reason, the window and the other overlays keep going. before, wgpu panicked and took the whole window with it
    • if the window does die anyway, hex window show errors and hex status says so instead of claiming it's open

    not tested on nvidia, we don't have one. the containment is covered by a test on a fake gpu backend. if you can try the next dev build with DISPLAY set and live text on, that'd confirm it. if the hud still doesn't show, the log should now have a real reason instead of "no reason given"

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-repro

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions