{"record":{"id":"2254b168042e1de7","repo":"zed-industries/zed","slug":"surface-configuration-failed-e","errorCode":null,"errorMessage":"surface configuration failed: {e}","messagePattern":"surface configuration failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/gpui_wgpu/src/wgpu_context.rs","lineNumber":491,"sourceCode":"            Self::create_device(adapter).await?;\n        let error_scope = device.push_error_scope(wgpu::ErrorFilter::Validation);\n\n        let test_config = wgpu::SurfaceConfiguration {\n            usage: wgpu::TextureUsages::RENDER_ATTACHMENT,\n            format: caps.formats[0],\n            width: 64,\n            height: 64,\n            present_mode: wgpu::PresentMode::Fifo,\n            desired_maximum_frame_latency: 2,\n            alpha_mode: caps.alpha_modes[0],\n            view_formats: vec![],\n        };\n\n        surface.configure(&device, &test_config);\n\n        let error = error_scope.pop().await;\n        if let Some(e) = error {\n            anyhow::bail!(\"surface configuration failed: {e}\");\n        }\n\n        Ok((\n            device,\n            queue,\n            dual_source_blending,\n            color_atlas_texture_format,\n        ))\n    }\n\n    fn select_color_texture_format(adapter: &wgpu::Adapter) -> anyhow::Result<wgpu::TextureFormat> {\n        let required_usages = wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST;\n        let bgra_features = adapter.get_texture_format_features(wgpu::TextureFormat::Bgra8Unorm);\n        let rgba_features = adapter.get_texture_format_features(wgpu::TextureFormat::Rgba8Unorm);\n        #[cfg(target_family = \"wasm\")]\n        if adapter.get_info().backend == wgpu::Backend::Gl\n            && rgba_features.allowed_usages.contains(required_usages)\n        {","sourceCodeStart":473,"sourceCodeEnd":509,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_wgpu/src/wgpu_context.rs#L473-L509","documentation":"After creating a device, GPUI pushes a wgpu validation error scope and configures the surface with a 64x64 test SurfaceConfiguration (caps.formats[0], Fifo present mode, caps.alpha_modes[0]). If wgpu records a validation error while configuring, the scope pops Some(e) and the adapter is rejected. It means the driver/device refused the exact format/alpha-mode/usage combination the capabilities advertised.","triggerScenarios":"surface.configure(&device, &test_config) triggering a wgpu::ErrorFilter::Validation error — driver bugs where reported capabilities do not match what configure accepts, formats that lack RENDER_ATTACHMENT support in practice, or alpha modes the compositor rejects.","commonSituations":"Buggy or mismatched GPU driver stacks (especially on Windows hybrid graphics and older Linux mesa), remote-desktop surfaces whose capabilities drift after connect/disconnect, and adapters that advertise formats they cannot actually configure.","solutions":["Update GPU drivers to a version where surface.configure matches get_capabilities","Try a different adapter/vendor by removing GPU vendor overrides (or setting one that works)","Switch backends via WGPU_BACKEND (e.g. dx12 vs vulkan on Windows, gl vs vulkan on Linux)","Restart the app after reconnecting/removing the remote session so capabilities are re-queried on a live surface"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let error_scope = device.push_error_scope(wgpu::ErrorFilter::Validation);\nsurface.configure(&device, &test_config);\nif let Some(e) = error_scope.pop().await {\n    // treat as 'adapter unusable', continue with next adapter\n    log::info!(\"surface configuration failed: {e}\");\n    continue;\n}","preventionTips":["Always wrap surface.configure in a validation error scope like this code does — the call itself returns ()","Reconfigure on surface resize/reconnect events so stale capabilities do not persist","Keep a known-good fallback configuration (Bgra8Unorm + Fifo + Opaque) for the retry pass"],"tags":["wgpu","gpu","surface-configuration","validation","driver","gpui"],"backgroundTag":"gpu-surface-unsupported","analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}