{"record":{"id":"30a41a387f149e3c","repo":"bevyengine/bevy","slug":"no-supported-formats-for-surface","errorCode":null,"errorMessage":"No supported formats for surface","messagePattern":"No supported formats for surface","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/bevy_render/src/view/window/mod.rs","lineNumber":401,"sourceCode":"    for (entity, mut window, handle, mut maybe_surface_data) in &mut windows {\n        let Some(data) = maybe_surface_data.as_mut() else {\n            let surface_target = SurfaceTargetUnsafe::RawHandle {\n                raw_display_handle: Some(handle.get_display_handle()),\n                raw_window_handle: handle.get_window_handle(),\n            };\n            // SAFETY: The window handles in ExtractedWindows will always be valid objects to create surfaces on\n            let surface = unsafe {\n                // NOTE: On some OSes this MUST be called from the main thread.\n                // As of wgpu 0.15, only fallible if the given window is a HTML canvas and obtaining a WebGPU or WebGL2 context fails.\n                render_instance\n                    .create_surface_unsafe(surface_target)\n                    .expect(\"Failed to create wgpu surface\")\n            };\n            let caps = surface.get_capabilities(&render_adapter);\n            let present_mode = present_mode(&window, &caps);\n            let formats = caps.formats;\n            // For future HDR output support, we'll need to request a format that supports HDR,\n            // but as of wgpu 0.15 that is not yet supported.\n            // Prefer sRGB formats for surfaces, but fall back to first available format if no sRGB formats are available.\n            let mut format = *formats.first().expect(\"No supported formats for surface\");\n            for available_format in formats {\n                // Rgba8UnormSrgb and Bgra8UnormSrgb and the only sRGB formats wgpu exposes that we can use for surfaces.\n                if available_format == TextureFormat::Rgba8UnormSrgb\n                    || available_format == TextureFormat::Bgra8UnormSrgb\n                {\n                    format = available_format;\n                    break;\n                }\n            }\n\n            let texture_view_format = if !format.is_srgb() {\n                Some(format.add_srgb_suffix())\n            } else {\n                None\n            };\n            let configuration = SurfaceConfiguration {","sourceCodeStart":383,"sourceCodeEnd":419,"githubUrl":"https://github.com/bevyengine/bevy/blob/8d743eb7dc7fcff57a7d5744d0bbf89620b1b145/crates/bevy_render/src/view/window/mod.rs#L383-L419","documentation":"After creating a window surface, Bevy reads surface.get_capabilities(&render_adapter).formats and does formats.first().expect(\"No supported formats for surface\"). An empty capability format list means the adapter and surface are incompatible at the format level — a driver/platform problem, not application logic: nothing exists to pick even a fallback format from.","triggerScenarios":"The selected adapter reports zero supported formats for the created surface — e.g. a software/fallback adapter (WGPU_FORCE_FALLBACK_ADAPTER=1 or forced via WGPU_ADAPTER_NAME) that cannot present to the window, or a buggy/limited driver stack (vGPU, remote desktop).","commonSituations":"Forcing WGPU_ADAPTER_NAME to an incompatible GPU (optimus laptops picking the wrong chip); WGPU_FORCE_FALLBACK_ADAPTER=1 left set in the environment; virtual machines/remote-desktop sessions with constrained GPU paravirtualization; outdated drivers reporting empty caps.","solutions":["Unset WGPU_FORCE_FALLBACK_ADAPTER and WGPU_ADAPTER_NAME so wgpu picks a presenting-capable adapter","If you need a specific GPU, verify it can output to the window (driver hybrid-graphics settings, e.g. forcing the discrete GPU system-wide)","Update GPU drivers / VM guest tools; on Linux check the compositor and backend (Wayland vs X11) match","As a workaround try a different backend with WGPU_BACKEND"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before app start, sanitize the environment that steers adapter choice:\nfn clean_adapter_env() {\n    for key in [\"WGPU_FORCE_FALLBACK_ADAPTER\", \"WGPU_ADAPTER_NAME\"] {\n        std::env::remove_var(key); // only if you did not set them intentionally\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't leave WGPU_FORCE_FALLBACK_ADAPTER=1 or a wrong WGPU_ADAPTER_NAME in dev/CI environments","On hybrid-graphics laptops, prefer driver-level GPU selection over wgpu env overrides","Keep GPU drivers and VM guest additions up to date when running in VMs/remote sessions"],"tags":["bevy","wgpu","surface-capabilities","gpu-drivers","adapter"],"backgroundTag":"unsupported-display-configuration","analyzedSha":"8d743eb7dc7fcff57a7d5744d0bbf89620b1b145","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}