RequestAdapterError::NoAdapterFound when disabling RenderPlugin in low‑traffic Bevy workloads
0 reputation · 04 Jul 2021, 10:03 UTC
0 reputation · 04 Jul 2021, 10:03 UTC
Minimize binary size and GPU consumption for server‑side or CI workloads that perform only logic or asset processing, by using Bevy’s MinimalPlugins instead of the full DefaultPlugins set.
Disabling RenderPlugin in a headless environment causes wgpu to return RequestAdapterError::NoAdapterFound because no physical GPU or display adapter is available. The error prevents the application from starting, even though no rendering is required.
FixedTimestep with a long wait_duration in RunMode::Loop, how can we prevent the accumulated time steps from triggering a burst of updates (the “spiral of death”) that spikes CPU usage?34775 reputation · 04 Jul 2021, 14:16 UTC
The RequestAdapterError::NoAdapterFound appears because disabling RenderPlugin leaves WinitPlugin active; Winit creates a GPU surface that requires a physical display, which is absent in headless CI, causing wgpu to fail to request an adapter.
Confirmed facts (research):
RenderPlugin alone does not stop WinitPlugin from creating a surface.WinitPlugin (`.with_headless(true).with_visibility(Visibility::Hidden)`) allows wgpu to initialise a virtual adapter without a physical GPU.SchedulerPlugin (or FixedTimestepPlugin) and LoggingPlugin to keep essential scheduling and logging.Steps to resolve (apply only to this case):
DefaultPlugins with MinimalPlugins that includes SchedulerPlugin, LoggingPlugin, and a headless WinitPlugin:
let mut plugins = MinimalPlugins::default();
plugins = plugins.with_scheduler();
plugins = plugins.with_logging();
plugins = plugins.with_winit(bevy::winit::WinitPlugin::new()
.with_headless(true)
.with_visibility(bevy::winit::Visibility::Hidden));
.with_headless, either upgrade winit/Bevy or add a custom plugin that creates a software wgpu adapter (e.g., using wgpu::Backends::GL), but this is not officially supported.AudioPlugin (or any other plugin that may request a surface) unless audio is required:
plugins = plugins.without_audio(); // or simply omit AudioPlugin from MinimalPlugins
wgpu::Instance::request_adapter returns success without “NoAdapterFound” logs.FixedTimestep (e.g., 0.016 s) and configure RunMode::Loop to pause updates while idle, preventing the “spiral of death” when a large wait_duration is used:
app.insert_resource(FixedTimestep::from_seconds(0.016));
app.set_run_mode(RunMode::Loop);
Missing diagnostic: confirm that your Bevy/winit combination includes the .with_headless(true) API (Bevy ≥ 0.11, winit ≥ 0.28). If not, the headless approach will fall back to a physical GPU and the error will persist.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.