{"record":{"id":"ea0e46ec1681273d","repo":"zed-industries/zed","slug":"failed-to-request-a-preference-adapter-compati","errorCode":null,"errorMessage":"Failed to request a {preference:?} adapter compatible with the canvas: {error}","messagePattern":"Failed to request a (.+?) adapter compatible with the canvas: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/gpui_wgpu/src/wgpu_context.rs","lineNumber":189,"sourceCode":"            wgpu::util::new_instance_with_webgpu_detection(descriptor).await\n        } else {\n            wgpu::Instance::new(descriptor)\n        };\n        let surface = instance\n            .create_surface(wgpu::SurfaceTarget::Canvas(canvas.clone()))\n            .map_err(|error| {\n                anyhow::anyhow!(\"Failed to create browser graphics surface: {error}\")\n            })?;\n\n        let adapter = instance\n            .request_adapter(&wgpu::RequestAdapterOptions {\n                power_preference: wgpu::PowerPreference::HighPerformance,\n                compatible_surface: Some(&surface),\n                force_fallback_adapter: false,\n            })\n            .await\n            .map_err(|error| {\n                anyhow::anyhow!(\n                    \"Failed to request a {preference:?} adapter compatible with the canvas: {error}\"\n                )\n            })?;\n        let adapter_info = adapter.get_info();\n        let backend = match adapter_info.backend {\n            wgpu::Backend::BrowserWebGpu => WgpuBackend::BrowserWebGpu,\n            wgpu::Backend::Gl => WgpuBackend::Gl,\n            backend => {\n                anyhow::bail!(\n                    \"Browser graphics initialization selected unexpected backend {backend:?}\"\n                )\n            }\n        };\n\n        let device_lost = Arc::new(AtomicBool::new(false));\n        let (device, queue, dual_source_blending, color_texture_format) =\n            Self::create_device(&adapter).await?;\n        device.set_device_lost_callback({","sourceCodeStart":171,"sourceCodeEnd":207,"githubUrl":"https://github.com/zed-industries/zed/blob/f4178619acd0d47ea1f76a2025c42962c6d6638c/crates/gpui_wgpu/src/wgpu_context.rs#L171-L207","documentation":"Raised in `WgpuContext::new_web_with_backend` when `instance.request_adapter` returns None for the requested backend preference (Auto/WebGpu/WebGl) with the canvas as compatible surface. Happens when no GPU adapter matches: WebGPU unavailable/disabled, WebGL context lost or unsupported hardware.","triggerScenarios":"Thrown at crates/gpui_wgpu/src/wgpu_context.rs:189 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry with a different WebBackendPreference (Auto falls back through WebGPU then WebGL).","Ask the user to enable WebGPU or use a browser/version that supports it.","Lower power_preference or drop compatible_surface constraints if appropriate.","Surface a clear message that the browser/GPU cannot provide a renderer."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f4178619acd0d47ea1f76a2025c42962c6d6638c","analyzedAt":"2026-08-20T19:29:52.058Z","contentChangedAt":"2026-08-20T19:29:52.058Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}