zed-industries/zed · critical

no compatible surface formats

Error message

no compatible surface formats

What it means

Thrown by gpui_wgpu's adapter-selection loop inside try_adapter_with_surface after surface.get_capabilities(adapter) returns an empty formats list. wgpu fills that list only with texture formats the adapter can actually render to this window surface; an empty list means this adapter cannot present to the surface, so GPUI logs the failure and tries the next adapter (or ultimately bails with 'No GPU adapter found that can configure the display surface').

Source

Thrown at crates/gpui_wgpu/src/wgpu_context.rs:466

                        e
                    );
                }
            }
        }

        anyhow::bail!("No GPU adapter found that can configure the display surface")
    }

    /// Try to use an adapter with a surface by creating a device and testing configuration.
    /// Returns the device and queue if successful, allowing them to be reused.
    #[cfg(not(target_family = "wasm"))]
    async fn try_adapter_with_surface(
        adapter: &wgpu::Adapter,
        surface: &wgpu::Surface<'_>,
    ) -> anyhow::Result<(wgpu::Device, wgpu::Queue, bool, TextureFormat)> {
        let caps = surface.get_capabilities(adapter);
        if caps.formats.is_empty() {
            anyhow::bail!("no compatible surface formats");
        }
        if caps.alpha_modes.is_empty() {
            anyhow::bail!("no compatible alpha modes");
        }

        let (device, queue, dual_source_blending, color_atlas_texture_format) =
            Self::create_device(adapter).await?;
        let error_scope = device.push_error_scope(wgpu::ErrorFilter::Validation);

        let test_config = wgpu::SurfaceConfiguration {
            usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
            format: caps.formats[0],
            width: 64,
            height: 64,
            present_mode: wgpu::PresentMode::Fifo,
            desired_maximum_frame_latency: 2,
            alpha_mode: caps.alpha_modes[0],
            view_formats: vec![],

View on GitHub (pinned to f4178619ac)

Solutions

  1. Update GPU drivers (on Linux install proper mesa/Vulkan drivers instead of llvmpipe-only)
  2. Unset or change WGPU_BACKEND/ZED_GPU_VENDOR overrides so a different adapter+surface pairing is tried
  3. Run in a native session (Wayland or X11 locally) rather than remote forwarding, or enable GPU acceleration in the VM
  4. As a last resort allow software rendering (CPU adapter) so at least one presentable adapter exists

Example fix

// before
let caps = surface.get_capabilities(&adapter);
if caps.formats.is_empty() {
    anyhow::bail!("no compatible surface formats");
}

// after (caller already does this; keep the loop resilient)
match Self::try_adapter_with_surface(&adapter, surface).await {
    Ok(device_and_queue) => return Ok(device_and_queue),
    Err(e) => log::info!("adapter {} failed: {e}, trying next...", adapter.get_info().name),
}
Defensive patterns

Strategy: fallback

Validate before calling

let caps = surface.get_capabilities(&adapter);
if caps.formats.is_empty() || caps.alpha_modes.is_empty() {
    continue; // skip adapter before device creation
}

Try / catch

match Self::try_adapter_with_surface(&adapter, surface).await {
    Ok(found) => return Ok(found),
    Err(e) if e.to_string().contains("no compatible surface formats") => { log::info!("skipping adapter: {e}"); continue; }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Enumerating GPU adapters (sorted by user override, compositor match, device type, then Vulkan/Metal/Dx12 backend priority) and pairing each with the window surface via surface.get_capabilities; a Vulkan adapter behind X11 forwarding/RDP, or a surface created through a compositor the driver cannot target, reports zero presentable formats.

Common situations: Running over X11 forwarding, RDP, or in a VM without 3D acceleration; broken/outdated GPU drivers; hybrid laptops where the discrete GPU cannot composite to the display; forcing WGPU_BACKEND to a backend that mismatches how the surface was created.

Related errors


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