mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 06:00:20 +00:00
67567702f0
# Objective The `headless_renderer` example is meant to showcase running bevy as a headless renderer, but if run without a display server (for example, over an SSH connection), a panic occurs in `bevy_winit` despite never creating a window: ```rust bevy_winit-0.14.1/src/lib.rs:132:14: winit-0.30.5/src/platform_impl/linux/mod.rs: neither WAYLAND_DISPLAY nor WAYLAND_SOCKET nor DISPLAY is set. ``` This example should run successfully in situations without an available display server, as although the GPU is used for rendering, no window is ever created. ## Solution Disabling WinitPlugin, where the above panic occurs, allows the example to run in a fully headless environment. ## Testing - I tested this change in normal circumstances with a display server (on macOS Sequoia and Asahi Linux) and behavior was normal. - I tested with no display server by connecting via SSH, and running the example (on Asahi Linux). Previously this panics, but with this change it runs normally. ## Considerations - One could argue that ultimately the user should not need to remove `WinitPlugin`, and instead bevy should only throw the above panic when the application first attempts to create a window. |
||
---|---|---|
.. | ||
custom_loop.rs | ||
drag_and_drop.rs | ||
empty.rs | ||
empty_defaults.rs | ||
headless.rs | ||
headless_renderer.rs | ||
log_layers.rs | ||
log_layers_ecs.rs | ||
logs.rs | ||
no_renderer.rs | ||
plugin.rs | ||
plugin_group.rs | ||
return_after_run.rs | ||
thread_pool_resources.rs | ||
without_winit.rs |