Xlib: extension "GLX" missing on display ":0"


I am trying to run OGRE3D graphics engine (www.ogre3d.org, source code can be found in www.github.com/OGRECave/ogre) in an Apalis iMX8QM. I managed to compile it inside a docker container, whose Dockerfile is the following:

FROM --platform=linux/arm64 torizon/wayland-base-vivante:2 AS base
RUN apt-get -y update && apt-get install -y --no-install-recommends \
    apt-utils \
    && apt-mark hold dash && apt-get -y upgrade && apt-mark unhold dash \
    && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
RUN apt-get -y update && apt-get install -y --no-install-recommends \
    libwayland-client0 \
    libwayland-server0 \
    libgal-vivante1 \
    libvsc-vivante1 \
    libgbm-vivante1 \
    libegl-vivante1 \
    libgl-vivante1 \
    libglesv2-vivante1 \
    libglesv1-cm-vivante1 \
    libglslc-vivante1 \
    && apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
# Make sure the user can access DRM and video devices
RUN usermod -a -G video,render torizon
RUN apt-get -y update && apt-get install -y git cmake gcc g++ make libxrandr-dev libglu1-mesa-dev libzip-dev libfreeimage-dev libpoco-dev libois-dev libzzip-0-13 libzzip-dev doxygen libcgal>
USER torizon
RUN cd /home/torizon/ && git clone https://github.com/OGRECave/ogre
USER root
RUN apt-get install -y libsdl2-2.0
USER torizon
 RUN mkdir -p /home/torizon/ogre/bld && cd /home/torizon/ogre/bld && cmake -DCMAKE_BUILD_TYPE=Debug -DOGRE_BUILD_RENDERSYSTEM_GLES2=1 -DOGRE_BUILD_SAMPLES=1 -DOGRE_CONFIG_THREADS=0 -DOGRE_INS

RUN cd /home/torizon/ogre/bld && make -j4
USER root
RUN cd /home/torizon/ogre/bld && make install

Here I try to run SampleBrowser, a sample application that gets compiled when you compile the graphics engine. I ran it through gdb to see the backtrace and show where it crashes. Also you can see the error message:

Xlib: extension “GLX” missing on display “:0.0”.

torizon@7f7ab3404e09:~/ogre/bld/bin$ gdb SampleBrowser
GNU gdb (Debian 9.2-1) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
Find the GDB manual and other documentation resources online at:

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from SampleBrowser...
(gdb) catch throw
Catchpoint 1 (throw)
(gdb) r
Starting program: /home/torizon/ogre/bld/bin/SampleBrowser
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Creating resource group General
Creating resource group OgreInternal
Creating resource group OgreAutodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Skeleton
MovableObjectFactory for type 'ParticleSystem' registered.
ArchiveFactory for archive type FileSystem registered.
ArchiveFactory for archive type Zip registered.
ArchiveFactory for archive type EmbeddedZip registered.
DDS codec registering
ETC codec registering
ASTC codec registering
Registering ResourceManager for type HighLevelGpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
Loading library /home/torizon/ogre/bld/lib/RenderSystem_GLES2.so.1.12.12
Installing plugin: OpenGL ES 2.0 RenderSystem
OpenGL ES 2.x Rendering Subsystem created.
Xlib:  extension "GLX" missing on display ":0.0".

Program received signal SIGSEGV, Segmentation fault.
0x0000fffff6b5aad8 in glXGetFBConfigs () from /usr/lib/aarch64-linux-gnu/libGL.so.1.2
(gdb) bt
#0  0x0000fffff6b5aad8 in glXGetFBConfigs () from /usr/lib/aarch64-linux-gnu/libGL.so.1.2
#1  0x0000fffff6b5ce84 in glXChooseFBConfigSGIX () from /usr/lib/aarch64-linux-gnu/libGL.so.1.2
#2  0x0000fffff6c62490 in Ogre::GLXGLSupport::chooseFBConfig (this=0xaaaaaab165c0, attribList=0x0, nElements=0xffffffffe8c0)
    at /home/torizon/ogre/RenderSystems/GLSupport/src/GLX/OgreGLXGLSupport.cpp:522
#3  0x0000fffff6c61574 in Ogre::GLXGLSupport::GLXGLSupport (this=0xaaaaaab165c0, profile=4) at /home/torizon/ogre/RenderSystems/GLSupport/src/GLX/OgreGLXGLSupport.cpp:135
#4  0x0000fffff6c61208 in Ogre::getGLSupport (profile=4) at /home/torizon/ogre/RenderSystems/GLSupport/src/GLX/OgreGLXGLSupport.cpp:64
#5  0x0000fffff6c3e7c0 in Ogre::GLES2RenderSystem::GLES2RenderSystem (this=0xaaaaaab15bb0) at /home/torizon/ogre/RenderSystems/GLES2/src/OgreGLES2RenderSystem.cpp:178
#6  0x0000fffff6c3e114 in Ogre::GLES2Plugin::install (this=0xaaaaaab15b30) at /home/torizon/ogre/RenderSystems/GLES2/src/OgreGLES2Plugin.cpp:48
#7  0x0000fffff79c026c in Ogre::Root::installPlugin (this=0xaaaaaab00b20, plugin=0xaaaaaab15b30) at /home/torizon/ogre/OgreMain/src/OgreRoot.cpp:1188
#8  0x0000fffff6c2b1c4 in Ogre::dllStartPlugin () at /home/torizon/ogre/RenderSystems/GLES2/src/OgreGLES2EngineDll.cpp:41
#9  0x0000fffff79c064c in Ogre::Root::loadPlugin (this=0xaaaaaab00b20, pluginName="/home/torizon/ogre/bld/lib/RenderSystem_GLES2") at /home/torizon/ogre/OgreMain/src/OgreRoot.cpp:1237
#10 0x0000fffff79bf2c4 in Ogre::Root::loadPlugins (this=0xaaaaaab00b20, pluginsfile="./plugins.cfg") at /home/torizon/ogre/OgreMain/src/OgreRoot.cpp:973
#11 0x0000fffff79bc9ac in Ogre::Root::Root (this=0xaaaaaab00b20, pluginFileName="./plugins.cfg", configFileName="./ogre.cfg", logFileName="./ogre.log")
    at /home/torizon/ogre/OgreMain/src/OgreRoot.cpp:227
#12 0x0000fffff7f76d9c in OgreBites::ApplicationContextBase::createRoot (this=0xfffffffff238) at /home/torizon/ogre/Components/Bites/src/OgreApplicationContextBase.cpp:191
#13 0x0000fffff7f7669c in OgreBites::ApplicationContextBase::initApp (this=0xfffffffff238) at /home/torizon/ogre/Components/Bites/src/OgreApplicationContextBase.cpp:55
#14 0x0000aaaaaaab6b28 in OgreBites::SampleContext::go (this=0xfffffffff238, initialSample=0x0) at /home/torizon/ogre/Samples/Common/include/SampleContext.h:143
#15 0x0000aaaaaaab44e4 in main (argc=1, argv=0xfffffffff648) at /home/torizon/ogre/Samples/Browser/src/main.cpp:89

I run the container with the following command:

docker run -e ACCEPT_FSL_EULA=1 -e X11_UNIX_SOCKET=/tmp/.X11-unix -e WAYLAND_DISPLAY=wayland-0 -e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR -e DISPLAY=:0 -it --rm --name=wayland-app --user=torizon -v /dev/dri:/dev/dri -v /dev/galcore:/dev/galcore -v /tmp:/tmp -v /run/:/run/ --device-cgroup-rule='c 199:* rmw' --device-cgroup-rule='c 226:* rmw' --cap-add=SYS_PTRACE --security-opt seccomp=unconfined ogre-way-base

Maybe some env variables aren’t needed, but I added them trying to make it run.
If useful, this is env command output inside the container:

torizon@a5e5021d45e9:/$ env

I tried running x11 applications, like xeyes or xclock and they run fine.

I would like to know if there is any problem with my configuration, or if there’s something like GLX that isn’t supported, or what I should do in order to solve this. I am asking that here because I think the problem isn’t related to Ogre, as I saw in the backtrace where the application crashes.

Thank you in advance

Greetings @tomas.ayi,

Hmm I don’t believe there is an issue with GLX, or at least not a known issue.

What happens if you try to run other GLX-based utilities? Like glxgears for example. Also is there any useful info if you try to run glxinfo?

Best Regards,

Hi Jeremias, thank you for your fast reply.

This is the output from glxgears:

torizon@e374aeebd4f9:/$ glxgears
Xlib:  extension "GLX" missing on display ":0".
Error: couldn't get an RGB, Double-buffered visual

I forgot to mention that I tried DISPLAY=:0, DISPLAY=:0.0, DISPLAY=:0.1, DISPLAY=:1.0, DISPLAY=:1.1 and DISPLAY=:1, all with glxgears and with Ogre’s SampleBrowser, with the same results.

The output from glxinfo is:

torizon@e374aeebd4f9:/$ glxinfo
name of display: :0
Xlib:  extension "GLX" missing on display ":0".
Xlib:  extension "GLX" missing on display ":0".
Segmentation fault

With a DISPLAY different from :0 or :0.0, the error is:

torizon@e374aeebd4f9:/$ glxinfo
Error: unable to open display :0.1

I did some further research and ran this across with the team internally. Unfortunately this might not be as simple as it seems.

To summarize, OpenGL with GLX is tied to X11. X11 isn’t something that the i.MX8 graphic drivers support. Not to say that it isn’t impossible but you’d require some additional logic or in-between software that uses opengles which should work with i.MX8 graphics. Either way that is to say this won’t work out of the box as is.

As for your end goal of running OGRE 3D, it seems there may be some possibilities. Upon quick look it seems in the specs of OGRE V1.X there is support for opengles2. (not sure how well versions of everything involved match up though). I’m not familiar with OGRE but there seems to be a way to perhaps configure/build it differently.

Best Regards,

Dear Jeremias,

Is there any update on the support of GLX on iMX8 ?

This thread from April 2018 says it is not supported on iMX8 but on iMX6 and iMX7

Could you updated on this ?

Best regards,

Hi @fdortu,

As far as I’m aware this has not changed. NXP still does not provide X11 support for their i.MX8* SoCs and I don’t believe they plan to honestly.

Your only hope in this case would be future open-source graphics drivers for the i.MX8 that has such support.

Best Regards,