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*'
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 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.