Enhanced OpenGL driver support in flatpak

Alexander Larsson alexl at redhat.com
Tue Feb 7 08:52:11 UTC 2017


On Mon, 2017-02-06 at 11:36 +0100, Alexander Larsson wrote:
> Last week I spent some time looking into the GL driver situation for
> flatpak. This is a tricky area, but it is important that we make this
> work out of the box, even if you're using e.g. the proprietary nvidia
> driver.

I added a few more nvidia driver permutations, but I can't really test
these, so it would be cool if i could get some help. Here is a short
guide on how to test this:

First, Install a flatpak from git master. Or if you're on solus
unstable, use the snapshot git built there:

https://git.solus-project.com/packages/flatpak/commit/?h=flatpak-0.9.1-4

Then, you need to install the new builds of the runtimes, which is not
in
the official repo yet. So, start by adding the buildbot repo:

$ flatpak remote-add gnome-buildbot http://sdkbuilder1.gnome.org/gnome-buildbot.flatpakrepo

(Note: This and everything below will install in the system location
 via policykit auth. You can also add --user to each command to install
 unprivileged in your homedir.)

Then install the new runtime:

$ flatpak install gnome-buildbot org.freedesktop.Platform

Take note of the output from this. It should install the basic runtime
(org.freedesktop.Platform/x86_64/1.4) as well as a subset of the
translations for it (org.freedesktop.Platform.Locale/x86_64/1.4), but
it will also install any GL drivers from the repo that matches
what flatpak thinks is the active one. In my case it installs
org.freedesktop.Platform.GL.nvidia-375-26 to match the 375.26
nvidia driver that is loaded on the host. You can list the
drivers that flatpak thinks is active with "flatpak --gl-drivers".

The current repo has x86-64 drivers for nvidia 375.26, 370.28, 340.101
and 304.134, and 32bit drivers for 375.26. I have only tested the
375.26 drivers myself, and it would be nice if people could test the
other ones. Also, if someone has a different driver I can easily add
a wrapper for that to test.

To test the driver you can install and run glxinfo:

$ flatpak install gnome-buildbot org.freedesktop.GlxInfo
$ flatpak run org.freedesktop.GlxInfo

Which should give some output. This app also contains all the mesa
demos, so you can run e.g.:

$ flatpak run --command=glxgears org.freedesktop.GlxInfo

Or enter a shell in it and look at what is there:

$ flatpak run --command=sh org.freedesktop.GlxInfo
sh-4.3$ ls /app/bin/
...

I'm interested in knowing:

* Does the nvidia 370, 340 and 304 drivers get detected and
  downloaded properly.

* Do the various drivers work for everyone. This includes
  the built-in mesa driver, so its interesting to get
  feedback even on non-nvidia drivers.

* Do the various nvidia drivers still work if you specify
  --share=network to the flatpak run commandline. This
  breaks for me in the 375.26 driver, becase apparently
  the driver is connecting to some unix domain socket.
  If anyone knows anything about this that would be
  very interesting.

* Do you have the AMD proprietary driver installed. If so,
  I'm interested in how you can properly detect this, and
  what version is in use.
  For the nvidia driver we look in /sys/module/nvidia/version.

* If you have a laptop with nvidia + intel (optimus) I'd like
  to know how this works, and if not, do you have any ideas on
  how to make it work.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
       alexl at redhat.com            alexander.larsson at gmail.com 
He's a Nobel prize-winning small-town cop on a search for his missing 
sister. She's a manipulative gypsy college professor from the wrong side 
of the tracks. They fight crime! 



More information about the xdg-app mailing list