I finally figured it out! Now I can run Matlab R2019b on Ubuntu 18.04 LTS with decent graphics performance over x2go, even with transparency using the Mesa llvmpipe software OpenGL driver.
Benchmark for a simple scene:
No transparency: ~40 ms per frame With transparency: ~58 ms per frmae
So still some performance penalty for transparency, but much better.
HOWTO:
First install LLVM: sudo apt install llvm-dev
I downloaded mesa-20.1.0 (latest version right now) and configured it like this (in the unzipped source directory):
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 -Dprefix=/usr/local/mesa-20.1.0/
Then I built and installed it as follows: ninja sudo ninja install
Then to make Matlab load the new driver, I needed to 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
Seems like anything will work for the version override except for 3.1, but I didn't debug this further.
— Johannes Töger
Associate Senior Lecturer Cardiac MR Group Department of Clinical Sciences Lund, Clinical Physiology Lund University, Sweden
-----Original Message----- From: Ulrich Sibiller <uli42@gmx.de> Sent: Wednesday, May 27, 2020 14:29 To: Johannes Töger <johannes.toger@med.lu.se> Subject: Re: [X2Go-User] Matlab graphics performance when running in x2go
Thanks!
On Wed, May 27, 2020 at 1:59 PM Johannes Töger <johannes.toger@med.lu.se> wrote:
Thanks, I have included that in the wiki: https://wiki.x2go.org/doku.php/wiki:development:glx-xlib-workaround#matlab_2...
Uli
On Tue, Jun 2, 2020 at 8:56 PM Johannes Töger <johannes.toger@med.lu.se> wrote:
I just did some more testing, and found some rare crashes. Using MESA_GL_VERSION_OVERRIDE=3.1COMPAT seems more stable.
— Johannes Töger
Associate Senior Lecturer Cardiac MR Group Department of Clinical Sciences Lund, Clinical Physiology Lund University, Sweden
-----Original Message----- From: Ulrich Sibiller <uli42@gmx.de> Sent: Tuesday, June 2, 2020 21:10 To: Johannes Töger <johannes.toger@med.lu.se> Cc: x2go-user@lists.x2go.org Subject: Re: [X2Go-User] Matlab graphics performance when running in x2go
Thanks, I have included that in the wiki: https://wiki.x2go.org/doku.php/wiki:development:glx-xlib-workaround#matlab_2...
Uli
On Tue, Jun 2, 2020 at 8:56 PM Johannes Töger <johannes.toger@med.lu.se> wrote:
On 2020-06-02 21:56, Johannes Töger wrote:
I finally figured it out! Now I can run Matlab R2019b on Ubuntu 18.04 LTS with decent graphics performance over x2go, even with transparency using the Mesa llvmpipe software OpenGL driver.
Hi Johannes,
When I do the LD_LIBRARY_PATH switcheroo for Mesa libgl-xlib, the OpenGL program Kivy and the test program glxgears start flickering quite much. Kivy doesn't even work with the default x2go OpenGL version. Do you experience this and would you have advice on how to get rid of it? The programs still work ok and don't crash.
I'm running x2go server in a Docker container on CentOS 7.
Best regards,
Aki
No, I haven’t tried these. Let me know if you learn something interesting.
— Johannes Töger
Associate Senior Lecturer Cardiac MR Group Department of Clinical Sciences Lund, Clinical Physiology Lund University, Sweden
From: Aki Ketolainen <akik@mykolab.com> Sent: Thursday, June 18, 2020 13:17 To: Johannes Töger <johannes.toger@med.lu.se> Cc: x2go-user@lists.x2go.org Subject: Re: [X2Go-User] Matlab graphics performance when running in x2go
On 2020-06-02 21:56, Johannes Töger wrote:
I finally figured it out! Now I can run Matlab R2019b on Ubuntu 18.04 LTS with decent graphics performance over x2go, even with transparency using the Mesa llvmpipe software OpenGL driver.
Hi Johannes,
When I do the LD_LIBRARY_PATH switcheroo for Mesa libgl-xlib, the OpenGL program Kivy and the test program glxgears start flickering quite much. Kivy doesn't even work with the default x2go OpenGL version. Do you experience this and would you have advice on how to get rid of it? The programs still work ok and don't crash.
I'm running x2go server in a Docker container on CentOS 7.
Best regards,
Aki
No flicker. It works well but crashes.
From: Aki Ketolainen <akik@mykolab.com> Sent: Thursday, June 18, 2020 2:03:22 PM To: Johannes Töger <johannes.toger@med.lu.se> Cc: x2go-user@lists.x2go.org <x2go-user@lists.x2go.org> Subject: Re: [X2Go-User] Matlab graphics performance when running in x2go
Hi Johannes,
I meant to ask whether Matlab flickers for you when you set the newer Mesa libgl-xlib version in the x2go session.
Best regards,
Aki
On 2020-06-18 14:53, Johannes Töger wrote:
No, I haven't tried these. Let me know if you learn something interesting.
—
Johannes Töger
Associate Senior Lecturer
Cardiac MR Group
Department of Clinical Sciences Lund, Clinical Physiology
Lund University, Sweden
From: Aki Ketolainen <akik@mykolab.com> Sent: Thursday, June 18, 2020 13:17 To: Johannes Töger <johannes.toger@med.lu.se> Cc: x2go-user@lists.x2go.org Subject: Re: [X2Go-User] Matlab graphics performance when running in x2go
On 2020-06-02 21:56, Johannes Töger wrote:
I finally figured it out! Now I can run Matlab R2019b on Ubuntu 18.04 LTS with decent graphics performance over x2go, even with transparency using the Mesa llvmpipe software OpenGL driver.
Hi Johannes,
When I do the LD_LIBRARY_PATH switcheroo for Mesa libgl-xlib, the OpenGL program Kivy and the test program glxgears start flickering quite much. Kivy doesn't even work with the default x2go OpenGL version. Do you experience this and would you have advice on how to get rid of it? The programs still work ok and don't crash.
I'm running x2go server in a Docker container on CentOS 7.
Best regards,
Aki
x2go-user mailing list x2go-user@lists.x2go.org<mailto:x2go-user@lists.x2go.org> https://lists.x2go.org/listinfo/x2go-user