`base: core20` snaps fail to compile shaders on Ubuntu 18.04 hosts with Nvidia

Bug #1897869 reported by Michał Sawicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Confirmed
Low
Zygmunt Krynicki

Bug Description

Steps to reproduce:
- install Ubuntu 18.04 on a host with (only) Nvidia GPU
- apt-get install libgles2 nvidia-driver-440
- echo 'GRUB_CMDLINE_LINUX_DEFAULT="nvidia-drm.modeset=1"' | sudo tee /etc/default/grub.d/99-nvidia.cfg
- sudo update-grub
- sudo reboot
- snap install mir-test-tools --edge
- sudo env XDG_RUNTIME_DIR=/tmp mir-test-tools.smoke-test --console-provider vt --vt 4

Some of the tests with fail with:
```
[2020-09-28 23:13:34.074407] <information> mir::examples: Starting test client: /snap/mir-test-tools/3943/usr/bin/mir_demo_client_wayland_egl_spinner
Can't eglInitialize
ERROR: Dynamic exception type: std::runtime_error
std::exception::what: Compile failed: ��;C8 for:
attribute vec3 position;
attribute vec2 texcoord;
uniform mat4 screen_to_gl_coords;
uniform mat4 display_transform;
uniform mat4 transform;
uniform vec2 centre;
varying vec2 v_texcoord;
void main() {
   vec4 mid = vec4(centre, 0.0, 0.0);
   vec4 transformed = (transform * (vec4(position, 1.0) - mid)) + mid;
   gl_Position = display_transform * screen_to_gl_coords * transformed;
   v_texcoord = texcoord;
}
sh: 1: /usr/share/apport/recoverable_problem: not found
I: [FAILED] /snap/mir-test-tools/3943/usr/bin/mir_demo_client_wayland_egl_spinner
[timestamp] End : mir_demo_client_wayland_egl_spinner 2020-09-28T23:13:34+00:00
[timestamp] End time : 2020-09-28T23:13:34+00:00
```

This was working fine on both 18.04 and 20.04 hosts with a `base: core18` snap, so this suggests something in the new snap became incompatible with 18.04 hosts.

The lack of clear documentation on what is tested / expected to work, how to get there (what should be in the snap, what should not) does not help with debugging.

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

Confirmed and triaged as low, as we have no nvidia work on the roadmap. I will do my best to fix this given the following extra information:

- strace -f output
- ltrace related to dlopen*
- apparmor denials

I suspect it's either a CPU-feature-specific library being loaded in core20 (apparmor denial) or a missing/incompatible library that is attempted to be loaded as a dependency of the nvidia libraries from the host.

Changed in snapd:
status: New → Confirmed
assignee: nobody → Zygmunt Krynicki (zyga)
importance: Undecided → Low
Revision history for this message
Michał Sawicz (saviq) wrote :

Here's dmesg.

Revision history for this message
Michał Sawicz (saviq) wrote :

And strace.

Revision history for this message
Michał Sawicz (saviq) wrote :

And ltrace.

Revision history for this message
Michał Sawicz (saviq) wrote :
Download full text (4.3 KiB)

FWIW this is how to get down to the binary that's failing:

$ sudo snap run --shell mir-test-tools.smoke-test
$ $SNAP/bin/wrapper bash
$ $SNAP/usr/bin/mir_demo_server
[2020-10-01 11:11:25.052958] <information> mirserver: Starting
[2020-10-01 11:11:25.058761] < - debug - > mirserver: Using Linux VT subsystem for session management
[2020-10-01 11:11:25.058895] <information> mircommon: Loading modules from: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform
[2020-10-01 11:11:25.058956] <information> mircommon: Loading module: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.18
[2020-10-01 11:11:25.058978] <information> mircommon: Loading module: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.18
[2020-10-01 11:11:25.058994] <information> mircommon: Loading module: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-wayland.so.18
[2020-10-01 11:11:25.059008] <information> mircommon: Loading module: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.18
[2020-10-01 11:11:25.059022] <information> mircommon: Loading module: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.7
[2020-10-01 11:11:25.067542] < - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_NV_device_cuda EGL_EXT_device_drm
[2020-10-01 11:11:25.117991] < -warning- > eglstream: glGetString(GL_VERSION) call failed. This probably indicates a problem with the GL drivers.
[2020-10-01 11:11:25.376558] <information> mirserver: Found graphics driver: mir:eglstream-kms (version 2.1.0) Support priority: 256
[2020-10-01 11:11:25.377267] <information> gbm-kms: EGL platform does not support EGL_KHR_platform_gbm extension
[2020-10-01 11:11:25.727504] <information> gbm-kms: Probe failed to query GL renderer: GL_NO_ERROR (0)
[2020-10-01 11:11:25.727878] <information> mirserver: Found graphics driver: mir:gbm-kms (version 2.1.0) Support priority: 0
[2020-10-01 11:11:25.727898] <information> mirserver: Found graphics driver: mir:wayland (version 2.1.0) Support priority: 0
[2020-10-01 11:11:25.727925] <information> mirserver: Found graphics driver: mir:x11 (version 2.1.0) Support priority: 0
[2020-10-01 11:11:25.728148] <information> mirserver: Selected driver: mir:eglstream-kms (version 2.1.0)
[2020-10-01 11:11:25.868726] < -warning- > miral: Failed to load cursor theme: default
[2020-10-01 11:11:25.883852] <information> mirserver: Using software cursor
[2020-10-01 11:11:25.885671] <information> platform-eglstream-kms: Bound EGLStreams-backed Wayland display
[2020-10-01 11:11:25.885864] <information> mircommon: Loading modules from: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform
[2020-10-01 11:11:25.885919] <information> mircommon: Loading module: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.18
[2020-10-01 11:11:25.885947] <information> mircommon: Loading module: /snap/mir-test-tools/3965/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.18
[2020-10-01 11:11:25.885971] <information> mircomm...

Read more...

Revision history for this message
Michał Sawicz (saviq) wrote :

Also, by now I think the problem is not that "shaders don't compile", but rather that "GL isn't working":

< - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_NV_device_cuda EGL_EXT_device_drm
< -warning- > eglstream: glGetString(GL_VERSION) call failed. This probably indicates a problem with the GL drivers.
<information> gbm-kms: EGL platform does not support EGL_KHR_platform_gbm extension
<information> gbm-kms: Probe failed to query GL renderer: GL_NO_ERROR (0)

Revision history for this message
Michał Sawicz (saviq) wrote :

The corruption in the "failed shader compile" log above is just another symptom of the same problem.

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.