{"record":{"id":"11507be5099e2356","repo":"a-b-street/abstreet","slug":"your-videocard-doesn-t-support-the-opengl-mode-requested","errorCode":null,"errorMessage":"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: {:?}","messagePattern":"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: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"widgetry/src/backend_glow_native.rs","lineNumber":28,"sourceCode":"    // backend_glium.rs from git and bring the fallback behavior here. (Ideally, there'd be\n    // something in glutin to directly express this.)\n    let context = glutin::ContextBuilder::new()\n        // 2 looks really bad, 4 looks alright. For thin lines at low zoom, 8 looks better, and\n        // should have common videocard support.\n        .with_multisampling(8)\n        .with_depth_buffer(2)\n        .build_windowed(window.clone(), &event_loop)\n        .or_else(|err| {\n            warn!(\"Trying default graphics context after standard graphics context failed with error: {:?}\",  err);\n            glutin::ContextBuilder::new().build_windowed(window.clone(), &event_loop)\n        })\n        .or_else(|err| {\n            warn!(\"Trying graphics context with vsync after default graphics context failed with error: {:?}\", err);\n            glutin::ContextBuilder::new()\n                .with_vsync(true)\n                .build_windowed(window.clone(), &event_loop)\n        }).unwrap_or_else(|err| {\n        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);\n    });\n\n    let windowed_context = unsafe { context.make_current().unwrap() };\n    let gl = unsafe {\n        glow::Context::from_loader_function(|s| windowed_context.get_proc_address(s) as *const _)\n    };\n\n    let program = unsafe {\n        build_program(\n            &gl,\n            include_str!(\"../shaders/vertex_140.glsl\"),\n            include_str!(\"../shaders/fragment_140.glsl\"),\n        )\n        .or_else(|err| {\n            warn!(\n                \"unable to build program with default shaderrs, falling back to v300. error: {:?}\",\n                err\n            );","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/a-b-street/abstreet/blob/0964f29315820c91b171b585eb51e300164e9197/widgetry/src/backend_glow_native.rs#L10-L46","documentation":"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.","triggerScenarios":"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.","commonSituations":"Running inside a VM without GPU passthrough; headless CI machines; outdated or software-only graphics drivers; missing X display / Wayland quirks; old GPUs.","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"],"exampleFix":"// run with software rendering as a workaround\nLIBGL_ALWAYS_SOFTWARE=1 cargo run --bin game","handlingStrategy":"fallback","validationCode":"// before launching the app, probe GL support\neprintln!(\"GL_VENDOR={:?} GL_RENDERER={:?}\", std::env::var(\"GALLIUM_DRIVER\"), std::env::var(\"LIBGL_ALWAYS_SOFTWARE\"));","typeGuard":null,"tryCatchPattern":"// detect context creation failure early\nlet ctx = glutin::ContextBuilder::new().build_windowed(window.clone(), &event_loop);\nif ctx.is_err() {\n    eprintln!(\"GPU context unavailable; try LIBGL_ALWAYS_SOFTWARE=1 or run natively\");\n}","preventionTips":["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"],"tags":["opengl","graphics","glutin","gpu","vm"],"backgroundTag":"module-init-failed","analyzedSha":"0964f29315820c91b171b585eb51e300164e9197","analyzedAt":"2026-09-13T18:02:03.421Z","contentChangedAt":"2026-09-13T18:02:03.421Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}