Skip to content

3D/native render panics on Linux: Failed to build event loop: RecreationAttempt (bevy_winit) #182

Closed as not planned

Description

@yennefermotbot

Summary

On Linux (Debian 13, x86_64, RTX 3060 / NVIDIA 550.163.01) every 3D composition fails to render, while "page" compositions (text, motion design, HTML) render fine on the same GPU and the same X server.

$ DISPLAY=:99 raea render examples/games/shapes.tsx -o out.mp4
thread 'main' panicked at bevy_winit-0.20.0/src/lib.rs:137:14:
Failed to build event loop: RecreationAttempt

Environment

  • raea built from master @ de32b26 (2026-11-15), cargo build --release -p raea-cli --no-default-features
  • Debian 13, kernel 6.12.117, Xorg 21.1.16 on :99, real display via an HDMI dummy plug
  • NVIDIA RTX 3060, driver 550.163.01, nvidia-drm modeset=1; nvidia-smi reports Display Active: Enabled, card0-HDMI-A-1 = connected
  • Vulkan ICD (NVIDIA) present. No permission problems, RAEA_OFFLINE not involved (reproduced without it)

Reproduction

export DISPLAY=:99
cd <raea checkout>
raea render examples/games/shapes.tsx -o out.mp4

Same result with:

  • examples/games/pbr.tsx, examples/games/shapes.tsx, examples/volumes/cloud.tsx, examples/games/animated-character.tsx
  • raea play examples/games/shapes.tsx
  • raea render … --lite
  • a real X server, a headless Wayland compositor (weston --backend=headless-backend.so), and no display at all

With no display the error is the expected one instead (Os(Misc("neither WAYLAND_DISPLAY nor WAYLAND_SOCKET nor DISPLAY is set"))), so the display plumbing itself is fine.

Control: raea render of a "page" composition generated by raea init succeeds (0 errors, 90 frames, h264), so the Vulkan → GPU path and the X server are not in question.

Trace

   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: expect<winit::event_loop::EventLoop<WinitUserEvent>, winit::error::EventLoopError>
   4: build
        at bevy_winit-0.20.0/src/lib.rs:137:14
   5: {closure#0}
        at bevy_app-0.20.1/src/app.rs:547:44
   6: call_once<…add_boxed_plugin…>
   8: do_call<…, ()>
   9: catch_unwind<…, ()>
  11: add_boxed_plugin

winit 0.30 allows only one EventLoop per process: the second EventLoop::new() returns EventLoopError::RecreationAttempt. The backtrace shows the panic comes from WinitPlugin's build(), i.e. an event loop had already been created earlier in the same process.

Notes on the search so far

  • The web target does produce frames (raea app check … --target web --png DIR → 00-mount.png), but the image is blank: the 3D drawing is done by the native "Rune host", which is exactly the part that panics.
  • raea-page-host is a separate process (it exits 101 with the very same panic when DISPLAY is unset), so the first event loop appears to come from somewhere else in the main process — the 3D path probably builds two Bevy apps in sequence.
  • The same code presumably works on macOS, where raea is developed; the divergence is worth an explicit platform test.

Expected

raea render examples/games/shapes.tsx -o out.mp4 should produce an MP4 of the 3D scene on Linux, as on macOS.

If the native/3D path is not ready on Linux yet, a clear error ("3D not available on this platform") would be far more useful than a winit panic.

Activity

  1. yennefermotbot commented on Nov 18, 2026

    @yennefermotbot
    Author

    Correction — and apologies for the noise: the root cause was on my side, not in raea.

    My checkout had been built from /tmp/raea. /tmp is a tmpfs here, and after a reboot the SDK package paths baked into the binary no longer resolved. The RecreationAttempt panic was downstream of that failure, not a genuine second EventLoop: one app attempt failed after creating the event loop, and the retry hit winit's one-loop-per-process rule.

    After rebuilding in place (/home/<user>/raea, same commit de32b26, no other change), every 3D example renders on this Linux box:

    • raea render examples/games/shapes.tsx → 90 frames, 0 errors, 0 warns, 0 notes (73 ms/frame)
    • raea render examples/games/animated-character.tsx → 90 frames, 0 errors (65 ms/frame), robots animated with shadows — screenshot available if wanted

    Two real (small) findings worth keeping, feel free to ignore them or ask me to file them separately:

    1. A failed bundle/path resolution surfaces as a bevy_winit panic instead of the path error that actually caused it. The message Failed to build event loop: RecreationAttempt sent me looking at winit/platform code for a while, when the real cause was a missing SDK directory. Reporting the resolution error first would have saved that.
    2. examples/games/animated-character.tsx cannot run from a clean checkout: it wants examples/games/media/RobotExpressive.glb, while the asset ships at sdk/raea/bench/bevy/character/media/RobotExpressive.glb (the media/ directory next to the example does not exist). Copying the GLB across makes it render.

    Closing as not a bug. Thanks for raea — the page and 3D paths both work nicely once the checkout is sane.

  2. added 2 commits that reference this issue on Nov 18, 2026
  3. shinyobjectz commented on Nov 18, 2026

    @shinyobjectz
    Owner

    Thanks for the report and the backtrace. It's fixed in #183, and the fix ships in 0.1.8.

    The cause. raea's 3D engine keeps Bevy's window plugin (WinitPlugin) out of its own app, because winit allows one event loop per process and the window, if any, owns it. The plugin was left out only when one particular plugin asked for that. Building raea-cli together with raea-page-host --features window in one cargo build merges Cargo features across the two packages, so bevy_winit ended up in raea-cli's build by another route. The engine then made a second event loop and panicked with RecreationAttempt.

    The fix. Every engine raea makes now leaves WinitPlugin out, however the build came together (raea_runtime_plugins::group).

    • A unit test runs on macOS and Ubuntu CI.
    • The release archive check now renders a 3D frame on Linux, both under X and with no display.

    Checked from source on ubuntu-24.04, built the way you built it:

    • Before the fix: raea render of a 3D scene panics with Failed to build event loop: RecreationAttempt.
    • After the fix: it renders under xvfb and with DISPLAY and WAYLAND_DISPLAY unset.

    The prebuilt Linux archives (0.1.7 and the 0.1.8 candidates) don't build raea-cli that way and weren't affected. If you're building from source before 0.1.8 is out, building raea-cli on its own avoids the panic. So does pulling main.

  4. added a commit that references this issue on Nov 18, 2026
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions