VAAPI: Update Snap to core22 to have an intel-media-driver version that supports Iris Xe
Categories
(Firefox Build System :: Third Party Packaging, task, P3)
Tracking
(firefox-esr102 disabled, firefox113 disabled, firefox114 disabled, firefox115 wontfix, firefox117 fixed)
People
(Reporter: mail, Unassigned)
References
(Blocks 1 open bug, )
Details
Attachments
(7 files)
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:98.0) Gecko/20100101 Firefox/98.0
Steps to reproduce:
Hello,
Ubuntu 22.04 recently forced a transition from the Firefox deb package to the snap package. Prior to this transition, VAAPI hardware video decoding was working perfectly fine for me (after setting media.ffmpeg.vaapi.enabled to true). After switching to the snap package, it's no longer working. The video still plays, but it's silently falling back to software decoding.
The video in question is just some random 4K VP9 video on Youtube:
https://www.youtube.com/watch?v=WZFIo4yj17c
To confirm whether VAAPI is working or not, I run Firefox with the following command:
MOZ_LOG="PlatformDecoderModule:5" firefox
I'm also checking "intel_gpu_top", which reports the utilization of the video decoding hardware. With the deb package, this floats around 20% while watching the video above (and I see a bunch of VAAPI decoding messages in the console output), whereas with the snap package, it's 0.
The system is an 11th Gen Intel i7 (Iris Xe integrated graphics), running Ubuntu MATE (so, X11, not Wayland).
I have attached some files containing the console output from when I run Firefox from the command line.
The following line sticks out at me:
[vp9 @ 0x7f0cb444f800] Failed to create decode context: 2 (resource allocation failed).
Which seems to be the result of a call to vaCreateContext() failing.
Actual results:
It falls back to software decoding.
Expected results:
It should have used the hardware decoder (utilization of video hardware decoder reported by "intel_gpu_top" should be non-zero).
Comment 2•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Audio/Video: Playback' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
![]() |
||
Updated•3 years ago
|
Comment 3•3 years ago
|
||
The log is:
[vp9 @ 0x7f0cb444f800] Considering format 0x3231564e -> nv12.
[vp9 @ 0x7f0cb444f800] Picked nv12 (0x3231564e) as best match for yuv420p.
[vp9 @ 0x7f0cb444f800] Failed to create decode context: 2 (resource allocation failed).
[vp9 @ 0x7f0cb444f800] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[vp9 @ 0x7f0cb444f800] Format vaapi_vld not usable, retrying get_format() without it.
Does decoding of any other media type work? (h264 & VP8)? Does va-api work in mpv for instance?
Also can you test latest nightly?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Testing_Mozilla_binaries
Thanks.
(In reply to Martin Stránský [:stransky] (ni? me) from comment #3)
The log is:
[vp9 @ 0x7f0cb444f800] Considering format 0x3231564e -> nv12.
[vp9 @ 0x7f0cb444f800] Picked nv12 (0x3231564e) as best match for yuv420p.
[vp9 @ 0x7f0cb444f800] Failed to create decode context: 2 (resource allocation failed).
[vp9 @ 0x7f0cb444f800] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[vp9 @ 0x7f0cb444f800] Format vaapi_vld not usable, retrying get_format() without it.Does decoding of any other media type work? (h264 & VP8)? Does va-api work in mpv for instance?
Also can you test latest nightly?
https://fedoraproject.org/wiki/How_to_debug_Firefox_problems?rd=Bug_info_Firefox#Testing_Mozilla_binariesThanks.
Good morning,
I just tried the nightly and that also doesn't work, but with a slightly different log:
[RDD 14407: Main Thread]: D/PlatformDecoderModule Agnostic decoder supports requested type
[RDD 14407: MediaSupervisor #1]: D/PlatformDecoderModule FFVPX: FFmpegVideoDecoder::FFmpegVideoDecoder MIME video/vp9 Codec ID 167
[RDD 14407: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Initialising VA-API FFmpeg decoder
[RDD 14407: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: codec vp9 : Google VP9
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
readlink -errno 13
I am able to play back local VP9 video files using MPV with VAAPI successfully.
Also, the Firefox deb package from the Ubuntu 22.04 repo worked too, but they removed it and replaced it with the snap.
Does the snap version of Firefox include a separate copy of the libigdgmm12 library? There is a bug in version 22.1.1+ds1-1 that was just pushed out to Ubuntu 22.04 which breaks even MPV decoding about a week ago, so I've been holding my version back at 22.0.2+ds1-1.
Comment 5•3 years ago
|
||
Okay, looks like snap packaging issue then.
Updated•3 years ago
|
Comment 6•3 years ago
|
||
The firefox snap relies on the VA-API drivers shipped by the gnome-3-38-2004 platform snap, which according to its manifest includes libigdgmm11=20.1.1+ds1-1.
Can you run the firefox snap with LIBVA_MESSAGING_LEVEL=2
and share the output here?
which according to its manifest includes libigdgmm11=20.1.1+ds1-1.
Interesting. Maybe I need a newer version for Iris Xe?
Also, for what it's worth, there was recently an issue with libigdgmm11=20.1.1+ds1-1.
I actually submitted a bug report for that to Ubuntu: https://bugs.launchpad.net/ubuntu/+source/intel-gmmlib/+bug/1966362
It has since been fixed as of libigdgmm11 22.1.2+ds1-1 I think the bug was caused by some ABI breakage, which required libigdgmm and intel-media-va-driver to be rebuilt.
Anyway, here's the output requested:
[2022-04-25T18:32:50Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
[2022-04-25T18:32:50Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
[2022-04-25T18:32:50Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
[2022-04-25T18:32:50Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/1232/gnome-platform/usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
I should point out that even though the driver open is returning 0, it's not actually working. It's still falling back to software decoding.
Sorry, the recent issue was with 22.1.1+ds1-1, not 20.1.1+ds1-1.
Comment 9•3 years ago
|
||
This is possibly a duplicate of bug 1751363.
Does disabling the RDD sandbox help? (run the firefox snap with MOZ_DISABLE_RDD_SANDBOX=1
)
Reporter | ||
Comment 10•3 years ago
|
||
Hello,
Here's the output when running with MOZ_DISABLE_RDD_SANDBOX=1
....
[2022-04-29T17:19:56Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
[2022-04-29T17:19:56Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
[2022-04-29T17:19:56Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
[2022-04-29T17:19:56Z ERROR mp4parse] Found 2 nul bytes in "\u{0}\u{0}"
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/1232/gnome-platform/usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
Comment 11•3 years ago
|
||
comment 10 does not contain the info whether VAAPI is used, it's too short.
- Please attach a log of playing a video with MOZ_DISABLE_RDD_SANDBOX=1 for ~2 seconds.
- Or does
$ sudo intel_gpu_top
show any hardware decoding activity now?
Reporter | ||
Comment 12•3 years ago
|
||
Console output from running firefox snap in the foreground via: MOZ_DISABLE_RDD_SANDBOX=1 MOZ_LOG="PlatformDecoderModule:5" firefox
While playing a Youtube video that should support VAAPI playback.
Reporter | ||
Comment 13•3 years ago
|
||
Console output from running firefox snap in the foreground via: MOZ_DISABLE_RDD_SANDBOX=1 firefox
While playing a Youtube video that should support VAAPI playback.
Reporter | ||
Comment 14•3 years ago
|
||
I've attached a couple of log files. If I just run firefox with MOZ_DISABLE_RDD_SANDBOX=1
, that's all the output I get, even after several seconds. Hardware decoding is not functional at that time (confirmed via intel_gpu_top).
If I add MOZ_LOG="PlatformDecoderModule:5"
, then I get continuous log messages, and hardware decoding still doesn't work.
When running with MOZ_LOG="PlatformDecoderModule:5"
, I noticed the following interesting lines:
[vp9 @ 0x7f3c3d96b100] Failed to create decode context: 2 (resource allocation failed).
[vp9 @ 0x7f3c3d96b100] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
Comment 16•3 years ago
|
||
If it fails only with Snap, it's probably a duplicate of bug 1772142.
Reporter | ||
Comment 17•3 years ago
|
||
Hello,
This bug is not fixed as of 102.0 (snap). Can we re-open?
It behaves the same as before.
Here's the log snippet:
[vp9 @ 0x7ff0c7266200] Considering format 0x3231564e -> nv12.
[vp9 @ 0x7ff0c7266200] Picked nv12 (0x3231564e) as best match for yuv420p.
[vp9 @ 0x7ff0c7266200] Failed to create decode context: 2 (resource allocation failed).
[vp9 @ 0x7ff0c7266200] Failed setup for format vaapi_vld: hwaccel initialisation returned error.
[vp9 @ 0x7ff0c7266200] Format vaapi_vld not usable, retrying get_format() without it.
[RDD 23480: MediaPDecoder #1]: D/PlatformDecoderModule FFVPX: Choosing FFmpeg pixel format for VA-API video decoding.
[vp9 @ 0x7ff0c7266200] Failed to initialize decoder for 1280x720 @ 0
Comment 18•3 years ago
|
||
It should have been fixed in 103 (nightly).
sudo snap install firefox --edge
Reporter | ||
Comment 19•3 years ago
|
||
Reporter | ||
Comment 20•3 years ago
|
||
Unfortunately, this bug still exists for me in version 103. The log looks basically the same, but I've attached a new text file anyway.
For what it's worth, vaapi did work previously before the switch to snap, so I know my system isn't at least totally broken.
Comment 21•2 years ago
|
||
I confirm this bug here on Alder Lake - Intel XE laptop
Firefox 106.0.2 (64 bits) SNAP
Ffmpeg shows : "glxtest: VA-API test failed: failed to initialise VAAPI connection"
Any other application including firefox deb works perfectly with vaapi
it seems the included driver / LibVA in gnome-3-38 platform is too old for this hardware ?
Are we going back to a dependency problem ? which we tried to avoid with snap ?
Comment 22•2 years ago
|
||
(In reply to michel memeteau from comment #21)
I confirm this bug here on Alder Lake - Intel XE laptop
Firefox 106.0.2 (64 bits) SNAP
Ffmpeg shows : "glxtest: VA-API test failed: failed to initialise VAAPI connection"Any other application including firefox deb works perfectly with vaapi
it seems the included driver / LibVA in gnome-3-38 platform is too old for this hardware ?
Are we going back to a dependency problem ? which we tried to avoid with snap ?
Can you share about:support
from both deb and snap ? Knowing which versions of the driver you have in both case could be valuable as well.
Comment 23•2 years ago
|
||
about:support from :
snap https://pastebin.ubuntu.com/p/pmWSBWWVhz/
deb https://pastebin.ubuntu.com/p/5yjVG2V4v3/
system vainfo :
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
Comment 24•2 years ago
|
||
Comment 25•2 years ago
|
||
Comment 26•2 years ago
|
||
(In reply to michel memeteau from comment #23)
system vainfo :
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.3.1 ()
Are the same versions reported by snap?
Comment 27•2 years ago
|
||
I'm not sure how to verify the version from the snap firefox shell , but as it is connect to gnome3.38 platform and I can see
/snap/gnome-3-38-2004/119/usr/lib/x86_64-linux-gnu/libva.so.2.700.0
Firefox is using libva from 20.04 which is too old to handle Intel Iris XE
Is this that simple ?
We should then migrate the base platform to the latest gnome to grab 22.04 libs ?
Comment 28•2 years ago
|
||
(In reply to michel memeteau from comment #27)
I'm not sure how to verify the version from the snap firefox shell , but as it is connect to gnome3.38 platform and I can see
/snap/gnome-3-38-2004/119/usr/lib/x86_64-linux-gnu/libva.so.2.700.0
Firefox is using libva from 20.04 which is too old to handle Intel Iris XE
Is this that simple ?
We should then migrate the base platform to the latest gnome to grab 22.04 libs ?
I think you can check with snap run --shell firefox
and from there perform a vainfo
call. But the above lib seems to match your theory. I guess we need to defer to Olivier on whether this is expected or not, but I'm afraid you might be right.
Comment 29•2 years ago
|
||
Firefox is using libva from 20.04 which is too old to handle Intel Iris XE
That sounds plausible.
I am working on upgrading firefox's base to core22 and gnome-42-2204, which ships libva.so.2.1400.0. Would that be enough to support Intel Iris XE ?
Comment 30•2 years ago
|
||
That would be great !
Yes gnome-42-2204 would work as on 22.04 firefox deb ( and others) play vaapi supported ( except av1 ) streams without problems.
Do you have Intel Iris hardware to validate this test case ? I can make a test machine available is needed here
I will open ( if not already raised) 2 other bugs :
- ffmpeg in firefox does not use VAAPI for AV1 ( I think it needs a 5.X version )
- We need to ship vaapi enable firefox settings as a default and propose a disable setting for users in case of problems.
Comment 31•2 years ago
|
||
Hello , you can test the candidate/core22 snap channel , which is based on Ubuntu 22.04 and thus brings a compatible version of the vaapi stack with Intel XE graphics
ASA this channel is merged into stable , this bug will be closed
I've tested with sucess with all codecs ( VP9 , H264 etc..) supported by the current 22.04 ffmpeg version and it works perfectly
To enable AV1 hardware VAAPI decoding , we need to update the ffmpeg version in the snap , tracked here https://bugzilla.mozilla.org/show_bug.cgi?id=1798512
Comment 32•2 years ago
|
||
Hello, I gave a try to the candidate:
sudo snap refresh firefox --channel candidate/core22
But immediately faced:
Content snap command-chain for /snap/firefox/2320/gnome-platform/command-chain/desktop-launch not found: ensure slot is connected
Video acceleration works fine, also with AV1 when running nightly directly on the machine, without snap.
Comment 33•2 years ago
|
||
Is this core22 update just awaiting feedback from users before it's merged? I'd switch to the core22 branch and try it out, but I'm already on FF 110 by now and candidate/core22 is on FF 109 so I think I'd need to make fresh profile to use this version at this point. If I can confirm my feedback will be useful or if this is updated for 110, I'll try out the core22 branch. Will this go in beta or edge first so it gets wider testing before everyone gets it?
Comment 34•2 years ago
|
||
Redirecting needinfo from comment 33 to Amin.
Comment hidden (obsolete) |
Updated•2 years ago
|
Comment 37•2 years ago
|
||
Offtopic/Verified:
I don't have Iris Xe, but old Intel Iris Graphics 6100 (BDW GT3):
VAAPI (Xwayland+Wayland) seems to work in Nightly snap (core20) on KDE Wayland, Debian Testing.
$ sudo snap install firefox --edge
$ snap list
Name Version Rev Tracking Publisher Notes
bare 1.0 5 latest/stable canonical✓ base
core20 20230503 1891 latest/stable canonical✓ base
firefox 115.0a1 2727 latest/edge mozilla✓ -
gnome-3-38-2004 0+git.6f39565 140 latest/stable canonical✓ -
gtk-common-themes 0.1-81-g442e511 1535 latest/stable canonical✓ -
snapd 2.59.2 19122 latest/stable canonical✓ snapd
$ sudo intel_gpu_top
$ MOZ_LOG="Dmabuf:5,PlatformDecoderModule:5" MOZ_ENABLE_WAYLAND=0 DISABLE_WAYLAND=1 snap run firefox
libva info: VA-API version 1.7.0
libva info: Trying to open /snap/firefox/2727/gnome-platform/usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
[RDD 25223: MediaPDecoder #1]: D/PlatformDecoderModule FFMPEG: VA-API Got one frame output with pts=120000 dts=160000 duration=40000 opaque=-9223372036854775808
Comment 38•2 years ago
|
||
Offtopic:
https://github.com/ubuntu/gnome-sdk/issues/132 (libva 2.17: https://github.com/intel/libva/commit/ef1df02f3ad45ac98b1fa57c373176d7c14dcc57) is irrelevant for Firefox.
Firefox doesn't use X11 VAAPI, but DRM VAAPI (bug 1580166 comment 6). That's why VAAPI works for me with Snap's libva 1.7.0 on Xwayland.
Comment 39•2 years ago
•
|
||
Important for Intel (WebGL || VAAPI) on Ubuntu:
Ubuntu 22.04 LTS jammy and 22.10 kinetic are still affected by bug 1779558 (main process crash under high load/multiple videos/after 20min of AV1).
Please ship kernel 6.1.4 to them or backport the specific patch:
(Darkspirit from bug 1779558 comment 30)
[...]
(https://gitlab.freedesktop.org/drm/intel/-/issues/7570#note_1692847, https://patchwork.freedesktop.org/series/111686/).The fix landed in Linux kernel 6.1.4:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2003687
Linux 6.1.4
drm/i915: improve the catch-all evict to handle lock contention
https://packages.ubuntu.com/search?keywords=linux-image-generic
- fixed: 23.10 mantic: 6.2.0.21.21
- fixed: 23.04 lunar: 6.2.0.20.20
- affected: 22.10 kinetic-updates: 5.19.0.1018.15
- affected: 22.04 LTS jammy-updates: 5.19.0.1018.19~22.04.1
Debian:
- fixed: https://packages.debian.org/bookworm/linux-image-amd64 (6.1.27-1) - bookworm becomes stable on 2023-06-10
- fixed: https://packages.debian.org/bullseye-backports/linux-image-amd64 (6.1.15-1~bpo11+1)
- affected: https://packages.debian.org/bullseye/linux-image-amd64 (5.10.178-3)
Fedora: https://packages.fedoraproject.org/pkgs/kernel/kernel/
- fixed: Fedora Rawhide (6.4.0-0.rc2.23.fc39)
- fixed: Fedora 38 (6.2.15-300.fc38)
- fixed: Fedora 37 (6.2.15-200.fc37)
- fixed: Fedora 36 (6.1.7@2023-01-18. now 6.2.15)
Updated•1 years ago
|
Description
•