libglvnd0/libegl installed in Ubuntu 18.04 breaks graphics drivers and forces LLVMpipe driver on i915 systems

Bug #1733136 reported by Rocko on 2017-11-19
50
This bug affects 10 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Undecided
Unassigned

Bug Description

This bug is in ubiquity and in libglvnd0/libegl1:

a) Upgrading from artful to bionic installs libglvnd0 and libegl1 when they aren't needed;

b) having libglvnd0/libegl1 installed breaks EGL on Intel-graphics systems so you get llvmpipe as the video driver. This means you can't choose Wayland for gnome-shell, but instead are forced into X with software rendering.

Original description:

I upgraded to 18.04 and I no longer get an option to run a wayland session (17.10 offered both the default ubuntu wayland session and xorg on this laptop).

gnome-shell runs under the llvmpipe driver. (Unity used to run when I first upgraded, but now gnome-shell is the only option because the gdm login screen offers no login options.)

The upgrade did force me to remove bumblebee and nvidia, but afterwards I manually reinstalled bumblebee and nvidia-387 and reset to using intel via prime-select (installing nvidia changes some of the symlinks so that gnome-shell no longer boots, but "sudo prime-select intel" fixes this).

The nvidia-387 modules are blacklisted in /etc/modprobe.d, and bumblebee isn't reporting any errors - bbswitch reports that the nvidia card is off, so I don't think it's an issue with hybrid graphics. (primusrun does work, as well.)

Attached are the mutter logs that I generated via the environment variables mentioned in https://bugs.launchpad.net/ubuntu/+source/gdm3/+bug/1724583 comment #20. I suspect that the culprit is hinted at in this message:

Window manager warning: Failed to create renderer: Failed to initialize renderer: Missing extensio
n for GBM renderer: EGL_KHR_platform_gbm, Missing EGL extensions required for EGLDevice renderer:
EGL_EXT_device_base

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gnome-shell 3.26.2-0ubuntu1
Uname: Linux 4.14.0-041400-generic x86_64
ApportVersion: 2.20.8-0ubuntu1
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Nov 19 10:28:10 2017
DisplayManager: gdm3
InstallationDate: Installed on 2017-08-16 (94 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Release amd64 (20170412)
JournalErrors:
 Error: command ['journalctl', '-b', '--priority=warning', '--lines=1000'] failed with exit code 1: Hint: You are currently not seeing messages from other users and the system.
       Users in the 'systemd-journal' group can see all messages. Pass -q to
       turn off this notice.
 No journal files were opened due to insufficient permissions.
SourcePackage: gnome-shell
UpgradeStatus: Upgraded to bionic on 2017-11-17 (1 days ago)

Rocko (rockorequin) wrote :
Rocko (rockorequin) wrote :

Here's the output from glxinfo in case that helps.

Rocko (rockorequin) wrote :

The problem seems to be that's it's selecting the VMWare driver instead of the Intel driver. glxinfo shows:

OpenGL vendor string: VMware, Inc.

More info re the video card: it's using the i915 driver.

lshw -c video
  *-display
       description: VGA compatible controller
       product: Intel Corporation
       vendor: Intel Corporation
       physical id: 2
       bus info: pci@0000:00:02.0
       version: 04
       width: 64 bits
       clock: 33MHz
       capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
       configuration: driver=i915 latency=0
       resources: irq:135 memory:eb000000-ebffffff memory:80000000-8fffffff ioport:f000(size=64) memory:c0000-dffff

summary: - gnome-shell no longer offers wayland session in Ubuntu 18.04
+ wayland session in Ubuntu 18.04 chooses vmware driver on intel hardware
description: updated
Rocko (rockorequin) wrote :

It seems there's an error in eglGetDisplay(), but I don't know why.

journactl -b shows:

Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: (II) Loading sub module "glamoregl"
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: (II) LoadModule: "glamoregl"
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: (II) Loading /usr/lib/xorg/modules/libglamoregl.so
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: (II) Module glamoregl: vendor="X.Org Foundation"
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: compiled for 1.19.5, module version = 1.0.0
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: ABI class: X.Org ANSI C Emulation, version 0.4
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: (II) glamor: OpenGL accelerated X.org driver based.
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: (EE) modeset(0): eglGetDisplay() failed
Dec 14 15:25:08 xps15-9560 /usr/lib/gdm3/gdm-x-session[1328]: (EE) modeset(0): glamor initialization failed

One difference between my artful and bionic installations is that bionic is missing the links:

/usr/lib/x86_64-linux-gnu/libEGL.so -> mesa-egl/libEGL.so
/usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so -> libEGL.so.1.0.0

However, creating these manually doesn't fix the problem.

The library config seems good:

lrwxrwxrwx 1 root root 43 Nov 17 14:57 /etc/ld.so.conf.d/x86_64-linux-gnu_EGL.conf -> /etc/alternatives/x86_64-linux-gnu_egl_conf
lrwxrwxrwx 1 root root 42 Nov 17 14:57 /etc/ld.so.conf.d/x86_64-linux-gnu_GL.conf -> /etc/alternatives/x86_64-linux-gnu_gl_conf

lrwxrwxrwx 1 root root 45 Nov 19 10:23 /etc/alternatives/x86_64-linux-gnu_egl_conf -> /usr/lib/x86_64-linux-gnu/mesa-egl/ld.so.conf
lrwxrwxrwx 1 root root 41 Nov 19 10:23 /etc/alternatives/x86_64-linux-gnu_gl_conf -> /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf

Daniel van Vugt (vanvugt) wrote :

This is almost certainly related to the removal/installation of nvidia and friends. I know I've broken my machine more than once in the same way (misconfigured GL libraries) using the nvidia installer. So we only recommend and support installing via .debs

We probably need to assign this bug to a different project and it's probably not a gnome-shell problem at all. Especially since you're looking at X log messages and Xorg needs to be running before gnome-shell, if at all. It's just not clear which Ubuntu source package, if any, could be fixed for this.

Changed in gnome-shell (Ubuntu):
status: New → Incomplete
Rocko (rockorequin) wrote :

But I did install the nvidia driver from a deb file (from one of the graphics driver PPAs). (What makes you suspect that I installed it using the nvidia installer?)

It's true that the first time you install the nvidia driver (and I mean via the PPA deb file), it tends to make /usr/lib/xorg/modules/extensions/libglx.so and /usr/lib/x86_64-linux-gnu/libGL.so point at the nvidia drivers, but this isn't the case in my setup, which works fine in artful, just not in bionic. (You just have to run "sudo prime-select intel" to fix this.)

I guess that the affected package should probably be gdm3 instead of gnome-shell since gdm3 is already running under X on llvmpipe by the time it runs gnome-shell. Is there a way to figure out why gdm3 can't run in a Wayland session, eg log messages describing why it rejects the Intel MESA driver?

affects: gnome-shell (Ubuntu) → gdm3 (Ubuntu)
Daniel van Vugt (vanvugt) wrote :

What made me suspect you used the nvidia installer was the terminology: "manually reinstalled bumblebee and nvidia-387". My mistake, and moving on...

Next, note that the "VMware driver" in use is actually LLVMpipe. This is the Mesa software renderer that all systems can use, apparently written by VMware, but that part is not interesting.

So your system is falling back to software rendering is all. And gdm3 may have detected you have some kind of discrete graphics card that is disabled (please run lspci -k for us), it would in that case choose Xorg instead of the native/Wayland option. I believe the Nvidia driver prefers Xorg by default for various reasons so having Nvidia installed will/might hide the Wayland options. That's not a bug though, but a feature of the Nvidia driver I have heard of...

So I'll assign this bug to Xorg, which should be working better at least. Please also attach your /var/log/Xorg.*

affects: gdm3 (Ubuntu) → xorg-server (Ubuntu)
Daniel van Vugt (vanvugt) wrote :

Also, you might find 'lspci -k' reports nouveau is being loaded too. In that case the fallback to software rendering (AKA LLVMpipe, AKA VMware) is an expected problem for some newer Nvidia chipsets that nouveau can't handle adequately.

P.S. Note that Gnome does not advertise hybrid graphics as supported until Gnome 3.27/3.28. We only have 3.26 in Ubuntu, so I'm not sure how much we should expect to work... https://mail.gnome.org/archives/gnome-announce-list/2017-October/msg00013.html

P.P.S If you don't care for the Nvidia GPU and just want something that works reliably, you might be able to disable the discrete GPU properly in your BIOS. Just use integrated graphics. Then Linux will never see it at all and there shouldn't be as much confusion.

summary: - wayland session in Ubuntu 18.04 chooses vmware driver on intel hardware
+ wayland session in Ubuntu 18.04 chooses LLVMpipe software driver on
+ hybrid graphics system
Rocko (rockorequin) wrote :

I tried purging nvidia and bumblebee and reinstalling all the libs that I could find related to GL, eGL, and mesa, but gdm3 still starts using llvmpipe and the VMWare driver.

Rocko (rockorequin) wrote :

And I only saw your feedback after I put my last comment in... :O

The lspci -k command run from artful shows this:

01:00.0 3D controller: NVIDIA Corporation GP107M [GeForce GTX 1050 Mobile] (rev ff)
        Kernel modules: nvidiafb, nouveau, nvidia_387_drm, nvidia_387

I've got all those blacklisted though in /etc/modprobe.d/, and "lsmod|grep nvidia" and lsmod|grep nouveau" both return an empty string. (The configuration is pretty much the same in bionic as in artful.)

I can't disable the discrete GPU in my BIOS, btw. bumblebee works fine in artful, though, turning off and hiding the nvidia card from gnome-shell, and primus runs an X session using the nvidia card quite happily from within gnome-shell, both under Wayland and X.

I guess I should go back to bionic and blacklist nouveau as well as re-remove the nvidia driver and try again? Perhaps nouveau was being loaded when I tried last time.

Daniel van Vugt (vanvugt) wrote :

Yes definitely try blacklisting nouveau.

The GTX 1050 is relatively new. In my experience the GTX 1060 (slightly older) only started working recently and the GTX 960 still doesn't work with nouveau at last check.

Although when I say "working" I mean the machine boots without hanging and doesn't fall back to the LLVMpipe driver (which my GTX 1060 did for quite a while).

Rocko (rockorequin) wrote :

One difference between artful and bionic is that bionic has libglvnd0 installed (and libegl1 depends on it, so I can't really remove it). Artful doesn't have it installed. I read in one bug report (for Arch or Fedora? I can't find it now) with similar symptoms (ie no wayland session) that libglvnd was causing problems. Could this issue be related to libglvnd0?

Timo Aaltonen (tjaalton) wrote :

the archive version of libegl1 does _not_ depend on libglvnd0, so I don't know where you got it from..

bionic will migrate to it once nvidia is ready, maybe in january

Timo Aaltonen (tjaalton) wrote :

in any case, this is not a bug but something messed up in your installation

Changed in xorg-server (Ubuntu):
status: Incomplete → Invalid
Rocko (rockorequin) wrote :

FWIW, removing libglvnd0 fixed the problem (libegl1 does depend on it, but it isn't installed in artful either - libegl1-mesa is).

So the bug is actually:

a) the upgrade from artful to bionic installed libglvnd0 and libegl1 when they aren't needed;

b) having libglvnd0/libegl1 installed breaks EGL on Intel-graphics systems.

description: updated
Rocko (rockorequin) wrote :

The bug isn't in X server, but is related to EGL graphics drivers being installed incorrectly by ubiquity.

affects: xorg-server (Ubuntu) → ubiquity (Ubuntu)
summary: - wayland session in Ubuntu 18.04 chooses LLVMpipe software driver on
- hybrid graphics system
+ libglvnd0/libegl installed in Ubuntu 18.04 breaks graphics drivers and
+ forces LLVMpipe driver on i915 systems
Timo Aaltonen (tjaalton) wrote :

I tested artful->bionic upgrade, and it did not pull in libegl1 or any of the glvnd stuff, so I bet you had some ppa enabled to pull it in

Rocko (rockorequin) wrote :

I do have a few PPAs enabled normally (for 0ad, libreoffice, graphics, java for instance), but ubiquity always tells me it has disabled them when it upgrades to a new release. Maybe it was unsuccessful in disabling them all (although I'm pretty sure I had to re-enable them all manually after the upgrade this time, as per normal).

At the moment, the artful-bionic upgrade fails for me because it can't calculate a solution, but the upgrade to bionic that first gave me this bug is working fine now I've uninstalled those two libs, so it's all good.

Omer Akram (om26er) wrote :

I had the same issue on Kubuntu 18.04 and uninstalling libglvnd0 fixed it for me.

Note: this is a clean install from yesterday and I don't have a NVidia card in my laptop, so its all Intel.

shankao (shankao) wrote :

For me the problem was that I had libgles2 installed instead of the alternative libgles2-mesa. gnome-session-bin depends on one or the other, but at some point, I got the wrong one.
Maybe for ubuntu, the alternative dependency should be removed as libgles2 makes the system to fallback to llvmpipe

shankao (shankao) wrote :

Forget my previous comment.
I now have libgles2-mesa without libglvnd0 on sight and the system is still using the software renderer on intel :(

Alexey Arutyunov (ar-lex) wrote :

Upgraded Kubuntu from artful to bionic months ago and got this problem with some of the recent updates. Uninstalling libglvnd0 indeed fixed this issue, but kubuntu-desktop metapackage cannot be installed now because of the following dependency chain:
kubuntu-desktop - kinfocenter - libegl1 - libglvnd0

Rocko (rockorequin) wrote :

I too got this issue again late last week when updates forced libglvnd0 to be re-installed:

$ glxinfo|grep OpenGL
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 5.0, 256 bits)

Removing libglvnd0 fixed the issue for me.

Strangely, apt-cache rdepends said that libgl1, libegl1, libopengl0, libglx0, and libgles2 all depend on libglvnd0, but they don't seem to. I used synaptic to remove libglvnd0, and although it said it would also remove libegl1 and mesa-utils, after it completed all the libraries listed by apt-cache rdepends are are still installed:

$ dpkg -l|egrep 'libgl1|libegl1|libopengl0|libglx0|libgles2|mesa-utils'
ii libegl1-mesa:amd64 17.3.3-0ubuntu1 amd64 free implementation of the EGL API -- runtime
ii libegl1-mesa-dev:amd64 17.3.3-0ubuntu1 amd64 free implementation of the EGL API -- development files
ii libgl1-mesa-dev:amd64 17.3.3-0ubuntu1 amd64 free implementation of the OpenGL API -- GLX development files
ii libgl1-mesa-dri:amd64 17.3.3-0ubuntu1 amd64 free implementation of the OpenGL API -- DRI modules
ii libgl1-mesa-dri:i386 17.3.3-0ubuntu1 i386 free implementation of the OpenGL API -- DRI modules
ii libgl1-mesa-glx:amd64 17.3.3-0ubuntu1 amd64 free implementation of the OpenGL API -- GLX runtime
ii libgl1-mesa-glx:i386 17.3.3-0ubuntu1 i386 free implementation of the OpenGL API -- GLX runtime
ii libgles2-mesa:amd64 17.3.3-0ubuntu1 amd64 free implementation of the OpenGL|ES 2.x API -- runtime
ii mesa-utils 8.4.0-1 amd64 Miscellaneous Mesa GL utilities

Joachim Ring (jring) wrote :

Today's automatic updates forced libglvnd0 and libegl1 onto my laptop with bionic and thus no more accelerated intel graphics. Before that there was only libegl1-mesa after a clean install on Jan 25th according to the apt logs.

As it was implied multiple times that some PPA did pull it in - there is no PPAs on the system.

Trying to apt remove it took ubuntu-desktop with it due to dependencies :-(

After reinstalling ubuntu desktop libglvnd0 and libegl1 are back as is the lack of intel graphics...

Can I help in any way by providing logs or whatever?

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers