Running defold on linux with old OpenGL drivers

Let me share a hint on a workaround for running defold on a linux machine with outdated opengl drivers.

Since the recent upgrade of the OpenGL version needed by defold (i think it now needs 3.1) i had trouble running any defold project. I got the following error:

INFO:ENGINE: Defold Engine 1.2.181 (ff5b94e)
INFO:DLIB: Writing log to: ./log.txt
Unable to create OpenGL context
FATAL:ENGINE: Could not open window (-2).
INFO:CRASH: Using libunwind.a

I enabled software opengl rendering by running Defold with LIBGL_ALWAYS_SOFTWARE=1 environment variable:

~/bin/Defold$ LIBGL_ALWAYS_SOFTWARE=1 ./Defold

Without being an expert on the field, it seems there is a software implementation of opengl by vmware which can be used. Btw, here is the output of glxinfo with default and software rendering enabled:

Default drivers

$ glxinfo | grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics (ILK)
OpenGL version string: 2.1 Mesa 20.0.8
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:

Software driver

$ LIBGL_ALWAYS_SOFTWARE=1 glxinfo | grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 10.0.0, 128 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.1 Mesa 20.0.8
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:
4 Likes

What kind of performance are you getting with software rendering?

Well, it’s a little bit faster :smile: . But it’s not that smooth. As if there were no vsync.

Also consider that i have an old laptop and the acceleration should be pretty elementary even when it works.

1 Like