libGL error: MESA-LOADER

I am trying to build a snap and I get an opengl error. I followed this post Adding OpenGL/GPU support to a snap

But I can’t seem to make it work. I might be missing something but can’t really find what is my issue.

This is the snapcraft.yaml that I have, is there something obvious that I am missing?

1 Like

we cant either if you dont provide at least some error message :wink:

I realised I forgot to add it :laughing:

So the snap builds well and when I try to run it here is what I get:

libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open radeonsi (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: radeonsi
libGL error: MESA-LOADER: failed to open swrast (search paths /usr/lib/x86_64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri)
libGL error: failed to load driver: swrast
ERROR [glfw] GLFW Error: GLX: Failed to create context: GLXBadFBConfig
rx: glfw: error creating window

well, you are including the glib-only desktop launcher script but are not using it …

try changing your command: entry like:

apps:
  rx:
    command: desktop-launch rx
    plugs:
    [...]

this should set LIBGL_DRIVERS_PATH and also add the mesa search path to LD_LIBRARY_PATH

exactly what I was missing!
Thanks @ogra

Here is the exact line that I changed:

  rx:
    command: bin/desktop-launch $SNAP/bin/rx
1 Like