VA error: resource allocation failed

Bug #1990010 reported by Bram Stolk
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Fix Released
Medium
Bram Stolk

Bug Description

https://github.com/intel/media-driver/issues/1498

---

When I play a H264/AAC video with HW decoding enabled on Alderlake 12600k, using Wayland I get the error:

vaCreateSurfaces (import mode) failed, VA error: resource allocation failed

After which, chromium will proceed to play the video without HW acceleration using ffmpeg.

This is both with using the pre-built snap from channel beta/hwacc and a snap built from source.

(NOTE: HW decoding does work with same browser on X11 desktop, using VDAVideoDecoder.)

To get more information on this VA error, I built the snap with debug versions of gmmlib and media-driver (latest git) using the latest git from valib as well.

The log output from chromium now mentions why the allocation fails:

[390012:14:0916/112615.428584:INFO:decoder.cc(41)] DecryptingVideoDecoder
[389969:390095:0916/112615.445970:INFO:decoder.cc(65)] VDAVideoDecoder
[390012:14:0916/112615.449426:INFO:decoder.cc(65)] VDAVideoDecoder
[390012:14:0916/112615.449500:INFO:decoder.cc(65)] VDAVideoDecoder
[LIBVA]:CRITICAL - DdiMediaUtil_AllocateSurface:378: Unsupported modifier.
[389969:389969:0916/112615.467062:ERROR:vaapi_wrapper.cc(2389)] vaCreateSurfaces (import mode) failed, VA error: resource allocation failed
[389969:389969:0916/112615.467212:ERROR:vaapi_picture_native_pixmap_ozone.cc(66)] Failed creating VASurface for NativePixmap
[LIBVA]:CRITICAL - DdiMediaUtil_AllocateSurface:378: Unsupported modifier.
[389969:389969:0916/112615.468871:ERROR:vaapi_wrapper.cc(2389)] vaCreateSurfaces (import mode) failed, VA error: resource allocation failed
[389969:389969:0916/112615.468987:ERROR:vaapi_picture_native_pixmap_ozone.cc(66)] Failed creating VASurface for NativePixmap
[389969:389969:0916/112615.469140:ERROR:vaapi_video_decode_accelerator.cc(129)] {"code":6,"data":{},"group":"VaapiStatusCode","message":"","stack":[{"file":"media/gpu/vaapi/vaapi_picture_native_pixmap_ozone.cc","line":67}]}
[390012:14:0916/112615.469740:INFO:decoder.cc(32)] VpxVideoDecoder
[390012:14:0916/112615.470169:INFO:decoder.cc(44)] Dav1dVideoDecoder
[390012:14:0916/112615.471713:INFO:decoder.cc(29)] FFmpegVideoDecoder
[390012:14:0916/112615.471819:INFO:decoder.cc(29)] FFmpegVideoDecoder

Note the message: "DdiMediaUtil_AllocateSurface:378: Unsupported modifier."

I am on wayland, and use these chromium flags:

export CHROMIUM_FLAGS="--enable-logging=stderr --use-gl=egl --enable-features=VaapiVideoDecoder,VaapiVideoEncoder --disable-features=UseChromeOSDirectVideoDecoder --ignore-gpu-blocklist --disable-gpu-driver-bug-workaround --ozone-platform=wayland"

The video that fails: the 1080p/60 version downloaded from here: https://github.com/chthomos/video-media-samples/

I will figure out which is the "unsupported modifier" and report back, here.

Note: currently gmmlib and media-driver have failing debug builds, but I have created pull requests to both:
https://github.com/intel/media-driver/pull/1491
https://github.com/intel/gmmlib/pull/97

CPU: 12600k

GPU: Intel Alderlake_s (Gen12)

Snap built with: core20

Host OS: Ubuntu Kinetic

Tags: kinetic
Revision history for this message
Bram Stolk (b-stolk) wrote :

I added logging of the unsupported modifier value.

This is the value that it fails on:

[LIBVA]:CRITICAL - DdiMediaUtil_AllocateSurface:379: Unsupported modifier: 0x100000000000008

Revision history for this message
Bram Stolk (b-stolk) wrote :

The hex value 0100 0000 0000 0008 decodes to:

#define I915_FORMAT_MOD_Y_TILED_GEN12_RC_CCS_CC fourcc_mod_code(INTEL, 8)

This is not listed as supported by MediaLibvaCapsG12::SetExternalSurfaceTileFormat()

Revision history for this message
Bram Stolk (b-stolk) wrote :
Changed in chromium-browser (Ubuntu):
status: New → In Progress
importance: Undecided → Medium
Bram Stolk (b-stolk)
description: updated
Changed in chromium-browser (Ubuntu):
assignee: nobody → Nathan Teodosio (nteodosio)
tags: added: kinetic
Revision history for this message
Daniel van Vugt (vanvugt) wrote :
description: updated
Revision history for this message
Qinling Wang (helainewang) wrote :

Which build guide did you follow to build your chromium browser? Could you please provide us the version of your chromium browser and vainfo output information? Thank you!

Revision history for this message
Bram Stolk (b-stolk) wrote :

The chromium version and vainfo output are in the upstream issue:

https://github.com/intel/media-driver/issues/1498

The chromium build is via our snap, that integrates your patches.

Revision history for this message
Nathan Teodosio (nteodosio) wrote : Re: [Bug 1990010] Re: VA error: resource allocation failed

> Which build guide did you follow to build your chromium browser? Could
> you please provide us the version of your chromium browser and vainfo
> output information? Thank you!

Qinling, the snap against which we have been testing is built from [1].
(Please correct me, Bram, if you tested a different build.)

[1]: https://git.launchpad.net/~nteodosio/chromium-browser/tree/?h=dev

Revision history for this message
Bram Stolk (b-stolk) wrote :

I get this both on dev, and edge-hwacc, and snaps I build myself.
It consistently gives me a VA error on wayland, but works on X11.

On Wed, Sep 28, 2022 at 2:30 PM Nathan Teodosio <email address hidden>
wrote:

> > Which build guide did you follow to build your chromium browser? Could
> > you please provide us the version of your chromium browser and vainfo
> > output information? Thank you!
>
> Qinling, the snap against which we have been testing is built from [1].
> (Please correct me, Bram, if you tested a different build.)
>
> [1]: https://git.launchpad.net/~nteodosio/chromium-browser/tree/?h=dev
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1990010
>
> Title:
> VA error: resource allocation failed
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1990010/+subscriptions
>
>

--
Owner/Director of Game Studio Abraham Stolk Inc.
Vancouver BC, Canada
<email address hidden>

Revision history for this message
Qinling Wang (helainewang) wrote :

Could you please test the attached chromium-browser-unstable_104.0.5112.101-1_amd64.deb? Thank you!

Revision history for this message
Nathan Teodosio (nteodosio) wrote (last edit ):
  • log Edit (24.7 KiB, text/plain; charset=UTF-8; name="log")

> ** Attachment added: "chromium-browser-unstable_104.0.5112.101-1_amd64"
> https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1990010/+attachment/5620071/+files/chromium-browser-unstable_104.0.5112.101-1_amd64.deb

Thanks Qinling.

Playback is software accelerated as verified in about:media-internals
(kDecoderName is FfmpegVideoDecoder).

Tested on Wayland. Execution log is attached.

--->
% vainfo
libva info: VA-API version 1.15.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
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.15 (libva 2.12.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 22.4.3 ()
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple : VAEntrypointVLD
      VAProfileMPEG2Main : VAEntrypointVLD
      VAProfileH264Main : VAEntrypointVLD
      VAProfileH264Main : VAEntrypointEncSliceLP
      VAProfileH264High : VAEntrypointVLD
      VAProfileH264High : VAEntrypointEncSliceLP
      VAProfileJPEGBaseline : VAEntrypointVLD
      VAProfileJPEGBaseline : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3 : VAEntrypointVLD
      VAProfileHEVCMain : VAEntrypointVLD
      VAProfileHEVCMain10 : VAEntrypointVLD
      VAProfileVP9Profile0 : VAEntrypointVLD
      VAProfileVP9Profile2 : VAEntrypointVLD
<---

Revision history for this message
Qinling Wang (helainewang) wrote :

Validated HW decoding working fine with chromium-browser-unstable_104.0.5112.101-1_amd64.deb as the attached picture. Tested on Wayland.

Revision history for this message
Bram Stolk (b-stolk) wrote (last edit ):

@helainewang I can confirm that your .deb file indeed plays with HW decoding on my Alderlake machine.

If I pass:
```
--enable-logging=stderr
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder
--disable-features=UseChromeOSDirectVideoDecoder
```

Then the decoding is in sofware, with the following error from chromium:

```
[188746:188746:0929/141918.619668:ERROR:vaapi_wrapper.cc(2128)] vaCreateContext failed, VA error: unknown libva error
[188746:188746:0929/141918.619871:ERROR:vaapi_video_decode_accelerator.cc(726)] Failed to create Context
```

I was under the impression that UseChromeOSDirectVideoDecoder needs to be off, not on?

Following your guide: "Alder Lake P Platform Building Chromium* for Ubuntu* Wayland" (revision 0.5)
It states to use:

--use-gl=egl \
--enable-features=VaapiVideoDecoder, VaapiVideoEncoder \
--disable-features=UseChromeOSDirectVideoDecoder \
--ignore-gpu-blocklist \
--disable-gpu-driver-bug-workaround \
--ozone-platform=wayland

Revision history for this message
Bram Stolk (b-stolk) wrote (last edit ):

The 104.0.5112.101-1 debian package does indeed do vaapi hw decode for me on Alderlake.

$ LIBVA_TRACE=$HOME/va.log /usr/bin/chromium-browser-unstable --enable-logging=stderr ~/Downloads/*mp4

Revision history for this message
Qinling Wang (helainewang) wrote :

Thank you for letting me know 104.0.5112.101-1 does work on your Alderlake.

Revision history for this message
Qinling Wang (helainewang) wrote :

From build guild:
  use VaapiVideoDecoder:
--enable-features=VaapiVideoDecoder,\
VaapiVideoEncoder,UseChromeOSDirectVideoDecoder

  use legacy VDA:
--enable-features=VaapiVideoDecoder, VaapiVideoEncoder \
--disable-features=UseChromeOSDirectVideoDecoder

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

FFMpeg decoder either way for me. `intel_gpu_top` reports Cofeelake and
confirms no video decoding.

Revision history for this message
Bram Stolk (b-stolk) wrote :

I tried building a snap with 104.0.5112.101 version of chromium, and that gives me working HW-decode on Wayland.

A later change in chromium must have broken vaapi playback.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Makes sense (assuming the Libva etc. is the same), thanks for investigating this further!

Since you are the one working on this it is more accurate to transfer the assignment status to you. If you feel otherwise please let me know.

Changed in chromium-browser (Ubuntu):
assignee: Nathan Teodosio (nteodosio) → Bram Stolk (b-stolk)
Revision history for this message
Qinling Wang (helainewang) wrote :

Could you please test the attached chromium browser build 105.0.5195.19? Thank you! Hw decoding works fine with it on my setup.

Revision history for this message
Bram Stolk (b-stolk) wrote :

Yes, your r105 debian package works on my machine, with HW-decode under Wayland.

Are there any patches applied, other than the 3 mentioned in the building guide?

Revision history for this message
Nathan Teodosio (nteodosio) wrote : 105.0.5195.19 .deb results
  • chr105.log Edit (49.4 KiB, text/x-log; charset=UTF-8; name="chr105.log")

No dice here, FfmpegVideoDecoder ):

Revision history for this message
Qinling Wang (helainewang) wrote :

Which build guide do you have? Is that Revision 0.7? There are 7 patches rather than 3.

Revision history for this message
Bram Stolk (b-stolk) wrote : Re: [Bug 1990010] Re: VA error: resource allocation failed

Ah... that explains a lot!

Please send me the revised build guide! Mine is v0.5 from june!

Thanks!

On Thu, Oct 20, 2022 at 3:00 PM Qinling Wang <email address hidden>
wrote:

> Which build guide do you have? Is that Revision 0.7? There are 7 patches
> rather than 3.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1990010
>
> Title:
> VA error: resource allocation failed
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1990010/+subscriptions
>
>

--
Owner/Director of Game Studio Abraham Stolk Inc.
Vancouver BC, Canada
<email address hidden>

Cody Tipton (ctipton)
Changed in chromium-browser (Ubuntu):
status: In Progress → Fix Released
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.