some opengl applications don't work on nvidia binary driver with classic confinement

Bug #1763717 reported by Alan Pope 🍺🐧🐱 πŸ¦„
42
This bug affects 9 people
Affects Status Importance Assigned to Milestone
snapd
Expired
Undecided
Unassigned

Bug Description

On my 18.04 laptop running nvidia 390.48, I can't launch some 3D applications. Shotcut for example won't launch on my nvidia 18.04 laptop but launches fine on my Intel 16.04 laptop

$ snap version
snap 2.32.4
snapd 2.32.4
series 16
ubuntu 18.04
kernel 4.15.0-13-generic

[Debug ] <ShotcutSettings::singleton> language "en_GB"
[Debug ] <ShotcutSettings::singleton> deinterlacer "onefield"
[Debug ] <ShotcutSettings::singleton> external monitor ""
[Debug ] <ShotcutSettings::singleton> GPU processing false
[Debug ] <ShotcutSettings::singleton> interpolation "nearest"
[Debug ] <ShotcutSettings::singleton> video mode ""
[Debug ] <ShotcutSettings::singleton> realtime true
[Info ] <Application::Application> Starting Shotcut version 18.03.06
[Info ] <Application::Application> Linux version
[Info ] <Application::Application> number of logical cores = 8
[Info ] <Application::Application> locale = QLocale(English, Latin, UnitedKingdom)
[Info ] <Application::Application> install dir = "/snap/shotcut/21/Shotcut.app/bin"
[Info ] <Application::Application> device pixel ratio = 1
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[Warning] <> Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
[Debug ] <MainWindow::changeTheme> begin
[Debug ] <MainWindow::changeTheme> end
[Debug ] <MainWindow::MainWindow> begin
[Fatal ] <> Could not initialize OpenGL
Aborted (core dumped)

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

$ sudo /usr/lib/snapd/snap-discard-ns shotcut
[sudo] password for alan:
alan@hal:~$ SNAPD_DEBUG=1 SNAP_CONFINE_DEBUG=1 shotcut
2018/04/13 14:36:49.197207 cmd.go:203: DEBUG: restarting into "/snap/core/current/usr/bin/snap"
DEBUG: security tag: snap.shotcut.shotcut
DEBUG: executable: /snap/core/current/usr/lib/snapd/snap-exec
DEBUG: confinement: classic
DEBUG: base snap: core
DEBUG: ruid: 1000, euid: 0, suid: 0
DEBUG: rgid: 1000, egid: 0, sgid: 0
DEBUG: apparmor label on snap-confine is: /snap/core/4443/usr/lib/snapd/snap-confine
DEBUG: apparmor mode is: enforce
DEBUG: skipping sandbox setup, classic confinement in use
DEBUG: creating user data directory: /home/alan/snap/shotcut/21
DEBUG: requesting changing of apparmor profile on next exec to snap.shotcut.shotcut
DEBUG: loading bpf program for security tag snap.shotcut.shotcut
DEBUG: read 14 bytes from /var/lib/snapd/seccomp/bpf//snap.shotcut.shotcut.bin
DEBUG: execv(/snap/core/current/usr/lib/snapd/snap-exec, /snap/core/current/usr/lib/snapd/snap-exec...)
DEBUG: argv[1] = shotcut

(process:25763): Gtk-WARNING **: 14:36:49.273: Locale not supported by C library.
        Using the fallback 'C' locale.
No appenders registered with logger
[Debug ] <ShotcutSettings::singleton> language "en_GB"
[Debug ] <ShotcutSettings::singleton> deinterlacer "onefield"
[Debug ] <ShotcutSettings::singleton> external monitor ""
[Debug ] <ShotcutSettings::singleton> GPU processing false
[Debug ] <ShotcutSettings::singleton> interpolation "nearest"
[Debug ] <ShotcutSettings::singleton> video mode ""
[Debug ] <ShotcutSettings::singleton> realtime true
[Info ] <Application::Application> Starting Shotcut version 18.03.06
[Info ] <Application::Application> Linux version
[Info ] <Application::Application> number of logical cores = 8
[Info ] <Application::Application> locale = QLocale(English, Latin, UnitedKingdom)
[Info ] <Application::Application> install dir = "/snap/shotcut/21/Shotcut.app/bin"
[Info ] <Application::Application> device pixel ratio = 1
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
[Warning] <> Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
[Debug ] <MainWindow::changeTheme> begin
[Debug ] <MainWindow::changeTheme> end
[Debug ] <MainWindow::MainWindow> begin
[Fatal ] <> Could not initialize OpenGL
Aborted (core dumped)

summary: - some opengl applications don't work on nvidia binary driver
+ some opengl applications don't work on nvidia binary driver with classic
+ confinement
Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :
Download full text (15.0 KiB)

Works fine outside of snap when I installed all the dependencies on the host.

Then I turned to look at the binary itself and ld.so output.

running the binary directly (while inside the snap shell):
LD_DEBUG=all LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH /snap/mame/168/mame 2>$SNAP_USER_DATA/mame.ld.log-2

echo $SNAP_LIBRARY_PATH
/var/lib/snapd/lib/gl:/var/lib/snapd/lib/gl32:/var/lib/snapd/void

ld.so log (notice that the paths in SNAP_LIBRARY_PATH are missing):

```
      5217: file=libGL.so.1 [0]; needed by /snap/mame/168/mame [0]
      5217: find library=libGL.so.1 [0]; searching
      5217: search path=/snap/mame/168/usr/lib/x86_64-linux-gnu:
/snap/mame/168/lib/x86_64-linux-gnu:
/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio/tls/x86_64:
/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio/tls:
/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio/x86_64:
/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio:
/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa/tls/x86_64:
/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa/tls:
/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa/x86_64:
/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa:
/snap/mame/168/usr/lib/tls/x86_64:
/snap/mame/168/usr/lib/tls:/snap/mame/168/usr/lib/x86_64:
/snap/mame/168/usr/lib:
/snap/core/current/lib/x86_64-linux-gnu/tls/x86_64:
/snap/core/current/lib/x86_64-linux-gnu/tls:
/snap/core/current/lib/x86_64-linux-gnu/x86_64:
/snap/core/current/lib/x86_64-linux-gnu
            (RPATH from file /snap/mame/168/mame) <------
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/libGL.so.1
      5217: trying file=/snap/mame/168/lib/x86_64-linux-gnu/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio/tls/x86_64/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio/tls/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio/x86_64/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/pulseaudio/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa/tls/x86_64/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa/tls/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa/x86_64/libGL.so.1
      5217: trying file=/snap/mame/168/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
      5217:
      5217: file=libGL.so.1 [0]; generating link map
      5217: dynamic: 0x00007f8240fa7c60 base: 0x00007f8240d37000 size: 0x0000000000272478
      5217: entry: 0x00007f8240d4fe80 phdr: 0x00007f8240d37040 phnum: 8
      5217:
      5217:
```

More detailed log: https://paste.ubuntu.com/p/Zm57vmQCwR/ notice how it uses LD_LIBRARY_PATH for some of the libraries.

RPATH is embedded in the binary itself:
```

 0x000000000000000f (RPATH) Library rpath: [
$ORIGIN/usr/lib/x86_64-linux-gnu:
$ORIGIN/lib/x86_64-linux-gnu:
$ORIGIN/usr/lib/x86_64-linux-gnu/pulseaudio:
$ORIGIN/usr/lib/x86_64-linux-gnu/mesa:
$ORIGIN/usr/lib:
/snap/core/current/lib/x86_64-linux-gnu
]
```

readelf -a /snap/mame/168/mame
```
LF Hea...

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

FWIW, this looks like a problem with the binary itself.

Revision history for this message
Sergio Schvezov (sergiusens) wrote :
Revision history for this message
Matthew Broadhead (chongma) wrote :

i am experiencing the same problem running shotcut on 18.04
n: failed to create symbolic link '/home/matthew/snap/shotcut/21/.config/gtk-2.0/gtkfilechooser.ini': File exists

(process:24453): Gtk-WARNING **: 13:58:00.151: Locale not supported by C library.
 Using the fallback 'C' locale.
Gtk-Message: 13:58:00.153: Failed to load module "overlay-scrollbar"
Gtk-Message: 13:58:00.153: Failed to load module "overlay-scrollbar"
Gtk-Message: 13:58:00.159: Failed to load module "canberra-gtk-module"
No appenders registered with logger
[Debug ] <ShotcutSettings::singleton> language "en_GB"
[Debug ] <ShotcutSettings::singleton> deinterlacer "onefield"
[Debug ] <ShotcutSettings::singleton> external monitor ""
[Debug ] <ShotcutSettings::singleton> GPU processing false
[Debug ] <ShotcutSettings::singleton> interpolation "nearest"
[Debug ] <ShotcutSettings::singleton> video mode ""
[Debug ] <ShotcutSettings::singleton> realtime true
[Info ] <Application::Application> Starting Shotcut version 18.03.06
[Info ] <Application::Application> Linux version
[Info ] <Application::Application> number of logical cores = 8
[Info ] <Application::Application> locale = QLocale(English, Latin, UnitedKingdom)
[Info ] <Application::Application> install dir = "/snap/shotcut/21/Shotcut.app/bin"
[Info ] <Application::Application> device pixel ratio = 1
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
[Warning] <> Could not initialize OpenGL for RasterGLSurface, reverting to RasterSurface.
[Debug ] <MainWindow::changeTheme> begin
[Debug ] <MainWindow::changeTheme> end
[Debug ] <MainWindow::MainWindow> begin
[Fatal ] <> Could not initialize OpenGL
Aborted

Revision history for this message
Matthew Broadhead (chongma) wrote :

BTW i am using an nvidia gtx 1050 mobile

Revision history for this message
Bart (bart-schelstraete) wrote :

same problem over here, driver 396.
Applications affected on my system:
  shotcut
  hiri
  noson

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Dear reported, can you please provide a single application to look at. I'd like to look at a specific case instead of at a broad spectrum. Snaps using classic confinement do not benefit from some of the system compatibility features provided by snapd. It requires careful creation of a correct snap. I suspect it is much more likely that a specific snap is made incorrectly.

Changed in snapd:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for snapd because there has been no activity for 60 days.]

Changed in snapd:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.