Page 1 of 1

"Failed to create OpenGL context"

Posted: Mon Nov 06, 2023 4:24 pm
by mcgiwer
OS: Debian 13
Factorio version: 1.1.94 (Linux)
OpenGL and latest drivers installed: yes

Hello. I had just downloaded Factorio and after unpacking, I tryed to run it, I had recieven an output:

Code: Select all

 0.019 2023-11-06 16:20:29; Factorio 1.1.94 (build 61774, linux64, full)
   0.037 Operating system: Linux (Debian 13)
   0.037 Program arguments: "./factorio" 
   0.037 Config path: [trunchated_path]/config/config.ini
   0.037 Read data path: [trunchated_path]/data
   0.037 Write data path: [trunchated_path]/factorio [273060/300264MB]
   0.037 Binaries path: [trunchated_path]/factorio
   0.052 System info: [CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 5000+, 2 cores, RAM: 3786 MB]
   0.052 Environment: DISPLAY=:0 WAYLAND_DISPLAY=:0 DESKTOP_SESSION=LXDE XDG_SESSION_DESKTOP=LXDE XDG_CURRENT_DESKTOP=LXDE __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.052 Display options: [FullScreen: 1] [VSync: 1] [UIScale: automatic (100.0%)] [Native DPI: 1] [Screen: 255] [Special: lmw] [Lang: en]
   0.284 Video driver: x11
   0.284 Available displays: 1
   0.284  [0]: VGA-0 - {[0,0], 1024x768, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.439 Error Util.cpp:86: Failed to create OpenGL context: Could not create GL context: GLXBadFBConfig
   3.451 Goodbye

Re: "Failed to create OpenGL context"

Posted: Tue Nov 07, 2023 5:04 pm
by vinzenz
Wow that CPU brings back memories, may I ask which GPU your are using in you system?

It‘s most likely that current Factorio doesnt support your system. You might have better luck with older versions though: https://factorio.com/download/archive/

Keep in mind that your CPU was released about 5-6 years before Factorio development started.

Re: "Failed to create OpenGL context"

Posted: Wed Nov 08, 2023 11:42 am
by mcgiwer
may I ask which GPU your are using in you system?
I guess the one listed.

It's strange, but before I had updated my system, factorio worked very well

Re: "Failed to create OpenGL context"

Posted: Wed Nov 08, 2023 12:09 pm
by FuryoftheStars
mcgiwer wrote: Wed Nov 08, 2023 11:42 am
may I ask which GPU your are using in you system?
I guess the one listed.
Is it using the CPU as graphics? Because otherwise the "one listed" in that log is actually blank where the name usually is.

[Linux] Fix:Failed to create OpenGL context: GLXBadFBConfig

Posted: Wed Nov 08, 2023 12:39 pm
by mcgiwer
To fix the issue (with is the base of this post), I had found a working fix:

Enter the "/etc/bash.bashrc" file and add following lines:

Code: Select all

if [ -z "${MESA_GL_OVERRIDE}" ]; then export MESA_GL_VERSION_OVERRIDE=4.5; fi
Check also if you have the latest graphic card drivers and OpenGL installed.

After that, restart the desktop (or PC/Laptop). The message should not appear again.

Re: "Failed to create OpenGL context"

Posted: Fri Mar 06, 2026 1:42 am
by traycer
Just wanted to pop in to say your comment worked perfectly for me! I just revived a nearly 15-year-old Thinkpad X220. First thing to go on was Linux Mint. Second thing was Factorio.

Code: Select all

$ ./factorio 
   0.000 2026-03-05 20:37:58; Factorio 2.0.73 (build 84377, linux64, demo)
   0.013 Operating system: Linux (Linuxmint 22.3)
   0.013 Program arguments: "./factorio" 
   0.013 Config path: /home/taob/Games/Factorio/config/config.ini
   0.013 Read data path: /home/taob/Games/Factorio/data
   0.013 Write data path: /home/taob/Games/Factorio [37104/55526MB]
   0.013 Binaries path: /home/taob/Games/Factorio/bin
   0.024 System info: [CPU:        Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz, 4 cores, RAM: 7823 MB]
   0.024 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=cinnamon XDG_SESSION_DESKTOP=cinnamon XDG_CURRENT_DESKTOP=X-Cinnamon SDL_VIDEODRIVER=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.025 Display options: [FullScreen: true] [VSync: true] [UIScale: manual-pixels (100.0%)] [Native DPI: true] [Screen: 255] [Special: lmw] [Lang: en]
   0.059 Video driver: x11
   0.059 Available displays: 1
   0.059  [0]: 0 - {[0,0], 1366x768, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.438 Error Util.cpp:81: Failed to create OpenGL context: Could not create GL context: GLXBadFBConfig
   3.105 Goodbye

$ export MESA_GL_VERSION_OVERRIDE=4.5
$  ./factorio 
   0.000 2026-03-05 20:40:17; Factorio 2.0.73 (build 84377, linux64, demo)
   0.012 Operating system: Linux (Linuxmint 22.3)
   0.012 Program arguments: "./factorio" 
   0.012 Config path: /home/taob/Games/Factorio/config/config.ini
   0.012 Read data path: /home/taob/Games/Factorio/data
   0.012 Write data path: /home/taob/Games/Factorio [37104/55526MB]
   0.012 Binaries path: /home/taob/Games/Factorio/bin
   0.025 System info: [CPU:        Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz, 4 cores, RAM: 7823 MB]
   0.025 Environment: DISPLAY=:0 WAYLAND_DISPLAY=<unset> DESKTOP_SESSION=cinnamon XDG_SESSION_DESKTOP=cinnamon XDG_CURRENT_DESKTOP=X-Cinnamon SDL_VIDEODRIVER=<unset> __GL_FSAA_MODE=<unset> __GL_LOG_MAX_ANISO=<unset> __GL_SYNC_TO_VBLANK=<unset> __GL_SORT_FBCONFIGS=<unset> __GL_YIELD=<unset>
   0.025 Display options: [FullScreen: true] [VSync: true] [UIScale: manual-pixels (100.0%)] [Native DPI: true] [Screen: 255] [Special: lmw] [Lang: en]
   0.063 Video driver: x11
   0.063 Available displays: 1
   0.063  [0]: 0 - {[0,0], 1366x768, SDL_PIXELFORMAT_RGB888, 60Hz}
   0.329 Initialised OpenGL:[0] Mesa Intel(R) HD Graphics 3000 (SNB GT2); driver: 4.5 (Core Profile) Mesa 25.2.8-0ubuntu0.24.04.1
   0.329   [Extensions] s3tc:yes; KHR_debug:yes; ARB_clear_texture:yes, ARB_copy_image:yes, ARB_pipeline_statistics_query:yes, ARB_gl_spirv:NO, ARB_ES2_compatibility:yes
   0.329   [Version] 4.5
   0.368 Graphics settings preset: very-high
   0.368   Dedicated video memory size 7823 MB (detected from llvmpipe (LLVM 20.1.2, 256 bits); VendorID: 0x10005)
   0.396 Graphics options: [Graphics quality: medium] [Video memory usage: medium] [DXT: low-quality]
   0.396                   [Max threads (load/render): 32/4] [Max texture size: 4096] [Tex.Stream.: true] [Rotation quality: low] [Other: STDCwtl] [B:0,C:0,S:100]