[X2Go-Commits] [[X2Go Wiki]] page changed: wiki:development:glx-xlib-workaround
wiki-admin at x2go.org
wiki-admin at x2go.org
Thu Aug 20 22:58:38 CEST 2020
A page in your DokuWiki was added or changed. Here are the details:
Date : 2020/08/20 20:58
Browser : Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36
IP-Address : 87.172.238.24
Hostname : p57acee18.dip0.t-ipconnect.de
Old Revision: https://wiki.x2go.org/doku.php/wiki:development:glx-xlib-workaround?rev=1597955061
New Revision: https://wiki.x2go.org/doku.php/wiki:development:glx-xlib-workaround
Edit Summary:
User : uli42
@@ -9,9 +9,58 @@
===== 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.
+ ==== Compile ====
+ The general way to build the required library is this (see also https://mesa3d.org/llvmpipe.html):
+ * download and extract tarball from mesa3d.org. Try with the
newest and go down to older versions if you have problems with the newer one
+ * ''cd mesa-<the version you downloaded>''
+ * ''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''
+ ==== Wrappers ===
+ Now you should find a libGL.so in ''src/gallium/targets/libgl-xlib''. This is the lib the your program need to load instead of the libGL of the system.
+
+ Copy ''the src/gallium/targets/libgl-xlib'' directory to a place of your preference. Create two wrapper scripts ''~/x2goglx'' and ''~/x2goglx2''
+
+ ''x2goglx'':
+ <code>
+ #!/bin/sh
+ export LD_LIBRARY_PATH=<your directory>/libgl-xlib:${LD_LIBRARY_PATH}
+ exec "$@"
+ </code>
+
+ ''x2goglx2'':
+ <code>
+ #!/bin/sh
+ export LD_PRELOAD=<your directory>/libgl-xlib/libGL.so
+ exec "$@"
+ </code>
+
+ Make them executable and test them:
+ <code>
+ $ chmod u+rx
x2goglx*
+ $ x2goglx glxinfo
+ $ x2goglx2 glxinfo
+ </code>
+
+ Watch the output of the two glxinfo calls. You should see references to your mesa version and you should also see it reporting "GLX version: 1.4".
+
+ Instead of creating the scripts mentioned above you can also add this to your .bashrc (or the config of your favourite shell):
+ <code>
+ export LD_LIBRARY_PATH=<your director>:${LD_LIBRARY_PATH}
+ </code>
+
+ ==== Usage ===
+ Now you can use one of these created wrapper scripts to run your application: ''x2goglx <your application>''. Some apps modify ''LD_LIBRARY_PATH'' so the ''x2goglx'' could have no effect. In that case try ''x2goglx2''.
+
+ If you still cannot succeed you can try to find your if your application needs some special treatment. If so, please add the solution to the end of this page or post it to the mailinglist for some to add it.
+
+
+ ===== Versions / Platforms =====
+ The following chapters give some hints on how to compile the library on
various combinations of platforms and mesa versions.
==== Mesa 19 and newer ====
Please note: the instructions below are valid for older 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>
@@ -30,24 +79,8 @@
$ 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:${LD_LIBRARY_PATH} exec "$@"
- </code>
-
- <code>
- $ chmod u+rx x2goglx
- $ x2goglx glxinfo
- </code>
-
- Some software modifies
LD_LIBRARY_PATH itself. In that case you might be successful with LD_PRELOAD. Instead of setting LD_LIBRARY_PATH point to a directory you set LD_PRELOAD to point to the generated library itself:
- <code>
- #!/bin/sh
- LD_PRELOAD=<your directory>/libgl-xlib/libGL.so exec "$@"
- </code>
==== Ubuntu 14.04 ====
(with trusty-updates mesa 10.1.3-0ubuntu0.3)
@@ -99,9 +132,10 @@
<code>
ebuild "/usr/portage/media-libs/mesa/mesa-${mesa_version}.ebuild" clean
</code>
- ===== Matlab 2019b =====
+ ===== Applications =====
+ ==== 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/
--
This mail was generated by DokuWiki at
https://wiki.x2go.org/
More information about the x2go-commits
mailing list