libGL error: unable to load driver: i965_dri.so

I’m having trouble understanding how the opengl interface works, and how snaps interact with my video card. For example, I’m trying to launch pMarineViewer (an FLTK component of MOOS-IvP, autonomy middleware), and I’m seeing:

XOpenIM() failed
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

I see both i965_dri.so and swrast_dri.so on my host system (a Dell M3800) in /usr/lib/x86_64-linux-gnu/dri/, but that directory is not accessible from within snap shell, so I figured some bind-mount magic was happening within snap-confine. However, I don’t see either of them using snap run --shell (on an app that uses the x11, unity7, and opengl interfaces):

kyrofa@Pandora:~$ snap run --shell moos-ivp.pMarineViewer
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

kyrofa@Pandora:~$ cd $SNAP
kyrofa@Pandora:/snap/moos-ivp/x1$ find . -name '*swrast*'
kyrofa@Pandora:/snap/moos-ivp/x1$ find . -name '*i965_dri*'

Am I missing something?

1 Like

Note that using the gtk3 desktop helper seems to have made things work… but I’m still not sure why.

it pulls the right mesa libs into stage-packages … iirc thats libgl1-mesa-dri , libgl1-mesa-glx on x86 and additionally libgles2-mesa on arm

1 Like

I did this for Phoenicis (PlayOnLinux 5) and it still didn’t work:

https://github.com/PhoenicisOrg/POL-POM-5/issues/752#issuecomment-323859902

I changed the snapcraft.yaml I gave there by removing the three mesa stage-packages and adding desktop-gtk3 as an after and still got the same errors.

The interface merely allows you access to some device nodes and system calls. It doesn’t provide you with an userspace driver, this is only done (in a hackinsh manner) for proprietary nividia driver. Currently snaps must bundle the userspace part of all the drivers they wish to run on.

i’m also affected by this bug, trying to snap a SDL2/opengl game :frowning:

I wrote a C++ SDL “game” and snapped it. I got that “libGL error: unable to load driver: i965_dri.so” error too, so I added various stage-packages and after “snapcraft try” (to build to prime step) and “snap try prime”, I connect the x11 interface (snap connect ripples:x11 :x11
), and it works on xenial amd64 with intel graphics laptop. If interested, see

Launch it with ripples.run, then mouse click anywhere to start expanding ripples. There’s a “gun” at the lower left. Arrow keys point it and make it longer (faster bullets) or shorter. space bar to fire a bullet.

My comment above was meant to be a reply to your comment. Cheers.