Xibo Player - MESA-LOADER: failed to open iris/swrast

Hello
I’m using core18. My snap app is using GStreamer 1.16.2 and gtkmm 3.22.2. There is a GStreamer plugin named gtkglgink (https://thiblahute.github.io/GStreamer-doc/gtk-1.0/gtkglsink.html) which is using OpenGL to render video frames on the GTK+ OpenGL widget.

Everything worked fine before upgrading the host system (during upgrade some mesa packages were updated from 19.2.8-0 to 20.0.8-0). After that, my app in a snap stopped working correctly. It gives me an error Failed to initialize OpenGL with Gtk which is reported by GStreamer plugin gtkglsink. If I run the same binary outside snap environment (on my host machine) everything works while in a snap it doesn’t.

That’s weird because I didn’t touch anything neither in the app code nor in snapcraft.yaml. The previously built snap app just stopped working due to external upgrades!

Am I missing something? Maybe the opengl interface has been broken or something else?

My snapcraft.yaml:

name: gst-test
base: core18
version: '1.0'
summary: GStreamer OpenGL Snap
description: Testing GStreamer 1.16.2 OpenGL GTK+ plugin in snap environment
grade: stable
confinement: strict

architectures:
  - build-on: amd64

apps:
  gst-test:
    command: snap_run.sh $SNAP/usr/bin/gst-launch-1.0
    plugs: [opengl]
    extensions: [gnome-3-28]

parts:
  base:
    plugin: nil
    build-packages:
      - software-properties-common

  g++-8: # Ubuntu 18.04 has outdated gcc so we have to install it from PPA
    plugin: nil
    override-pull: |
      add-apt-repository ppa:ubuntu-toolchain-r/test
      apt-get update
      apt-get install -y g++-8
      update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 90
      update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 90
    after: [base]

  gstreamer:
    override-pull: |
      snapcraftctl pull
      git checkout 1.16.2
    source: https://github.com/GStreamer/gstreamer.git
    plugin: autotools
    configflags: ['--prefix=/usr', '--disable-gtk-doc']
    build-packages:
      - bison
      - flex
      - gettext
      - liborc-0.4-dev
      - libpulse-dev
      - libxv-dev
      - libtag1-dev
      - libwavpack-dev
      - libgl1-mesa-dev
      - libglu1-mesa-dev
      - libglew-dev
    stage-packages:
      - liborc-0.4-dev
      - libasound2-dev
      - libjpeg-dev
      - libvpx-dev
      - libvorbis-dev
      - libogg-dev
      - libpulse-dev
      - libpulse0
      - libwavpack-dev
      - libtag1v5
      - libopus-dev
      - libtheora-dev
      - libxv-dev
      - libxdamage-dev
      - libcdparanoia-dev
      - libgl1-mesa-glx
      - libglu1-mesa
      - libglew2.0
    prime:
      - usr
    after: [g++-8]

  gst-plugins-base:
    override-pull: |
      snapcraftctl pull
      git checkout 1.16.2
    source: https://github.com/GStreamer/gst-plugins-base.git
    plugin: autotools
    configflags: ['--prefix=/usr', '--disable-gtk-doc']
    build-packages:
      - liborc-0.4-dev
      - libfribidi-dev
      - libpulse-dev
    stage-packages:
      - libdatrie1
      - libegl1
      - libgraphite2-3
      - libharfbuzz0b
      - libpango-1.0-0
      - libpangocairo-1.0-0
      - libpangoft2-1.0-0
      - libthai0
    prime:
      - usr
    after: [gstreamer]

  gst-libav:
    override-pull: |
      snapcraftctl pull
      git checkout 1.16.2
    source: https://github.com/GStreamer/gst-libav.git
    plugin: autotools
    configflags: ['--prefix=/usr', '--disable-gtk-doc']
    build-packages:
      - yasm
      - liborc-0.4-dev
      - libpulse-dev
      - libva-dev
    stage-packages:
      - libpulse0
    prime:
      - usr
    after: [gst-plugins-base]

  gst-plugins-good:
    override-pull: |
      snapcraftctl pull
      git checkout 1.16.2
    source: https://github.com/GStreamer/gst-plugins-good.git
    plugin: autotools
    configflags: ['--prefix=/usr', '--disable-gtk-doc']
    build-packages:
      - liborc-0.4-dev
      - libpulse-dev
    stage-packages:
      - libpulse0
      - libatk-bridge2.0-0
      - libatk1.0-0
      - libatspi2.0-0
      - libcairo-gobject2
      - libdatrie1
      - libegl1
      - libepoxy0
      - libgdk-pixbuf2.0-0
      - libgraphite2-3
      - libgtk-3-0
      - libharfbuzz0b
      - libpango-1.0-0
      - libpangocairo-1.0-0
      - libpangoft2-1.0-0
      - libsoup2.4-1
      - libthai0
      - libwayland-client0
      - libwayland-cursor0
      - libwayland-egl1
      - libxcomposite1
      - libxcursor1
      - libxi6
      - libxinerama1
      - libxkbcommon0
      - libxml2
      - libxrandr2
    prime:
      - usr
    after: [gst-libav]

  script:
    source: script
    plugin: dump
    prime:
      - snap_run.sh
    after: [gst-plugins-good] 

I am going to move this to the #snapd category, they might have a better answer for the runtime side of things.

In the meantime, mind passing along information about:

  • graphics card
  • output of snap version
  • contents of /etc/os-release

Hello @sergiusens thanks for the reply!

  1. Graphics card:
    description: VGA compatible controller
    product: UHD Graphics 620
    vendor: Intel Corporation
    physical id: 2
    bus info: pci@0000:00:02.0
    version: 07
    width: 64 bits
    clock: 33MHz
    capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
    configuration: driver=i915 latency=0
    resources: irq:127 memory:ed000000-edffffff memory:c0000000-cfffffff ioport:f000(size=64) memory:c0000-dffff
  1. snap version
    snap    2.45.3.1
    snapd   2.45.3.1
    series  16
    ubuntu  18.04
    kernel  5.4.0-42-generic
  1. /etc/os-release
    NAME="Ubuntu"
    VERSION="18.04.4 LTS (Bionic Beaver)"
    ID=ubuntu
    ID_LIKE=debian
    PRETTY_NAME="Ubuntu 18.04.4 LTS"
    VERSION_ID="18.04"
    HOME_URL="https://www.ubuntu.com/"
    VERSION_CODENAME=bionic
    UBUNTU_CODENAME=bionic

I’ve updated the snapcraft.yaml in the first message and reduced example to minimal.
To test it you need to run the following pipeline gst-test videotestsrc ! glupload ! glfiltercube ! gtkglsink.
The following output can be seen on some devices:

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstGtkGLSink:gtkglsink0: Failed to initialize OpenGL with Gtk
Additional debug info:
gstgtkglsink.c(187): gst_gtk_gl_sink_start (): /GstPipeline:pipeline0/GstGtkGLSink:gtkglsink0
Setting pipeline to NULL ...
Freeing pipeline ...

However, the same snap works fine in VM Ubuntu 18.04. So I think it’s probably to graphics card/drivers issue. But as I said before this behaviour reproducible only in a snap on some devices.

I’ve also created repository where you test by yourself: https://github.com/Stivius/gst-opengl-snap

I’ve received more info on this issue. With core20 I got the following error:

Setting pipeline to PAUSED ...
libGL error: MESA-LOADER: failed to open iris (search paths /snap/gst-test-core20/x1/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open iris (search paths /snap/gst-test-core20/x1/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: iris
libGL error: MESA-LOADER: failed to open swrast (search paths /snap/gst-test-core20/x1/gnome-platform/usr/lib/x86_64-linux-gnu/dri)
libGL error: failed to load driver: swrast
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstGtkGLSink:gtkglsink0: Failed to initialize OpenGL with Gtk
Additional debug info:
gstgtkglsink.c(186): gst_gtk_gl_sink_start (): /GstPipeline:pipeline0/GstGtkGLSink:gtkglsink0
Setting pipeline to NULL ...
Freeing pipeline ...

So we have the name of drives which it can’t load. I suppose snapd and opengl can’t find them on host system?

Hi,

I wanted to add some additional details to this issue we’re having, as we’ve run out of things to try really and our next step is to find alternative packaging.

The problem reported by @stivius was found in Xibo’s Linux player (https://snapcraft.io/xibo-player). We have about 1400 active installs of the player, and starting shortly before this issue was reported, existing, fully working installations started crashing with the error above. Its hard to say how many users are effected in total, but we regularly receive issue reports for it now.

Had we changed something in Xibo, we could obviously roll it back, but this has started happening without any changes on our side.

We created a simplified example in this repo (https://github.com/Stivius/gst-opengl-snap) which demonstrates the issue - essentially the same build steps exist in Xibo.

Any help would be greatly appreciated.

Thanks,
Dan

Hi I built both of your snaps with snapcraft, installed both of them on my Ubuntu 20.04 desktop with X11 and nvidia proprietary drivers and can’t reproduce the issue, I see the rotating box thing without issues. Have you looked at whether this problem is specific to a particular gpu driver setup at all? We have seen issues related to that before with snaps and it sounds like from the description the issue is specific to Intel’s iris gpu or perhaps falling back from intel’s iris gpu to full software rendering with swrast maybe?

Thanks for taking a look, much appreciated.

We’re pretty sure it is something related to a particular GPU/kernel configuration. I have a Dell XPS 13 with a Intel® UHD Graphics 620 (KBL GT2) graphics card, which I’ve been running/testing our Xibo Player on since we started development of it.

Since July I get the above error - I assume because of a driver/kernel update.

As a project we’re tracking this here and i’d be very happy to ask users with the issue for any details that might be useful.