User Tools

Site Tools


wiki:development:glx-xlib-workaround

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:development:glx-xlib-workaround [2017/11/04 11:27]
ionic Don't build the full MESA suite first, use the ebuild tool directly.
wiki:development:glx-xlib-workaround [2020/06/02 19:13] (current)
uli42
Line 11: Line 11:
 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. 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 valid for olter Mesa releases. In Mesa 19 //meson// is recommended 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 like this:
 +<​code>​
 +$ 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
 +</​code>​
 +
 +==== Debian Buster and Mesa 19.3.2 ====
 +
 +<​code>​
 +$ (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`/​src/​gallium/​targets/​libgl-xlib/:​${LD_LIBRARY_PATH} glxinfo | grep 'GLX version:'​
 +</​code>​
 +
 +If you want you can copy the libgl-xlib directory to some location of your likes and write a small wrapper "​x2goglx"​ for starting GLX applications:​
 +<​code>​
 +#!/bin/sh
 +LD_LIBRARY_PATH=<​your directory>/​libgl-xlib exec "​$@"​
 +</​code>​
 +
 +<​code>​
 +$ chmod u+rx x2goglx
 +$ x2goglx glxinfo
 +</​code>​
 ==== Ubuntu 14.04 ==== ==== Ubuntu 14.04 ====
  
Line 30: Line 61:
  
 <​code>​ <​code>​
-emerge -av app-portage/​gentoolkit dev-util/​scons dev-python/​mako+emerge -1av app-portage/​gentoolkit dev-util/​scons dev-python/​mako
 </​code>​ </​code>​
  
Line 37: Line 68:
 mkdir -p /​usr/​local/​share/​mesa-libgl-xlib mkdir -p /​usr/​local/​share/​mesa-libgl-xlib
 </​code>​ </​code>​
 +
 Place the following line in a suitable place - either in your .bashrc or in the script that calls the individual application:​ Place the following line in a suitable place - either in your .bashrc or in the script that calls the individual application:​
 <​code>​ <​code>​
Line 42: Line 74:
 </​code>​ </​code>​
  
-Configure portage to keep the working area that is used to compile ​the Mesa package. Before doing so, ensure that the USE flags for media-libs/​mesa are configured to your liking.+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.
  
 <​code>​ <​code>​
-export MESA_VERSION=$(equery -q list media-libs/​mesa -F '​$version'​) +mesa_version="$(equery -q list media-libs/​mesa -F '​$version'​)" 
-ebuild "/​usr/​portage/​media-libs/​mesa/​mesa-${MESA_VERSION}.ebuild"​ prepare+ebuild "/​usr/​portage/​media-libs/​mesa/​mesa-${mesa_version}.ebuild"​ prepare
 </​code>​ </​code>​
  
 Now compile the library and move it over to the storage location: Now compile the library and move it over to the storage location:
 <​code>​ <​code>​
-cd /​var/​tmp/​portage/​media-libs/​mesa-${MESA_VERSION}/​work/​mesa-${MESA_VERSION}+cd "/​var/​tmp/​portage/​media-libs/​mesa-${mesa_version}/​work/​mesa-${mesa_version}"
 scons libgl-xlib scons libgl-xlib
-cp build/​linux-x86_64-debug/​gallium/​targets/​libgl-xlib/​* /​usr/​local/​share/​mesa-libgl-xlib/​+cp -av build/​linux-x86_64-debug/​gallium/​targets/​libgl-xlib/​* /​usr/​local/​share/​mesa-libgl-xlib/​
 </​code>​ </​code>​
  
Line 59: Line 91:
  
 <​code>​ <​code>​
-ebuild /​usr/​portage/​media-libs/​mesa/​mesa-${MESA_VERSION}.ebuild clean+ebuild ​"/​usr/​portage/​media-libs/​mesa/​mesa-${mesa_version}.ebuild" ​clean
 </​code>​ </​code>​
 +
 +===== Matlab 2019b =====
 +
 +Compile like this:
 +<​code>​
 +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 -Dprefix=/​usr/​local/​mesa-20.1.0/​
 +</​code>​
 +
 +To make Matlab load the new driver modify Matlab'​s lib search path:
 +cp $MATLAB_DIRECTORY/​bin/​.matlab7rc.sh ~
 +
 +Edit the file ~/​.matlab7rc.sh,​ find the glnxa* section and add ''/​usr/​local/​mesa-20.1.0/​lib/​x86_64-linux-gnu''​ to LDPATH_PREFIX
 +
 +Add to your .profile: export MESA_GL_VERSION_OVERRIDE=3.0
wiki/development/glx-xlib-workaround.1509794840.txt.gz · Last modified: 2017/11/04 11:27 by ionic