[snap] Hardware accelerated video decoding does not work with nvidia proprietary drivers

Bug #1887172 reported by Ian Johnson
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

After installing the candidate/vaapi channel, I still do not get hardware acceleration for video decoding from my NVIDIA gpu, see:

```
$ LIBVA_MESSAGING_LEVEL=2 snap run chromium
Gtk-Message: 09:07:37.215: Failed to load module "canberra-gtk-module"
Gtk-Message: 09:07:37.216: Failed to load module "canberra-gtk-module"
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/chromium/1191/usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: va_openDriver() returns -1
[141337:141337:0710/090737.297551:ERROR:vaapi_wrapper.cc(480)] vaInitialize failed: unknown libva error
```

For me, I am on Focal, so I had to manually install the vdpau-va-driver from cosmic from https://launchpad.net/ubuntu/+source/vdpau-video/0.7.4-7, (presumably on i.e. 18.04 I could just have installed it with apt install), which provides the various files in /var/lib/snapd/gl/vdpau, and then I also had to add that package along with libvdpau1 into the chromium snap, at which point it loads the libraries but I then run into very relevant errors:

```
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/chromium/x3/usr/lib/x86_64-linux-gnu/dri/nvidia_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
[121136:121136:0710/082840.674481:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.674608:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileMPEG2Simple and entrypoint 1
[121136:121136:0710/082840.674647:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.674680:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileMPEG2Main and entrypoint 1
[121136:121136:0710/082840.674709:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.674739:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileMPEG4Simple and entrypoint 1
[121136:121136:0710/082840.674791:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.674817:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileMPEG4AdvancedSimple and entrypoint 1
[121136:121136:0710/082840.674844:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.674870:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileH264Baseline and entrypoint 1
[121136:121136:0710/082840.674896:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.674920:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileH264Main and entrypoint 1
[121136:121136:0710/082840.674946:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.674971:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileH264High and entrypoint 1
[121136:121136:0710/082840.674996:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.675020:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileVC1Simple and entrypoint 1
[121136:121136:0710/082840.675046:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.675073:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileVC1Main and entrypoint 1
[121136:121136:0710/082840.675097:ERROR:vaapi_wrapper.cc(900)] vaQuerySurfaceAttributes failed, VA error: invalid parameter
[121136:121136:0710/082840.675122:ERROR:vaapi_wrapper.cc(789)] FillProfileInfo_Locked failed for va_profile VAProfileVC1Advanced and entrypoint 1

```

at which point I am stuck trying to get it to work.

FWIW, this is with ubuntu 20.04, snapd 2.45.1, nvidia drivers 440, and X11 with gdm.

Also I had to modify the desktop-launch script with this PR: https://github.com/snapcore/snapcraft/pull/3209 otherwise it would not find the /var/lib/snapd/lib/gl/vdpau dir on $LD_LIBRARY_PATH

Tags: snap
Revision history for this message
Olivier Tilloy (osomon) wrote : Re: [snap] VA-API does not work with nvidia proprietary drivers

The first thing to do is add "vdpau-va-driver" to the stage packages.

Then I need to look into adding https://github.com/saiarcot895/chromium-ubuntu-build/blob/master/debian/patches/vdpau-support.patch (or maybe just https://aur.archlinux.org/cgit/aur.git/tree/nvidia-vdpau.patch?h=chromium-vaapi).

summary: - vaapi snap does not work with nvidia proprietary drivers
+ [snap] VA-API does not work with nvidia proprietary drivers
tags: added: snap
Changed in chromium-browser (Ubuntu):
assignee: nobody → Olivier Tilloy (osomon)
importance: Undecided → Medium
status: New → Triaged
description: updated
Revision history for this message
Daniel Letzeisen (dtl131) wrote :

I think this is part of the equation too (to fix vaquerysurface errors):
https://launchpad.net/~saiarcot895/+archive/ubuntu/chromium-dev/+sourcepub/10289116/+listing-archive-extra

Also, VP9 support might be a future goal: https://github.com/xtknight/vdpau-va-driver-vp9

I tried to merge all these various elements into one nice package in my PPA (and failed miserably). But, I am very much an amateur with packaging, so that doesn't mean it's impossible.

Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
assignee: Olivier Tilloy (osomon) → nobody
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Retitled to clarify that we're probably not expecting the Nvidia driver to ever support VA-API. It would be VDPAU support in Chromium instead per comment #1.

summary: - [snap] VA-API does not work with nvidia proprietary drivers
+ [snap] Hardware accelerated video decoding does not work with nvidia
+ proprietary drivers
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.