zed-industries/zed · error
Failed to request a {preference:?} adapter compatible with t
Error message
Failed to request a {preference:?} adapter compatible with the canvas: {error} What it means
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.
Source
Thrown at crates/gpui_wgpu/src/wgpu_context.rs:189
wgpu::util::new_instance_with_webgpu_detection(descriptor).await
} else {
wgpu::Instance::new(descriptor)
};
let surface = instance
.create_surface(wgpu::SurfaceTarget::Canvas(canvas.clone()))
.map_err(|error| {
anyhow::anyhow!("Failed to create browser graphics surface: {error}")
})?;
let adapter = instance
.request_adapter(&wgpu::RequestAdapterOptions {
power_preference: wgpu::PowerPreference::HighPerformance,
compatible_surface: Some(&surface),
force_fallback_adapter: false,
})
.await
.map_err(|error| {
anyhow::anyhow!(
"Failed to request a {preference:?} adapter compatible with the canvas: {error}"
)
})?;
let adapter_info = adapter.get_info();
let backend = match adapter_info.backend {
wgpu::Backend::BrowserWebGpu => WgpuBackend::BrowserWebGpu,
wgpu::Backend::Gl => WgpuBackend::Gl,
backend => {
anyhow::bail!(
"Browser graphics initialization selected unexpected backend {backend:?}"
)
}
};
let device_lost = Arc::new(AtomicBool::new(false));
let (device, queue, dual_source_blending, color_texture_format) =
Self::create_device(&adapter).await?;
device.set_device_lost_callback({View on GitHub (pinned to f4178619ac)
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.
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/gpui_wgpu/src/wgpu_context.rs:189 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@f4178619ac (2026-08-20).
Data as JSON: /api/errors/ea0e46ec1681273d.
Report an issue: GitHub.