Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1785251 - Support nvidia drivers in fedora runtime
Summary: Support nvidia drivers in fedora runtime
Keywords:
Status: NEW
Alias: None
Product: Fedora Modules
Classification: Fedora
Component: flatpak-runtime
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-12-19 13:57 UTC by Alexander Larsson
Modified: 2019-12-19 14:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alexander Larsson 2019-12-19 13:57:47 UTC
I noticed that the fedora flatpak didn't pick up the nvidia driver extension.

I added this to the platform metadata (/var/lib/flatpak/runtime/org.fedoraproject.Platform/x86_64/f31/active/metadata):

[Extension org.freedesktop.Platform.GL]
version = 1.4
directory = lib/GL
subdirectories = true
no-autodownload = true
autodelete = false
add-ld-path = lib
merge-dirs = vulkan/icd.d;glvnd/egl_vendor.d;OpenCL/vendors
download-if = active-gl-driver
enable-if = active-gl-driver

And then created the /usr/lib/GL directory in the runtime:

  mkdir /var/lib/flatpak/runtime/org.fedoraproject.Platform/x86_64/f31/active/files/GL

And then i could run:

 flatpak run  org.mozilla.Firefox about:support

and it reported the webgl stuff as working with the nvidia driver.

Any reason we're not doing this by default?

Comment 1 Alexander Larsson 2019-12-19 14:45:47 UTC
Additionally we need to configure libglvnd to find the json files in the extension.
With the above example they will appear as:
  /usr/lib/GL/glvnd/egl_vendor.d/10_nvidia.json

It seems like the default libglvnd looks in /usr/share/glvnd/egl_vendor.d and /etc/glvnd/egl_vendor.d, and fedora choses the one in /usr for packaging its drivers, leaving the other for sysadmin overrides. Since there is no sysadmin overrides in flatpak we can use this by making the /etc/glvnd a symlink to /usr/lib/GL/glvnd which will then be filled in by the extension.

Comment 2 Alexander Larsson 2019-12-19 14:48:46 UTC
You also need something similar for vulkan and opencl:

[📦 org.mozilla.Firefox ~]$ ls /usr/lib/GL/OpenCL/vendors/ /usr/lib/GL/vulkan/icd.d/
/usr/lib/GL/OpenCL/vendors/:
nvidia.icd

/usr/lib/GL/vulkan/icd.d/:
nvidia_icd.json


Note You need to log in before you can comment on or make changes to this bug.