chromium-ubuntu-build icon indicating copy to clipboard operation
chromium-ubuntu-build copied to clipboard

VAAPI/Intel acceleration in Chromium 87 on Ubuntu 20.04 broken on initialization with `VDA Error 4`

Open ronjouch opened this issue 3 years ago • 41 comments

EDIT 2020-10-21 SOLVED

The Hardware-accelerated video decode flag is set to Disabled by default in 87, you need to enable it manually, by:

  • Either passing flag --enable-accelerated-video-decode
  • Or going to chrome://flags and setting Hardware-accelerated video decode to Enabled

With the flag set, I confirm that hardware acceleration works for me in 87.0.4280.20-0ubuntu1~ppa1~20.04.1_amd64 on my Intel GPU with H264, VP8, VP9 videos.


@saiarcot895 the usual thread 😄. This time,

Logs using --use-gl=desktop, failing on VAAPI init with "VDA Error 4" chromium --incognito --ignore-gpu-blocklist --use-gl=desktop --enable-logging=stderr --loglevel=0 'https://www.youtube.com/watch?v=1d0Zf9sXlHk'
[77734:77734:0910/132434.453904:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[77695:77695:0910/132434.555422:WARNING:xproto_util.cc(54)] X error received: serial 291, error_code 129 (129), request_code 131, minor_code 46 (Unknown)
[77734:77734:0910/132435.523375:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[77766:16:0910/132435.524431:ERROR:batching_media_log.cc(38)] MediaEvent: {"error":"VDA Error 4"}
Fontconfig error: Cannot load default config file
[77734:77734:0910/132441.244757:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[77766:16:0910/132441.245599:ERROR:batching_media_log.cc(38)] MediaEvent: {"error":"VDA Error 4"}
[77734:77734:0910/132443.249826:ERROR:gles2_cmd_decoder.cc(2847)] [GroupMarkerNotSet(crbug.com/242999)!:783B3B6C1D560000]GL ERROR :GL_INVALID_ENUM : BackFramebuffer::Destroy: <- error from previous GL command
[77695:77695:0910/132443.265505:WARNING:pref_notifier_impl.cc(40)] Pref observer for media_router.cast_allow_all_ips found at shutdown.
Logs using --use-gl=egl, failing differently: chromium --incognito --ignore-gpu-blocklist --use-gl=egl --enable-logging=stderr --loglevel=0 'https://www.youtube.com/watch?v=1d0Zf9sXlHk'
[78350:78350:0910/132528.711788:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[78311:78311:0910/132528.838649:WARNING:xproto_util.cc(54)] X error received: serial 291, error_code 129 (129), request_code 131, minor_code 46 (Unknown)
[78350:78350:0910/132529.736037:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[78350:78350:0910/132529.737679:ERROR:gl_surface_egl.cc(767)] EGL Driver message (Error) eglCreateImageKHR: dri2_create_image_khr_texture
[78350:78350:0910/132529.737767:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER
[78350:78350:0910/132529.737833:ERROR:gl_surface_egl.cc(767)] EGL Driver message (Error) eglCreateImageKHR: dri2_create_image_khr_texture
[78350:78350:0910/132529.737873:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER
[78380:16:0910/132529.738359:ERROR:batching_media_log.cc(38)] MediaEvent: {"error":"VDA Error 4"}
Fontconfig error: Cannot load default config file
[78350:78350:0910/132534.845331:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[78350:78350:0910/132534.846397:ERROR:gl_surface_egl.cc(767)] EGL Driver message (Error) eglCreateImageKHR: dri2_create_image_khr_texture
[78350:78350:0910/132534.846474:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER
[78350:78350:0910/132534.846542:ERROR:gl_surface_egl.cc(767)] EGL Driver message (Error) eglCreateImageKHR: dri2_create_image_khr_texture
[78350:78350:0910/132534.846588:ERROR:gl_image_egl.cc(37)] Error creating EGLImage: EGL_BAD_PARAMETER
[78380:16:0910/132534.846765:ERROR:batching_media_log.cc(38)] MediaEvent: {"error":"VDA Error 4"}
[78311:78311:0910/132536.299623:WARNING:pref_notifier_impl.cc(40)] Pref observer for media_router.cast_allow_all_ips found at shutdown.

Extra details:

  • 86.0.4238.0-0ubuntu1~ppa1~20.04.1 acceleration was working well with --use-gl=desktop on the same video (yes, my Intel GPU accelerates VP9, confirmed by vainfo and intel_gpu_top/media-internals on 86)
  • Switching LIBVA_DRIVER_NAME between iHD / i965 makes no difference.
  • I don't see anything new in https://chromium.googlesource.com/chromium/src/+/master/docs/gpu/vaapi.md#vaapi-on-linux
  • In both egl/desktop cases, chrome://media-internals/ logs show:
00:00:00.134    kVideoDecoderName   "MojoVideoDecoder"
00:00:00.134    kIsPlatformVideoDecoder true
00:00:00.134    info    "Selected MojoVideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [1920,1080], visible rect: [0,0,1920,1080], natural size: [1920,1080], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
00:00:00.134    pipeline_state  "kPlaying"
00:00:00.134    error   "VDA Error 4"
00:00:00.135    warning "video fallback to new decoder after initial decode error."

Feel free to ask for more details. As usual, thanks a lot for your packaging work 🙂.

ronjouch avatar Sep 10 '20 17:09 ronjouch

Same here (but nvidia, not intel) with 87.x. - downgrading to 86.x.y works (including hardware acceleration for everything(?) but 4k-60fps).

sebibasti0815 avatar Sep 13 '20 11:09 sebibasti0815

Same thing here @miwalter

insilications avatar Sep 20 '20 10:09 insilications

@saiarcot895 problem reproduced with recently-released 87.0.4263.3-0ubuntu1~ppa5~20.04.1_amd64, in all 4 {LIBVA_DRIVER_NAME, --use-gl combinations.

Can you reproduce the issue? Should I file a Chromium bug?

ronjouch avatar Oct 02 '20 12:10 ronjouch

I haven't had a chance to debug this, because I'm trying to play catch-up with the weekly releases.

saiarcot895 avatar Oct 05 '20 19:10 saiarcot895

Can confirm on amdgpu, so something's generally broken with VAAPI on 87. I haven't yet had time to investigate.

lorenz avatar Oct 12 '20 20:10 lorenz

Same here, details

xontik avatar Oct 13 '20 16:10 xontik

Same here.

Note: I am using VDPAU so I think this is not an issue related to Vaapi itself. I think this is related to recent Chromium code.

Oober avatar Oct 17 '20 15:10 Oober

With Nvidia and VDPAU, a workaround is to use a launch command chromium-browser --use-gl=desktop

This apparently is related to another filed bug and the angle driver: https://github.com/saiarcot895/chromium-ubuntu-build/issues/91#issuecomment-711087397

Oober avatar Oct 18 '20 09:10 Oober

I use "--use-gl=desktop" for a couple of month now, it does not enable hardware acceleration for 87.* builds (it does for 86.* builds!) on nvidia gpus.

This is my command line (seen at chrome://gpu).

/usr/lib/chromium-browser/chromium-browser --enable-gpu-rasterization --enable-native-gpu-memory-buffers --ignore-gpu-blocklist --enable-gpu-compositing --enable-webgl --disable-gpu-sandbox --enable-oop-rasterization --enable-accelerated-video --enable-accelerated-mjpeg-decode --enable-zero-copy --test-type --enable-pinch --enable-gpu-rasterization --enable-native-gpu-memory-buffers --ignore-gpu-blocklist --enable-gpu-compositing --enable-webgl --disable-gpu-sandbox --enable-oop-rasterization --enable-accelerated-video --enable-accelerated-mjpeg-decode --enable-zero-copy --disable-gpu-driver-workarounds --use-gl=desktop --test-type --enable-gpu-rasterization --enable-native-gpu-memory-buffers --ignore-gpu-blocklist --enable-gpu-compositing --enable-webgl --disable-gpu-sandbox --enable-oop-rasterization --enable-accelerated-video --enable-accelerated-mjpeg-decode --enable-zero-copy --disable-gpu-driver-workarounds --use-gl=desktop --test-type --flag-switches-begin --enable-accelerated-video-decode --enable-gpu-rasterization --enable-smooth-scrolling --flag-switches-end --file-url-path-alias=/gen=/usr/lib/chromium-browser/gen

Using Xorg. Nvidia driver 450.80.02, GeForce GTX 1660 Ti.

sebibasti0815 avatar Oct 18 '20 09:10 sebibasti0815

I use "--use-gl=desktop" for a couple of month now, it does not enable hardware acceleration for 87.* builds (it does for 86.* builds!) on nvidia gpus.

This is my command line (seen at chrome://gpu).

/usr/lib/chromium-browser/chromium-browser --enable-gpu-rasterization --enable-native-gpu-memory-buffers --ignore-gpu-blocklist --enable-gpu-compositing --enable-webgl --disable-gpu-sandbox --enable-oop-rasterization --enable-accelerated-video --enable-accelerated-mjpeg-decode --enable-zero-copy --test-type --enable-pinch --enable-gpu-rasterization --enable-native-gpu-memory-buffers --ignore-gpu-blocklist --enable-gpu-compositing --enable-webgl --disable-gpu-sandbox --enable-oop-rasterization --enable-accelerated-video --enable-accelerated-mjpeg-decode --enable-zero-copy --disable-gpu-driver-workarounds --use-gl=desktop --test-type --enable-gpu-rasterization --enable-native-gpu-memory-buffers --ignore-gpu-blocklist --enable-gpu-compositing --enable-webgl --disable-gpu-sandbox --enable-oop-rasterization --enable-accelerated-video --enable-accelerated-mjpeg-decode --enable-zero-copy --disable-gpu-driver-workarounds --use-gl=desktop --test-type --flag-switches-begin --enable-accelerated-video-decode --enable-gpu-rasterization --enable-smooth-scrolling --flag-switches-end --file-url-path-alias=/gen=/usr/lib/chromium-browser/gen

Using Xorg. Nvidia driver 450.80.02, GeForce GTX 1660 Ti.

Weird. My current version is 87.0.4280.20 and working with —use-gl=desktop.

Are you using nouveau/vaapi or proprietary drivers and vdpau?

Oober avatar Oct 18 '20 12:10 Oober

Weird. My current version is 87.0.4280.20 and working with —use-gl=desktop.

Are you using nouveau/vaapi or proprietary drivers and vdpau?

I'm using the proprietary drivers (so vdpau I guess). Are you sure, that "mojovideodecoder" (chrome://media-internals/) is used (e.g. using this video: https://www.youtube.com/watch?v=Xt5kJp9xOLw&t=0s)?

Chrome tells me at the top of "chrome://gpu" it will be using hardware acceleration - but it does not (so, not using MojoVideoDecoder") for 87.* builds.

sebibasti0815 avatar Oct 18 '20 15:10 sebibasti0815

Weird. My current version is 87.0.4280.20 and working with —use-gl=desktop. Are you using nouveau/vaapi or proprietary drivers and vdpau?

I'm using the proprietary drivers (so vdpau I guess). Are you sure, that "mojovideodecoder" (chrome://media-internals/) is used (e.g. using this video: https://www.youtube.com/watch?v=Xt5kJp9xOLw&t=0s)?

Chrome tells me at the top of "chrome://gpu" it will be using hardware acceleration - but it does not (so, not using MojoVideoDecoder") for 87.* builds.

You should ensure that vdpau-va-driver is installed.

Yes, Mojo is used with 87, using --use-gl=desktop string.

Oober avatar Oct 18 '20 15:10 Oober

My friend, I'm sure, that hardware acceleration is working very good for many month (ok, maybe weeks) using 86.* - only thing different on my setup without working hardware acceleration is 87.* (I downgraded to 86 because of this bug).

I think the problem is somewhere in the 87-release, not in my setup.

vdpau is working here. I'm using it for mpv- and celluloid accelerated video playback, too.

display: :1   screen: 0
API version: 1
Information string: NVIDIA VDPAU Driver Shared Library  450.80.02  Wed Sep 23 00:46:46 UTC 2020
libvdpau-va-gl1/focal,now 0.4.2-1build2 amd64  [installiert]
vdpau-va-driver/now 0.7.4-6ubuntu1 amd64  [Installiert,aktualisierbar auf: 0.7.4-7ubuntu1~ppa2~20.04.1]

sebibasti0815 avatar Oct 18 '20 17:10 sebibasti0815

Just to be sure, I tested the current 87-build a couple of minutes ago. No hardware acceleration - no video at all, to be honest (using --use-gl=desktop, otherwise plays video without acceleration):

[42539:42539:1018/195341.402159:WARNING:gpu_video_decode_accelerator_factory.cc(223)] : Initializing VAAPI VDA. [42539:45708:1018/195341.432029:ERROR:vaapi_utils.cc(47)] : vaMapBuffer failed: invalid VABufferID [42539:45708:1018/195341.432050:ERROR:vaapi_video_decode_accelerator.cc(528)] : Error decoding stream

sebibasti0815 avatar Oct 18 '20 17:10 sebibasti0815

As a small update here, on 87.0.4280.11 on Ubuntu 20.04, hardware video decoding appears to be working on both AMD GPU (integrated GPU on Ryzen 3400G) and Intel GPU.

AMD GPU:

$ chromium-browser --enable-logging=stderr --loglevel=0 --vmodule=vaapi_wrapper=4,vaapi_video_decode_accelerator=4
...
[1137086:1137086:1018/105244.861091:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[1137086:1137086:1018/105244.861224:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: h264 high
[1137086:1139404:1018/105244.882191:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[1137086:1137086:1018/105244.882509:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 6; |requested_num_reference_frames_| = 6
[1137086:1137086:1018/105244.882580:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 6 pictures of size: 1920x1088 and visible rectangle = 0,0 1920x1080
[1137086:1137086:1018/105253.958302:VERBOSE2:vaapi_video_decode_accelerator.cc(907)] Flush(): Got flush request
[1137086:1139404:1018/105254.018833:VERBOSE2:vaapi_video_decode_accelerator.cc(886)] FlushTask(): 
[1137086:1137086:1018/105254.020601:VERBOSE2:vaapi_video_decode_accelerator.cc(914)] FinishFlush(): 
[1137086:1137086:1018/105254.262510:VERBOSE2:vaapi_video_decode_accelerator.cc(914)] FinishFlush(): 
[1137086:1139404:1018/105254.275889:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[1137086:1137086:1018/105254.276071:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 6; |requested_num_reference_frames_| = 7
[1137086:1137086:1018/105254.276343:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 0
[1137086:1137086:1018/105254.276395:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 1
[1137086:1137086:1018/105254.276441:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 2
[1137086:1137086:1018/105254.276489:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 3
[1137086:1137086:1018/105254.276534:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 4
[1137086:1137086:1018/105254.276578:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 5
[1137086:1137086:1018/105254.277662:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 6 pictures of size: 1280x720 and visible rectangle = 0,0 1280x720
[1137086:1137086:1018/105255.242911:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA
[1137086:1137086:1018/105255.346341:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[1137086:1137086:1018/105255.346452:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: h264 high
[1137086:1137086:1018/105255.367426:VERBOSE2:vaapi_video_decode_accelerator.cc(967)] Reset(): Got reset request
[1137086:1139490:1018/105255.367557:VERBOSE2:vaapi_video_decode_accelerator.cc(946)] ResetTask(): 
[1137086:1137086:1018/105255.367683:VERBOSE2:vaapi_video_decode_accelerator.cc(989)] FinishReset(): 
[1137086:1139490:1018/105255.368108:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[1137086:1137086:1018/105255.368329:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 6; |requested_num_reference_frames_| = 6
[1137086:1137086:1018/105255.368383:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 6 pictures of size: 1920x1088 and visible rectangle = 0,0 1920x1080
[1137086:1137086:1018/105337.797919:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA
[1137086:1137086:1018/105343.395431:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[1137086:1137086:1018/105343.395531:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: h264 high
[1137086:1139781:1018/105343.421450:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[1137086:1137086:1018/105343.421646:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 6; |requested_num_reference_frames_| = 6
[1137086:1137086:1018/105343.421700:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 6 pictures of size: 1920x1088 and visible rectangle = 0,0 1920x1080
[1137086:1137086:1018/105402.563846:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA
[1137086:1137086:1018/105410.058135:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[1137086:1137086:1018/105410.058267:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: h264 high
[1137086:1139930:1018/105410.072369:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[1137086:1137086:1018/105410.072507:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 6; |requested_num_reference_frames_| = 6
[1137086:1137086:1018/105410.072572:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 6 pictures of size: 1920x1088 and visible rectangle = 0,0 1920x1080
[1137086:1137086:1018/105428.533245:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA
[1137086:1137086:1018/105429.025015:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[1137086:1137086:1018/105429.025177:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: vp9 profile0
[1137086:1140046:1018/105429.045510:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[1137086:1137086:1018/105429.045633:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 5; |requested_num_reference_frames_| = 9
[1137086:1137086:1018/105429.045693:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 5 pictures of size: 1920x1080 and visible rectangle = 0,0 1920x1080
[1137086:1137086:1018/105445.156116:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA

On AMD GPU, h264 appears to be smooth (with the h264ify extension), but vp9 at 720p or greater (maybe 1080p or greater in some cases) is choppy, where it plays 2-3 seconds, pauses for 0.5-1 second, and resumes playing again. I've only tested up to 1080p.

Intel GPU:

$ chromium-browser --enable-logging=stderr --loglevel=0 --vmodule=vaapi_wrapper=4,vaapi_video_decode_accelerator=4
...
[69331:69331:1018/110545.250952:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[69331:69331:1018/110545.251083:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: vp9 profile0
[69331:70042:1018/110545.251948:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[69331:69331:1018/110545.252066:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 5; |requested_num_reference_frames_| = 9
[69331:69331:1018/110545.252142:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 5 pictures of size: 640x360 and visible rectangle = 0,0 640x360
[69331:69331:1018/110550.002120:VERBOSE2:vaapi_video_decode_accelerator.cc(907)] Flush(): Got flush request
[69331:70042:1018/110550.117049:VERBOSE2:vaapi_video_decode_accelerator.cc(886)] FlushTask(): 
[69331:69331:1018/110550.121197:VERBOSE2:vaapi_video_decode_accelerator.cc(914)] FinishFlush(): 
[69331:69331:1018/110550.300166:VERBOSE2:vaapi_video_decode_accelerator.cc(914)] FinishFlush(): 
[69331:70042:1018/110550.330349:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[69331:69331:1018/110550.330509:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 5; |requested_num_reference_frames_| = 9
[69331:69331:1018/110550.330650:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 0
[69331:69331:1018/110550.330729:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 1
[69331:69331:1018/110550.330787:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 2
[69331:69331:1018/110550.330846:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 3
[69331:69331:1018/110550.330902:VERBOSE2:vaapi_video_decode_accelerator.cc(632)] TryFinishSurfaceSetChange(): Dismissing picture id: 4
[69331:69331:1018/110550.331180:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 5 pictures of size: 854x480 and visible rectangle = 0,0 854x480
[69331:69331:1018/110551.722278:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA
[69331:69331:1018/110551.882706:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[69331:69331:1018/110551.882813:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: vp9 profile0
[69331:69331:1018/110551.904832:VERBOSE2:vaapi_video_decode_accelerator.cc(967)] Reset(): Got reset request
[69331:70090:1018/110551.905096:VERBOSE2:vaapi_video_decode_accelerator.cc(946)] ResetTask(): 
[69331:69331:1018/110551.905279:VERBOSE2:vaapi_video_decode_accelerator.cc(989)] FinishReset(): 
[69331:70090:1018/110551.928036:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[69331:69331:1018/110551.928341:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 5; |requested_num_reference_frames_| = 9
[69331:69331:1018/110551.928430:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 5 pictures of size: 1920x1080 and visible rectangle = 0,0 1920x1080
[69331:69331:1018/110624.487567:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA
[69331:69331:1018/110624.729669:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.
[69331:69331:1018/110624.729806:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: vp9 profile0
[69331:69331:1018/110624.758176:VERBOSE2:vaapi_video_decode_accelerator.cc(967)] Reset(): Got reset request
[69331:70149:1018/110624.758796:VERBOSE2:vaapi_video_decode_accelerator.cc(946)] ResetTask(): 
[69331:69331:1018/110624.759194:VERBOSE2:vaapi_video_decode_accelerator.cc(989)] FinishReset(): 
[69331:70149:1018/110624.797771:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces
[69331:69331:1018/110624.797913:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange():  |requested_num_pics_| = 5; |requested_num_reference_frames_| = 9
[69331:69331:1018/110624.797996:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 5 pictures of size: 2560x1440 and visible rectangle = 0,0 2560x1440
[69331:69331:1018/110714.941388:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA
[69975:21:1018/110714.941419:ERROR:batching_media_log.cc(38)] MediaEvent: {"error":"video decode error!"}
[69975:1:1018/110714.944498:ERROR:batching_media_log.cc(35)] MediaEvent: {"pipeline_error":3}

On Intel GPU, playback is smooth up to 1440p.

saiarcot895 avatar Oct 18 '20 18:10 saiarcot895

Additionally, the --use-gl=desktop flag might not be needed; last I checked, the default is to use egl, and there is some code committed to support hardware video decoding via egl.

saiarcot895 avatar Oct 18 '20 18:10 saiarcot895

Additionally, the --use-gl=desktop flag might not be needed; last I checked, the default is to use egl, and there is some code committed to support hardware video decoding via egl.

Seems to be mandatory for Nvidia/VDPAU users. See: https://github.com/saiarcot895/chromium-ubuntu-build/issues/91#issuecomment-711087397

Oober avatar Oct 19 '20 13:10 Oober

it looks like my GPU (Intel UHD Graphics G1 (Ice Lake 32 EU)) is to new for the i965_drv_video.so driver. Only iHD_drv_video.so will work, see vainfo

$ LIBVA_DRIVER_NAME=iHD vainfo libva info: VA-API version 1.7.0 libva info: User environment variable requested driver 'iHD' libva info: Trying to open /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 vainfo: VA-API version: 1.7 (libva 2.6.0) vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 20.1.1 () vainfo: Supported profile and entrypoints

$ LIBVA_DRIVER_NAME=i965 vainfo libva info: VA-API version 1.7.0 libva info: User environment variable requested driver 'i965' libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so libva info: Found init function __vaDriverInit_1_6 libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed libva info: va_openDriver() returns -1 vaInitialize failed with error code -1 (unknown libva error),exit

I want start Chromium with forced iHD but i looks like it always falls back or is hardwired to i965_drv_video.so and failed Hardware Acceleration.

$ LIBVA_DRIVER_NAME=iHD chromium-browser --enable-logging=stderr --loglevel=0 --vmodule=vaapi_wrapper=4,vaapi_video_decode_accelerator=4 --ignore-gpu-blocklist --use-gl=desktop 'https://www.youtube.com/watch?v=1d0Zf9sXlHk' libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed [19365:19365:1020/002552.072346:ERROR:vaapi_wrapper.cc(607)] vaInitialize failed: unknown libva error

it try to move HD_drv_video.so -> i965_drv_video.so, so it is forced to use HD_drv_video.so an then i got this

chromium-browser --enable-logging=stderr --loglevel=0 --vmodule=vaapi_wrapper=4,vaapi_video_decode_accelerator=4 --ignore-gpu-blocklist --use-gl=desktop 'https://www.youtube.com/watch?v=1d0Zf9sXlHk' [21158:21158:1020/003013.119030:VERBOSE1:vaapi_wrapper.cc(845)] Unsupported value 2 for VAConfigAttribRateControl [21158:21158:1020/003013.119120:VERBOSE1:vaapi_wrapper.cc(845)] Unsupported value 2 for VAConfigAttribRateControl [21158:21158:1020/003013.119199:VERBOSE1:vaapi_wrapper.cc(845)] Unsupported value 2 for VAConfigAttribRateControl [21158:21158:1020/003013.131134:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process. [21158:21158:1020/003013.775293:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA. [21158:21158:1020/003013.775380:VERBOSE2:vaapi_video_decode_accelerator.cc(204)] Initialize(): Initializing VAVDA, profile: h264 main [21158:21273:1020/003013.775970:VERBOSE2:vaapi_video_decode_accelerator.cc(479)] DecodeTask(): Decoder requesting a new set of surfaces [21158:21158:1020/003013.776071:VERBOSE2:vaapi_video_decode_accelerator.cc(574)] InitiateSurfaceSetChange(): |requested_num_pics_| = 6; |requested_num_reference_frames_| = 10 [21158:21158:1020/003013.776122:VERBOSE2:vaapi_video_decode_accelerator.cc(639)] TryFinishSurfaceSetChange(): Requesting 6 pictures of size: 640x368 and visible rectangle = 0,0 640x360 [21158:21158:1020/003013.786464:ERROR:vaapi_wrapper.cc(2000)] vaPutSurface failed, VA error: unknown libva error [21158:21158:1020/003013.786556:ERROR:vaapi_video_decode_accelerator.cc(290)] Failed putting surface into pixmap [21158:21158:1020/003013.786601:VERBOSE1:vaapi_video_decode_accelerator.cc(141)] NotifyError(): Notifying of error 4 [21186:15:1020/003013.786737:ERROR:batching_media_log.cc(38)] MediaEvent: {"error":"VDA Error 4"} [21158:21158:1020/003013.787521:VERBOSE2:vaapi_video_decode_accelerator.cc(1038)] Cleanup(): Destroying VAVDA

Please help, i need Hardware Acceleration otherwise my Notebook get to hot and noisy :(

janek-git avatar Oct 19 '20 22:10 janek-git

@janek-git look in this file /etc/chromium-browser/customizations/02-libva-i965 to enable iHD driver.

@saiarcot895 i only use iHD driver but get the same error as other here.

Details here

Still can't stay full linux just because of that :') then bye windows !

Thanks for the work anyway !

xontik avatar Oct 21 '20 07:10 xontik

@xontik Thanks for the Answer :) sadly i still get the same error, like when i just renamed iHD_drv_video.so to i965_drv_video.so

janek-git avatar Oct 21 '20 11:10 janek-git

@janek-git it's normal, but at least with my solution you don't mess your system driver :)

xontik avatar Oct 21 '20 11:10 xontik

As a small update here, on 87.0.4280.11 on Ubuntu 20.04, hardware video decoding appears to be working on both AMD GPU (integrated GPU on Ryzen 3400G) and Intel GPU.

On Intel GPU, playback is smooth up to 1440p.

Additionally, the --use-gl=desktop flag might not be needed; last I checked, the default is to use egl, and there is some code committed to support hardware video decoding via egl.

@saiarcot895 thanks for digging. My problem was that, as pointed by @JurgenWolf at https://github.com/saiarcot895/chromium-ubuntu-build/issues/91#issuecomment-711444856 ,

Hardware-accelerated video decode flag is set to Disabled by default in 87.

After passing flag --enable-accelerated-video-decode (if you prefer, you can also go to chrome://flags and set Hardware-accelerated video decode to Enabled), I confirm that hardware acceleration works for me in 87.0.4280.20-0ubuntu1~ppa1~20.04.1_amd64 on my Intel GPU with H264, VP8, VP9 videos.

I'm editing the description to make that clear to new passersbys, and apparently Arch Wiki / Chromium / Hardware video acceleration (which is the reference documentation even on an Ubuntu machine) was already edited to mention this.

With that, closing. To people still unable to get their accel working in 87, please create a new issue, to reduce confusion and isolate your case. Thanks everyone!

ronjouch avatar Oct 21 '20 13:10 ronjouch

https://www.linuxuprising.com/2018/08/how-to-enable-hardware-accelerated.html

After 1 month of trying finally Hardware Accelerating is working on both Nvidia and Intel. For other people and my future reference I will write up the steps.

OS: POP_OS! 20.04 Chrome version: Version 87.0.4280.20 (Developer Build) Built on Ubuntu 20.04, running on Pop 20.04 (64-bit) Follow all the steps in the post. And below 1. sudo apt install vainfo sudo apt install vdpauinfo

run : vainfo and vdpauinfo

if you are intel you should see output not -1 error. But if you see error. Install the vaapi driver listed above. or search apt search vaapi

and set this in environment variable

sudo nano /etc/environment add this two line

LIBVA_DRIVER_NAME=i965 VDPAU_DRIVER=va_gl

here i965 is my driver name. for intel core i5 haswell architecture. logout or restart and try again. you should see Mojovideodecode

if you are in NVIDIA: Download vdpau driver from above. You should download the deb file and install it. It's from ubuntu 18 but works in Ubuntu 20. set environment variable

$ sudo nano /etc/environment

add this two line

LIBVA_DRIVER_NAME=vdpau VDPAU_DRIVER=nvidia

check out if there's any output in

$ vainfo $ vdpauinfo

you should see output. saying it's NVIDIA. finally run chromium

$ LIBVA_DRIVER_NAME=vdpau chromium-browser --use-gl=desktop

These are the flags I use in chromium $ nano ~/.config/chromium-flags.conf

--ignore-gpu-blacklist --enable-gpu-rasterization --enable-zero-copy --force-dark-mode --enable-features=WebUIDarkMode --enable-oop-rasterization --use-gl=desktop

but in developer version .conf doesn't work. so turn of flags manually from chrome://flags

tazihad avatar Oct 21 '20 23:10 tazihad

https://www.linuxuprising.com/2018/08/how-to-enable-hardware-accelerated.html

After 1 month of trying finally Hardware Accelerating is working on both Nvidia and Intel. For other people and my future reference I will write up the steps.

This does not work for Nvidia.

[61251:61251:1022/090537.048824:WARNING:gpu_video_decode_accelerator_factory.cc(223)] : Initializing VAAPI VDA.
[61251:62446:1022/090537.103452:ERROR:vaapi_utils.cc(47)] : vaMapBuffer failed: invalid VABufferID
[61251:62446:1022/090537.103474:ERROR:vaapi_video_decode_accelerator.cc(528)] : Error decoding stream

sebibasti0815 avatar Oct 22 '20 07:10 sebibasti0815

https://www.linuxuprising.com/2018/08/how-to-enable-hardware-accelerated.html After 1 month of trying finally Hardware Accelerating is working on both Nvidia and Intel. For other people and my future reference I will write up the steps.

This does not work for Nvidia.

[61251:61251:1022/090537.048824:WARNING:gpu_video_decode_accelerator_factory.cc(223)] : Initializing VAAPI VDA.
[61251:62446:1022/090537.103452:ERROR:vaapi_utils.cc(47)] : vaMapBuffer failed: invalid VABufferID
[61251:62446:1022/090537.103474:ERROR:vaapi_video_decode_accelerator.cc(528)] : Error decoding stream

It works. Follow the extras steps I wrote

tazihad avatar Oct 22 '20 07:10 tazihad

Of course I did - it did not work, as I wrote.

FYI the switch --ignore-gpu-blacklist is deprecated, in the future you have to use --ignore-gpu-blocklist.

sebibasti0815 avatar Oct 22 '20 08:10 sebibasti0815

linuxuprising.com/2018/08/how-to-enable-hardware-accelerated.html After 1 month of trying finally Hardware Accelerating is working on both Nvidia and Intel. For other people and my future reference I will write up the steps.

This does not work for Nvidia.

```

[61251:61251:1022/090537.048824:WARNING:gpu_video_decode_accelerator_factory.cc(223)] : Initializing VAAPI VDA. [61251:62446:1022/090537.103452:ERROR:vaapi_utils.cc(47)] : vaMapBuffer failed: invalid VABufferID [61251:62446:1022/090537.103474:ERROR:vaapi_video_decode_accelerator.cc(528)] : Error decoding stream

It works. Follow the extras steps I wrote

I'm in POP_OS! 20.04 too. How do I make chromium use --use-gl=desktop flag only when I'm booted on the nvidia driver? So that it'll run without that flag when I'm on the intel driver, because hardware acceleration on intel fails if that flag is enabled

naveenjohnsonv avatar Oct 23 '20 09:10 naveenjohnsonv

@saiarcot895 confirming that Intel VAAPI accel works great in 88.0.4315.5-0ubuntu1~ppa1~20.04.1_amd64 under Ubuntu 20.10. Apparently, 20.10 packages failed to build in the PPA, but the 20.04 debs installed successfully and work great.

ronjouch avatar Nov 10 '20 14:11 ronjouch

The LIBVA_DRIVER_NAME=vdpau chromium-browser --ignore-gpu-blocklist --use-gl=desktop --enable-oop-rasterization didn't work for me either , ubuntu 20.04 , Version 88.0.4315.5 , nVidia RTX 2070 proprietary drivers, same VDA error 4

Failed to create dedicated X11 display! [361880:362425:1113/160907.513378:ERROR:vaapi_utils.cc(47)] vaMapBuffer failed: invalid VABufferID [361880:362425:1113/160907.513440:ERROR:vaapi_video_decode_accelerator.cc(528)] Error decoding stream [361880:361880:1113/160907.645793:WARNING:gpu_video_decode_accelerator_factory.cc(223)] Initializing VAAPI VDA.

cAstraea avatar Nov 13 '20 14:11 cAstraea

@cAstraea did you (or anyone else?) ever get this working? It is failing for me for the same error (google led me here). On Version 87.0.4280.66 of Chromium Beta.

michaelbutler avatar Dec 22 '20 05:12 michaelbutler