Bug 6177 - GLX doesn't work with Mesa 13+
Summary: GLX doesn't work with Mesa 13+
Status: CLOSED FIXED
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: VNC (show other bugs)
Version: 1.3.1
Hardware: PC Unknown
: P2 Normal
Target Milestone: 4.10.0
Assignee: Samuel Mannehed
URL:
Keywords: ossman_tester, relnotes
Depends on: 5241
Blocks: 7225
  Show dependency treegraph
 
Reported: 2017-02-27 15:13 CET by Pierre Ossman
Modified: 2018-10-01 15:10 CEST (History)
1 user (show)

See Also:
Acceptance Criteria:
* Systems with glvnd should explicitly use mesa OpenGL instead of the fallback OpenGL. * Systems without glvnd should still work.


Attachments
GNOME Shell crash (44.54 KB, image/png)
2017-03-09 11:20 CET, Samuel Mannehed
Details
GNOME Classic fallback mode (63.05 KB, image/png)
2017-03-09 11:20 CET, Samuel Mannehed
Details
Cinnamon fallback mode (86.49 KB, image/png)
2017-03-09 11:21 CET, Samuel Mannehed
Details

Description Pierre Ossman cendio 2017-02-27 15:13:02 CET
I upgraded my Fedora 25 workstation and GLX stopped working. Most likely because of the new glvnd stuff.

Upstream reports:

https://bugzilla.redhat.com/show_bug.cgi?id=1427174
https://bugs.freedesktop.org/show_bug.cgi?id=99987

GLX tools are very unhappy:

> $ glxinfo
> name of display: :2
> Error: couldn't find RGB GLX visual or fbconfig

Xvnc doesn't show any errors though:

> (II) AIGLX: Loaded and initialized swrast
> (II) GLX: Initialized DRISWRAST GL provider for screen 0
Comment 1 Pierre Ossman cendio 2017-02-28 10:49:01 CET
A first step here is producing a platform specific note with some more information. It should include:

 - Which desktop environments that work, and which that don't
 - What can be done to work around the issue (currently only downgrade is a known option)


After that we'll move this bug to PoolTodo for the investigation of the underlying issue.
Comment 2 Pierre Ossman cendio 2017-02-28 14:27:26 CET
An initial platform specific note has been added, so far with just the information to downgrade Mesa.
Comment 3 Samuel Mannehed cendio 2017-03-06 14:36:54 CET
Tested with Mesa 13 on Fedora 25:

- works: LXDE, XFCE
- doesn't work: Cinnamon, GNOME 3, GNOME Classic
Comment 4 Samuel Mannehed cendio 2017-03-06 14:56:56 CET
The following commands were enough to fix the issue on my Fedora 25 workstation:

> sudo dnf downgrade mesa-libEGL --allowerasing
> sudo dnf downgrade mesa-dri-drivers --allowerasing
> sudo dnf downgrade mesa-libgbm
> sudo dnf downgrade mesa-libwayland-egl
> sudo dnf downgrade mesa-libxatracker
Comment 5 Samuel Mannehed cendio 2017-03-06 16:35:08 CET
(In reply to comment #3)
> - works: LXDE, XFCE

This only means that I was able to login and get a session, there are several applications that are  broken in this state. No gnome applications work for instance.
Comment 6 Samuel Mannehed cendio 2017-03-07 15:10:48 CET
At the moment, Fedora 25 is the only stable release that has Mesa 13. However, it seems like it will be included in Ubuntu 17.04:

http://packages.ubuntu.com/search?keywords=mesa&searchon=names&suite=zesty&section=all
Comment 7 Samuel Mannehed cendio 2017-03-07 15:27:40 CET
Fedora 25:

In a LXDE ThinLinc session with Mesa 13, while you do get a desktop, there are many applications that still segfaults when trying to start them:

 ✗ any gnome application, firefox, evolution, emacs, shotwell, rhythmbox, pcmanfm (default file viewer)

There are a few applications that work however:

 ✓ google-chrome, libreoffice, lxterminal, xterm, slack, tlclient (:P)
Comment 8 Samuel Mannehed cendio 2017-03-07 15:29:41 CET
Furthermore, background image doesn't work in LXDE when running Mesa 13.
Comment 9 Samuel Mannehed cendio 2017-03-07 15:42:35 CET
Fedora 25:

In a XFCE ThinLinc session with Mesa 13, aside from applications that was noted to work/be broken above (for LXDE) I listed two more applications below.

Segfauls:
 ✗ xfce4-terminal

Works:
 ✓ thunar (default file viewer), claws-mail


----

All in all, there are options for all essential applications I could think of. While there are a lot of problems even on LXDE and XFCE, this makes it _possible_ to run a desktop if you are prepared to use different applications.

This could be useful if someone for some reason can't downgrade to mesa 12.
Comment 10 Samuel Mannehed cendio 2017-03-07 15:48:17 CET
The following command works to downgrade all necessary packages at once btw:

sudo dnf downgrade --allowerasing mesa-*
Comment 11 Samuel Mannehed cendio 2017-03-09 11:18:58 CET
The problem can be alleviated by upgrading libepoxy to 1.4.1. The bug in libepoxy caused applications to segfault if they couldn't access OpenGL. Many applications started initializing OpenGL even if they didn't need it, and due to this bug, they couldn't start.

So, with this upgrade, we no longer get segmentation faults, but we still don't get OpenGL. Unfortunately, desktop environments like GNOME can't start without OpenGL, and crashes. GNOME classic and Cinnamon offers some sort of fallback mode that isn't particularly useful.

LXDE and XFCE on the other hand work well, as long as you don't run any applications that actually need OpenGL, such as totem.

The upgrade for libepoxy is not yet available in any repos, but it can be downloaded for Fedora 25 here: https://koji.fedoraproject.org/koji/buildinfo?buildID=866615
Comment 12 Samuel Mannehed cendio 2017-03-09 11:20:25 CET
Created attachment 779 [details]
GNOME Shell crash

Screenshot of what happens when trying to start a GNOME session after upgrading libepoxy to 1.4.1.
Comment 13 Samuel Mannehed cendio 2017-03-09 11:20:55 CET
Created attachment 780 [details]
GNOME Classic fallback mode

Screenshot of what happens when trying to start a GNOME classic session after upgrading libepoxy to 1.4.1.
Comment 14 Samuel Mannehed cendio 2017-03-09 11:21:23 CET
Created attachment 781 [details]
Cinnamon fallback mode

Screenshot of what happens when trying to start a Cinnamon session after upgrading libepoxy to 1.4.1.
Comment 15 Samuel Mannehed cendio 2017-03-09 13:04:56 CET
KDE has the same problems as GNOME on Fedora 25, but it doesn't display any error message on the crash, it just stops at a blue empty screen. No obvious errors in xinit.log.

Mate works just as well as LXDE and XFCE.
Comment 16 Samuel Mannehed cendio 2017-03-09 15:00:26 CET
(In reply to comment #6)
> it seems like it will be included in Ubuntu 17.04

I have installed an Ubuntu 17.04 machine, and even though mesa 13 is installed, OpenGL things work fine! Applications such as glxgears work well.

The difference seems to be GLVND which is used on Fedora but not on Ubuntu. I have reported this on the freedesktop bug.

I have added more information to the platform specific notes here:

https://www.cendio.com/thinlinc/docs/platforms/redhat

I consider the first step done. Move to PoolTodo after verification.
Comment 17 Pierre Ossman cendio 2017-03-13 13:45:06 CET
As discovered on the upstream report, Fedora's Xvnc seems to work fine. So this might be resolved with an upgrade of Mesa and/or Xorg in our build.
Comment 18 Samuel Mannehed cendio 2017-03-13 14:07:38 CET
(In reply to comment #11)
> The upgrade for libepoxy is not yet available in any repos

Version 1.4.1 is now available from the normal fedora 25 updates repo.
Comment 19 Pierre Ossman cendio 2017-03-13 14:48:16 CET
(In reply to comment #17)
> As discovered on the upstream report, Fedora's Xvnc seems to work fine. So this
> might be resolved with an upgrade of Mesa and/or Xorg in our build.

I did a test build using xorg-server 1.19.1, and that gets glxgears up and running. Upstream also mentions that GLVND might require a newer version of the GLX extension.
Comment 20 Pierre Ossman cendio 2017-03-14 16:51:23 CET
This solves/works around the issue:

> sudo ln -s /usr/lib64/libGLX_mesa.so.0 /usr/lib64/libGLX_indirect.so.0 

Discussion ongoing upstream exactly what this does and what the consequences are.
Comment 21 Pierre Ossman cendio 2017-03-15 13:13:09 CET
Found the code responsible for selecting the correct GL driver:

https://github.com/NVIDIA/libglvnd/blob/470fc824a38521a52707c6c0f59d827aa5e0f45a/src/GLX/libglxmapping.c#L519-L600

It relies on a GLX extension that is only present in xorg-server 1.19 to function correctly. Otherwise it needs one of multiple fallbacks:

 - $__GLX_VENDOR_LIBRARY_NAME
 - Vendor name 'indirect'

It sounds like Fedora is considering using the latter to get things working for older X servers, so we may just have to sit back and wait. We could also mention the symlink until then.
Comment 22 Pierre Ossman cendio 2017-03-15 13:19:35 CET
The complicating factor for this fallback symlink is that NVIDIA is also claiming dibs on it, for unclear reasons. Hence why it is not obvious how this will play out.
Comment 23 Karl Mikaelsson cendio 2017-03-16 10:28:04 CET
(In reply to comment #16)
> (In reply to comment #6)
> > it seems like it will be included in Ubuntu 17.04
> 
> I have installed an Ubuntu 17.04 machine, and even though mesa 13 is installed,
> OpenGL things work fine! Applications such as glxgears work well.
> 
> The difference seems to be GLVND which is used on Fedora but not on Ubuntu. I
> have reported this on the freedesktop bug.
> 
> I have added more information to the platform specific notes here:
> 
> https://www.cendio.com/thinlinc/docs/platforms/redhat
> 
> I consider the first step done. Move to PoolTodo after verification.

The platform specific note looks fine for now.
Comment 24 Pierre Ossman cendio 2017-03-31 11:32:38 CEST
Fedora has now pushed out the symlink workaround for Fedora 25 and Fedora 26. Works fine. Haven't tested what happens when you install the NVIDIA driver though.
Comment 25 Samuel Mannehed cendio 2018-09-12 09:58:37 CEST
Should be fixed now since we have upgraded Xorg in bug 5241. I'll verify this.
Comment 28 Pierre Ossman cendio 2018-10-01 15:10:21 CEST
> * Systems with glvnd should explicitly use mesa OpenGL instead of the fallback OpenGL.

Yup. It's a bit difficult to explicitly test this, but I can see the "GLX_EXT_libglvnd" server extension in glxinfo. I can also do an strace and see it loading "libGLX_mesa.so.0". With older servers it will use a fallback name (libGLX_indirect.so.0, or libGLX_system.so.0).

Tested on Fedora 28.

> * Systems without glvnd should still work.

Tested with RHEL 6 and everything OpenGL works fine.

Note You need to log in before you can comment on or make changes to this bug.