User Tools

Site Tools


wiki:development:glx-xlib-workaround

This is an old revision of the document!


Workaround for getting GLX 1.4 working

Symptoms

  • Gnome-based and other applications report messages like “Failed to initialize gtk+: Unable to initialize the Clutter backend: no available drivers found.”
  • glxinfo reports GLX Version is 1.2
  • Disabling GLX entirely in /etc/x2go/x2goagent.options via -extension GLX does not work because the application does not have the capability to work without GLX at all.

Approach

Use a wrapper/proxy library provided by Mesa. The applications will use the supplied libGL.so, which in turn uses the lib interface to talk to the X server (nxagent) rather than the GLX interface. From the applications' perspective, they have GLX 1.4.

Mesa 19 and newer

Please note: the instructions below are not current anymore since Mesa now mainly uses meson for building. Please consult https://mesa3d.org/llvmpipe.html for a basic compilation instruction. Since those instructions will not work out of the box (Error: “gallium-xlib conflicts with any dri driver”) as of Mesa 19.3.2 you need to call meson with some further parameters:

$ 
$ meson -D glx=gallium-xlib -D gallium-drivers=swrast -D platforms=x11 -D dri3=false -D dri-drivers="" -D vulkan-drivers="" -D buildtype=release -D optimization=3
$ ninja

Debian Buster and Mesa 19.3.2

$ (download and extract tarball from mesa3d.org)
$ cd mesa-19.3.2
$ mkdir build
$ cd build
$ meson -D glx=gallium-xlib -D gallium-drivers=swrast -D platforms=x11 -D dri3=false -D dri-drivers="" -D vulkan-drivers="" -D buildtype=release -D optimization=3
$ ninja
$ LD_LIBRARY_PATH=`pwd`/build/linux-x86_64-debug/gallium/targets/libgl-xlib/:${LD_LIBRARY_PATH} glxinfo | grep 'GLX version:'

Ubuntu 14.04

(with trusty-updates mesa 10.1.3-0ubuntu0.3)

sudo aptitude build-dep mesa
sudo aptitude install scons llvm-dev
apt-get source mesa
cd mesa
scons libgl-xlib
export LD_LIBRARY_PATH=`pwd`/build/linux-x86_64-debug/gallium/targets/libgl-xlib/:${LD_LIBRARY_PATH}
glxinfo | grep 'GLX version:'

Gentoo

Ensure that some required tools are installed:

emerge -1av app-portage/gentoolkit dev-util/scons dev-python/mako

Create a place to store the library - adapt this path to your liking.

mkdir -p /usr/local/share/mesa-libgl-xlib

Place the following line in a suitable place - either in your .bashrc or in the script that calls the individual application:

export LD_LIBRARY_PATH=/usr/local/share/mesa-libgl-xlib/:${LD_LIBRARY_PATH}

Configure portage to extract and patch the Mesa package into a known location. Before doing so, ensure that the USE flags for media-libs/mesa are configured to your liking.

mesa_version="$(equery -q list media-libs/mesa -F '$version')"
ebuild "/usr/portage/media-libs/mesa/mesa-${mesa_version}.ebuild" prepare

Now compile the library and move it over to the storage location:

cd "/var/tmp/portage/media-libs/mesa-${mesa_version}/work/mesa-${mesa_version}"
scons libgl-xlib
cp -av build/linux-x86_64-debug/gallium/targets/libgl-xlib/* /usr/local/share/mesa-libgl-xlib/

Cleanup:

ebuild "/usr/portage/media-libs/mesa/mesa-${mesa_version}.ebuild" clean
wiki/development/glx-xlib-workaround.1579804083.txt.gz · Last modified: 2020/01/23 18:28 by uli42