zed-industries/zed · error

No browser graphics backend could be initialized. Tried WebG

Error message

No browser graphics backend could be initialized. Tried WebGPU, then WebGL2. WebGPU failure: {webgpu_error:#}. WebGL2 failure: {webgl_error:#}

What it means

Terminal failure in initialize_graphics (Auto preference): both WebGPU and the WebGL2 fallback failed to initialize, so no rendering backend is available and the web app cannot start. Both underlying errors are included ({webgpu_error}, {webgl_error}).

Source

Thrown at crates/gpui_web/src/platform.rs:233

    preference: WebBackendPreference,
) -> anyhow::Result<(
    web_sys::HtmlCanvasElement,
    WgpuContext,
    wgpu::Surface<'static>,
)> {
    match preference {
        WebBackendPreference::Auto => {
            let webgpu_canvas = WebWindow::prepare_canvas(browser_window)?;
            let webgpu_result = if wgpu::util::is_browser_webgpu_supported().await {
                WgpuContext::new_web(&webgpu_canvas, WebBackendPreference::WebGpu).await
            } else {
                Err(anyhow::anyhow!(
                    "browser WebGPU probe did not return a usable adapter"
                ))
            };
            match webgpu_result {
                Ok(PreparedWebGraphics { context, surface }) => {
                    return Ok((webgpu_canvas, context, surface));
                }
                Err(webgpu_error) => {
                    let canvas: &web_sys::Element = webgpu_canvas.as_ref();
                    canvas.remove();
                    log::warn!(
                        "WebGPU initialization failed; falling back to WebGL2: {webgpu_error:#}"
                    );

                    let webgl_canvas =
                        WebWindow::prepare_canvas(browser_window).map_err(|error| {
                            anyhow::anyhow!(
                                "WebGPU initialization failed: {webgpu_error:#}. \
                             Failed to prepare a replacement canvas for WebGL2: {error:#}"
                            )
                        })?;
                    match WgpuContext::new_web(&webgl_canvas, WebBackendPreference::WebGl).await {
                        Ok(PreparedWebGraphics { context, surface }) => {
                            Ok((webgl_canvas, context, surface))

View on GitHub (pinned to 9d272b0363)

Solutions

  1. Have the user enable hardware acceleration / WebGL in browser settings (chrome://gpu shows status)
  2. Rule out blocked GPU APIs: strict CSP, enterprise policy, or software rendering fallbacks
  3. Render a clear startup error page instead of a blank canvas; include both chained errors
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at crates/gpui_web/src/platform.rs:233 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20). Data as JSON: /api/errors/8ab6a5ea89452dab. Report an issue: GitHub.