a-b-street/abstreet · critical
Your videocard doesn't support the OpenGL mode requested…
Error message
Your videocard doesn't support the OpenGL mode requested. This is a common issue when running inside a virtual machine; please run natively if possible. See https://github.com/a-b-street/abstreet/issues/103 for more info, and feel free to ask for help using that issue.\n\nError: {:?} What it means
widgetry's glutin/glow backend tries to build an OpenGL windowed context, falling back to a vsync-enabled context if the default fails. If both fail, it panics: the GPU/driver cannot provide the requested OpenGL (3.x/GLSL 300 es) context — common in VMs or with missing/mesa-only drivers.
Solutions
- Run natively (not in a VM) or enable 3D GPU acceleration/passthrough for the VM
- Update the GPU driver, or install Mesa with software rendering (LIBGL_ALWAYS_SOFTWARE=1) as a fallback
- Ensure a display/GLX/EGL context is available (run under X, not bare SSH/headless)
- Check issue #103 (linked in the message) for known workarounds and ask there
Example fix
// run with software rendering as a workaround LIBGL_ALWAYS_SOFTWARE=1 cargo run --bin game
Defensive patterns
Strategy: fallback
Validate before calling
// before launching the app, probe GL support
eprintln!("GL_VENDOR={:?} GL_RENDERER={:?}", std::env::var("GALLIUM_DRIVER"), std::env::var("LIBGL_ALWAYS_SOFTWARE")); Try / catch
// detect context creation failure early
let ctx = glutin::ContextBuilder::new().build_windowed(window.clone(), &event_loop);
if ctx.is_err() {
eprintln!("GPU context unavailable; try LIBGL_ALWAYS_SOFTWARE=1 or run natively");
} Prevention
- Avoid VMs without 3D acceleration for graphics apps
- Keep GPU/Mesa drivers current
- Run under a display server (X/Wayland), not headless SSH
- Consult the linked GitHub issue (#103) for known workarounds
When it happens
Trigger: Launching any widgetry app on a machine whose videocard/driver can't create the requested OpenGL context — default and vsync ContextBuilder both fail in build_windowed.
Common situations: Running inside a VM without GPU passthrough; headless CI machines; outdated or software-only graphics drivers; missing X display / Wayland quirks; old GPUs.
Related errors
AI-assisted analysis of a-b-street/abstreet@0964f29315 (2026-09-13).
Data as JSON: /api/errors/11507be5099e2356.
Report an issue: GitHub.
Appendix: source
Thrown at widgetry/src/backend_glow_native.rs:28
// backend_glium.rs from git and bring the fallback behavior here. (Ideally, there'd be
// something in glutin to directly express this.)
let context = glutin::ContextBuilder::new()
// 2 looks really bad, 4 looks alright. For thin lines at low zoom, 8 looks better, and
// should have common videocard support.
.with_multisampling(8)
.with_depth_buffer(2)
.build_windowed(window.clone(), &event_loop)
.or_else(|err| {
warn!("Trying default graphics context after standard graphics context failed with error: {:?}", err);
glutin::ContextBuilder::new().build_windowed(window.clone(), &event_loop)
})
.or_else(|err| {
warn!("Trying graphics context with vsync after default graphics context failed with error: {:?}", err);
glutin::ContextBuilder::new()
.with_vsync(true)
.build_windowed(window.clone(), &event_loop)
}).unwrap_or_else(|err| {
panic!("Your videocard doesn't support the OpenGL mode requested. This is a common issue when running inside a virtual machine; please run natively if possible. See https://github.com/a-b-street/abstreet/issues/103 for more info, and feel free to ask for help using that issue.\n\nError: {:?}", err);
});
let windowed_context = unsafe { context.make_current().unwrap() };
let gl = unsafe {
glow::Context::from_loader_function(|s| windowed_context.get_proc_address(s) as *const _)
};
let program = unsafe {
build_program(
&gl,
include_str!("../shaders/vertex_140.glsl"),
include_str!("../shaders/fragment_140.glsl"),
)
.or_else(|err| {
warn!(
"unable to build program with default shaderrs, falling back to v300. error: {:?}",
err
);View on GitHub (pinned to 0964f29315)