slint-ui/slint · critical

internal error: Could not find any matching GL configuration

Error message

internal error: Could not find any matching GL configuration

What it means

When creating the glutin/GL display for the femtovg renderer, the config picker iterates framebuffer configurations and must select one. If no configuration matches at all, glutin returned nothing usable and slint panics with this internal-error message.

Solutions

  1. Install/repair GPU drivers or Mesa (libgl1-mesa-dri, libegl1) so at least one framebuffer config is available
  2. Use the software renderer instead: `SLINT_BACKEND=winit-software` (or `--no-default-features` with renderer-software)
  3. If in CI, use xvfb with working GL (xvfb-run + Mesa llvmpipe) or skip GL tests
  4. Check requested graphics API / transparency settings that may over-constrain config selection

Example fix

// before (forces femtovg in a GPU-less CI)
$ SLINT_BACKEND=winit-femtovg cargo test
// after
$ SLINT_BACKEND=winit-software cargo test
Defensive patterns

Strategy: fallback

Validate before calling

// shell check before running a GL-backed app in CI
glxinfo | grep -q 'OpenGL version' || echo 'no usable GL; use software renderer'

Try / catch

// select renderer via env before slint init
if std::env::var("SLINT_BACKEND").is_err() && std::env::var("CI").is_ok() {
    std::env::set_var("SLINT_BACKEND", "winit-software");
}

Prevention

When it happens

Trigger: Running on a system where the GL driver/EGL/GLX exposes no compatible framebuffer configuration: headless servers without GPU, software GL lacking required configs, VMs without 3D acceleration, invalid requested graphics API or transparency requirements that filter out all configs.

Common situations: CI containers without a GPU or proper GL drivers (missing libGL/EGL); Wayland/X11 sessions with broken Mesa; running with `SLINT_BACKEND=winit-femtovg` on machines with only GL 1.x; remote X forwarding without GLX.

Understand the failure class

Background: "unsupported platform" / "not supported on this platform" errors: what they mean and how to fix them — this error's family across 47 libraries.

Related errors


AI-assisted analysis of slint-ui/slint@3a7e700487 (2026-09-16). Data as JSON: /api/errors/9a97bcbb04c663ca. Report an issue: GitHub.

Appendix: source

Thrown at internal/backends/winit/renderer/femtovg/glcontext.rs:90

        // Commented out due to https://github.com/rust-windowing/glutin/issues/1640
        #[cfg(target_os = "macos")]
        let config_template_builder = config_template_builder.with_transparency(true);

        let display_builder = glutin_winit::DisplayBuilder::new()
            .with_preference(glutin_winit::ApiPreference::FallbackEgl)
            .with_window_attributes(Some(window_attributes.clone()));
        let config_picker = |it: Box<dyn Iterator<Item = glutin::config::Config> + '_>| {
            it.reduce(|accum, config| {
                let transparency_check = config.supports_transparency().unwrap_or(false)
                    & !accum.supports_transparency().unwrap_or(false);

                if transparency_check || config.num_samples() < accum.num_samples() {
                    config
                } else {
                    accum
                }
            })
            .expect("internal error: Could not find any matching GL configuration")
        };
        let (window, gl_config) = display_builder
            .build(active_event_loop, config_template_builder, config_picker)
            .map_err(|glutin_err| {
                format!(
                    "Error creating OpenGL display ({:?}) with glutin: {}",
                    active_event_loop.display_handle(),
                    glutin_err
                )
            })?;

        let gl_display = gl_config.display();

        let raw_window_handle = window
            .as_ref()
            .map(|w| w.window_handle())
            .transpose()
            .map_err(|err| {

View on GitHub (pinned to 3a7e700487)