You are not logged in.

#626 2022-01-21 07:42:54

seth
Member
Registered: 2012-09-03
Posts: 58,734

Re: chromium: hardware video acceleration with VA-API

If your hardware provides VP9/AV1 acceleration?

Online

#627 2022-01-21 07:59:54

babam
Member
Registered: 2022-01-21
Posts: 4

Re: chromium: hardware video acceleration with VA-API

seth wrote:

If your hardware provides VP9/AV1 acceleration?

Of course, on Windows 10 Chrome without extension (NotYetAV1 or enhanced-h264ify) can use HW acceleration on all Youtube videos.

Last edited by babam (2022-01-29 14:35:01)

Offline

#628 2022-01-21 08:00:52

seth
Member
Registered: 2012-09-03
Posts: 58,734

Re: chromium: hardware video acceleration with VA-API

Let's see…

vainfo

Online

#629 2022-01-29 13:54:36

babam
Member
Registered: 2022-01-21
Posts: 4

Re: chromium: hardware video acceleration with VA-API

seth wrote:

Let's see…

vainfo
vainfo: VA-API version: 1.13 (libva 2.13.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.3.5 ()
vainfo: Supported profile and entrypoints
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileNone                   :	VAEntrypointStats
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointFEI
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointFEI
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointFEI
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointFEI
      VAProfileHEVCMain               :	VAEntrypointEncSliceLP
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointEncSliceLP
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointEncSliceLP
      VAProfileVP9Profile1            :	VAEntrypointVLD
      VAProfileVP9Profile1            :	VAEntrypointEncSliceLP
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointEncSliceLP
      VAProfileVP9Profile3            :	VAEntrypointVLD
      VAProfileVP9Profile3            :	VAEntrypointEncSliceLP
      VAProfileHEVCMain12             :	VAEntrypointVLD
      VAProfileHEVCMain12             :	VAEntrypointEncSlice
      VAProfileHEVCMain422_10         :	VAEntrypointVLD
      VAProfileHEVCMain422_10         :	VAEntrypointEncSlice
      VAProfileHEVCMain422_12         :	VAEntrypointVLD
      VAProfileHEVCMain422_12         :	VAEntrypointEncSlice
      VAProfileHEVCMain444            :	VAEntrypointVLD
      VAProfileHEVCMain444            :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10         :	VAEntrypointVLD
      VAProfileHEVCMain444_10         :	VAEntrypointEncSliceLP
      VAProfileHEVCMain444_12         :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointVLD
      VAProfileHEVCSccMain            :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain10          :	VAEntrypointVLD
      VAProfileHEVCSccMain10          :	VAEntrypointEncSliceLP
      VAProfileHEVCSccMain444         :	VAEntrypointVLD
      VAProfileHEVCSccMain444         :	VAEntrypointEncSliceLP
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointVLD
      VAProfileHEVCSccMain444_10      :	VAEntrypointEncSliceLP

Offline

#630 2022-01-29 14:03:38

seth
Member
Registered: 2012-09-03
Posts: 58,734

Re: chromium: hardware video acceleration with VA-API

Well, yeah - then it can.
If you think it doesn't you should explain that and why (you think it doesn't do that) and check "about:gpu" about whether chromium is using HW acceleration at all.

Online

#631 2022-02-02 21:38:40

LinX
Member
Registered: 2012-11-20
Posts: 10

Re: chromium: hardware video acceleration with VA-API

Inixi wrote:
  • My monitor has 120Hz refresh rate and using --use-gl=desktop makes possible to use only 60fps. When I don't use this option then all my accelerated videos are black.

I made AUR package to fix this issue. In PKBUILD under prepare() there is option to set custom fps. The default is 165, but you can change it to 120.
https://aur.archlinux.org/packages/chro … merate-fix

Offline

#632 2022-02-03 09:44:25

Inixi
Member
Registered: 2016-10-15
Posts: 54

Re: chromium: hardware video acceleration with VA-API

Hello again,
In my recent posts I wrote about stability of Chromium, because in my case hardware acceleration is working as expected.
I use NVIDIA Corporation TU106M [GeForce RTX 2060 Max-Q] (rev a1) with X11, so I have hardware encoding working from h264 up to VP9 and without AV1.
Flags enabled:

--enable-features=VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization
--enable-zero-copy
--use-gl=desktop
--ignore-gpu-blocklist
--enable-oop-rasterization
--enable-raw-draw
--enable-gpu-rasterization
--use-vulkan
--disable-gpu-sandbox
--disable-reading-from-canvas
--disable-sync-preferences

I have following packages installed:

linux-xanmod-rog 5.16.4.prexan0-1
libva-vdpau-driver-vp9-git r57.509d3b2-4
nvidia-dkms 495.46-2
chromium 97.0.4692.99-2

The effect from chrome:///gpu is

Canvas: Hardware accelerated
Canvas out-of-process rasterization: Enabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
Out-of-process Rasterization: Hardware accelerated
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Raw Draw: Disabled
Skia Renderer: Enabled
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
Vulkan: Enabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated

My final summary is:
1. Using --ignore-gpu-blocklist makes Chromium (IMO) more stable than without using this flag. Also more caveats with this flag:
  a. On youtube, the field of controls (the component that is on the bottom of the video frame) is unexpectedly enlarged, sometimes it is annoying, sometimes I don't care, just check it out: https://ibb.co/zrmyYkW .
  b. I have 120Hz screen refresh set on my monitor, so when I go to testufo.com it shows 120fps even though page says browser does not support vsync (without --ignore-gpu-blocklist is 60fps).
  c. When I put my system to deep sleep with Chromium running then all the flags don't work and most of values in chrome://gpu are yellow and red, also video hardware acceleration does not work. I don't have the screenshot of it, but when I reproduce the issue then I will post the screenshot.
2. Still, videos when paused turn black after a while. I think this the fault of VaAPI itself but I cannot confirm this.
3. I tried using other packages than libva-vdpau-driver-vp9-git but hardware acceleration of VP9 videos does not work with any other package.
4. Last time I posted I have also mentioned that I disabled SkiaRenderer, this time I didn't disable it and seems like massive logs with SkiaRenderer compilation errors are not showing anymore. Probably it has to do with revision update of the package, but I cannot confirm that SkiaRenderer is now compatible with VaapiVideoEncoder feature.

Last edited by Inixi (2022-02-03 16:31:11)


2020 ASUS Zephyrus G14

Offline

#633 2022-02-08 08:43:29

manjian
Member
Registered: 2022-02-08
Posts: 3

Re: chromium: hardware video acceleration with VA-API

Now, for chrome version:7f0488e8ba0d8e019187c6325a16c29d9b7f4989-refs/branch-heads/4758@{#972} 98.0.4758.80. Everything is not working anymore. I try to debug it a bit. And find serveral prerequisites are added.
1. The graphics context need to be vulkan. Meaning the use-vulkan flag must be there.
2.  the vulkan driver must be above 21.1.5
My vulkan driver is just 21.0.3. So the vaapi is disabled.
The source is:
media/mojo/services/gpu_mojo_media_client_cros.cc
VideoDecoderType GetPlatformDecoderImplementationType(
    gpu::GpuDriverBugWorkarounds gpu_workarounds,
    gpu::GpuPreferences gpu_preferences,
    const gpu::GPUInfo& gpu_info) {
#if defined(OS_CHROMEOS)
  if (gpu_preferences.enable_chromeos_direct_video_decoder)
    return VideoDecoderType::kVaapi;
  return VideoDecoderType::kVda;
#elif BUILDFLAG(ENABLE_VULKAN)
  if (!base::FeatureList::IsEnabled(kVaapiVideoDecodeLinux))
    return VideoDecoderType::kUnknown;
  if (!base::FeatureList::IsEnabled(kUseChromeOSDirectVideoDecoder)) {
    return gpu_preferences.gr_context_type == gpu::GrContextType::kGL
               ? VideoDecoderType::kVda
               : VideoDecoderType::kUnknown;
  }
=>  if (gpu_preferences.gr_context_type != gpu::GrContextType::kVulkan)
    return VideoDecoderType::kUnknown;
  for (const auto& device : gpu_info.vulkan_info->physical_devices) {
=>   if (device.properties.driverVersion < VK_MAKE_VERSION(21, 1, 5))
      return VideoDecoderType::kUnknown;
  }
  return VideoDecoderType::kVaapi;
#else
  NOTREACHED();
  return VideoDecoderType::kUnknown;
#endif
}

Offline

#634 2022-02-09 08:02:11

LinX
Member
Registered: 2012-11-20
Posts: 10

Re: chromium: hardware video acceleration with VA-API

For chromium 98 you can use this flag to get back vaapi: --disable-features=UseChromeOSDirectVideoDecoder

Offline

#635 2022-02-09 22:26:15

wowbagger
Member
From: Italy
Registered: 2022-02-09
Posts: 1

Re: chromium: hardware video acceleration with VA-API

LinX wrote:

For chromium 98 you can use this flag to get back vaapi: --disable-features=UseChromeOSDirectVideoDecoder

This definitely works for me. Thanks man!

Offline

#636 2022-02-10 09:08:04

manjian
Member
Registered: 2022-02-08
Posts: 3

Re: chromium: hardware video acceleration with VA-API

wowbagger wrote:
LinX wrote:

For chromium 98 you can use this flag to get back vaapi: --disable-features=UseChromeOSDirectVideoDecoder

This definitely works for me. Thanks man!

It does not work for me. Im using Ubuntu 20.04. I need to wait for 22.04 then I can get it back.

Offline

#637 2022-02-10 14:08:45

Alataw
Member
Registered: 2021-01-27
Posts: 20

Re: chromium: hardware video acceleration with VA-API

LinX wrote:

For chromium 98 you can use this flag to get back vaapi: --disable-features=UseChromeOSDirectVideoDecoder

Thanks, man!

Offline

#638 2022-02-11 07:09:24

vdwijngaert
Member
Registered: 2022-01-18
Posts: 3

Re: chromium: hardware video acceleration with VA-API

LinX wrote:

For chromium 98 you can use this flag to get back vaapi: --disable-features=UseChromeOSDirectVideoDecoder

Awesome, you're a real lifesaver, LinX. Thanks a ton! For me, this works on Chrom(e|ium) 99 as well!

This is what I have in my chrome-flags.conf (and chrome-beta-flags.conf):

--use-vulkan
--use-gl=desktop
--enable-zero-copy
--enable-hardware-overlays
--enable-features=VaapiVideoDecoder,CanvasOopRasterization
--disable-features=UseSkiaRenderer,UseChromeOSDirectVideoDecoder
--ignore-gpu-blocklist

As usual, your mileage may vary.

Offline

#639 2022-02-11 14:35:41

buttcake
Member
Registered: 2016-10-16
Posts: 37

Re: chromium: hardware video acceleration with VA-API

Inixi wrote:

1. a. On youtube, the field of controls (the component that is on the bottom of the video frame) is unexpectedly enlarged, sometimes it is annoying, sometimes I don't care, just check it out: https://ibb.co/zrmyYkW .

This is caused by  --disable-reading-from-canvas

Offline

#640 2022-02-14 00:54:52

manjian
Member
Registered: 2022-02-08
Posts: 3

Re: chromium: hardware video acceleration with VA-API

LinX wrote:

For chromium 98 you can use this flag to get back vaapi: --disable-features=UseChromeOSDirectVideoDecoder

Sorry. I remove the flags --use-vulkan, and test it again. It works.
Then I re-exam the code, so I do read the code too careless. It is there:
  if (!base::FeatureList::IsEnabled(kVaapiVideoDecodeLinux))
    return VideoDecoderType::kUnknown;
=>  if (!base::FeatureList::IsEnabled(kUseChromeOSDirectVideoDecoder)) {
    return gpu_preferences.gr_context_type == gpu::GrContextType::kGL
               ? VideoDecoderType::kVda
               : VideoDecoderType::kUnknown;
  }

Offline

#641 2022-02-16 00:15:19

ArchM
Member
Registered: 2018-02-09
Posts: 24

Re: chromium: hardware video acceleration with VA-API

Anyone experience intermittent or flashing black rectangles, particularly in the extensions, bookmark bar, etc. part of the browser UI? Also freezing with large numbers of tabs.

I had the following setup:
gtx 1060
google-chrome-stable 98.0.4758.102
libva-vdpau-driver-vp9-git r57.509d3b2-4
nvidia 510.54-1

flags:
--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-zero-copy
--enable-features=VaapiVideoDecoder
--use-gl=desktop
--disable-gpu-driver-bug-workarounds

Last edited by ArchM (2022-02-16 00:15:47)

Offline

#642 2022-02-16 06:32:31

LinX
Member
Registered: 2012-11-20
Posts: 10

Re: chromium: hardware video acceleration with VA-API

ArchM wrote:

Anyone experience intermittent or flashing black rectangles, particularly in the extensions, bookmark bar, etc. part of the browser UI? Also freezing with large numbers of tabs.

I had the following setup:
gtx 1060
google-chrome-stable 98.0.4758.102
libva-vdpau-driver-vp9-git r57.509d3b2-4
nvidia 510.54-1

flags:
--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-zero-copy
--enable-features=VaapiVideoDecoder
--use-gl=desktop
--disable-gpu-driver-bug-workarounds

Remove --disable-gpu-driver-bug-workarounds, you don't need it for vaapi. Add  --disable-features=UseChromeOSDirectVideoDecoder

Offline

#643 2022-02-16 15:39:35

DAC324
Member
Registered: 2020-03-12
Posts: 80

Re: chromium: hardware video acceleration with VA-API

LinX wrote:

Remove --disable-gpu-driver-bug-workarounds, you don't need it for vaapi. Add  --disable-features=UseChromeOSDirectVideoDecoder

Thank you all very much for that hint with UseChromeOSDirectVideoDecoder

This enables hardware accelerated video decoding (i.e., "VDAVideoDecoder" shown in chrome://media-internals) again, also in Chromium 99.x.

However, this does not appear to work together with Vulkan enabled:

manjian wrote:

I remove the flags --use-vulkan, and test it again. It works.

I can confirm that. Had Vulkan enabled in chrome://flags, and this apparently prevented VDAVideoDecoder from being loaded.

Here are my current flags:

--disable-software-rasterizer
--disable-gpu-driver-workarounds
--disable-gpu-vsync
--disable-features=UseChromeOSDirectVideoDecoder
--enable-accelerated-2d-canvas
--enable-accelerated-video-decode
--enable-accelerated-mjpeg-decode
--enable-drdc
--enable-features=ParallelDownloading,UnexpireFlagsM90,VaapiVideoEncoder,VaapiVideoDecoder,CanvasOopRasterization
--enable-gpu-compositing
--enable-native-gpu-memory-buffers
--enable-gpu-rasterization
--enable-oop-rasterization
--enable-raw-draw
--enable-zero-copy
--ignore-gpu-blocklist
--use-gl=desktop
--num-raster-threads=6

Last edited by DAC324 (2022-02-16 15:41:02)

Offline

#644 2022-02-17 04:05:39

ArchM
Member
Registered: 2018-02-09
Posts: 24

Re: chromium: hardware video acceleration with VA-API

LinX wrote:

Remove --disable-gpu-driver-bug-workarounds, you don't need it for vaapi. Add  --disable-features=UseChromeOSDirectVideoDecoder

Thank you. It's only been a few hours (also Chrome 96 -> 98). So far, seeing much fewer of the black rectangles, they did flicker briefly when scrolling on Twitter. No freezing thus far even with ~80 tabs when it used to occur with as little as 30-40.

Have seen (also less frequently) something awry with buffers(?). When cycling to a previously rendered video in a page, it'll appear with something previously rendered to my screen instead of the video, (eg. my terminal, picture, etc.). Is that a config issue or something that's expected?

Is there a resource for laymen like me covering which flags may be useful and what they do? I stumbled my way this far through the Arch wiki and random discussions, but it has mostly been a copy/paste experimental approach without proper understanding.

Offline

#645 2022-02-18 23:33:35

raisedintheusa
Member
Registered: 2022-02-18
Posts: 10

Re: chromium: hardware video acceleration with VA-API

Seems to not be working again with recent update to 98.0.4758.102

Offline

#646 2022-02-19 13:21:58

LinX
Member
Registered: 2012-11-20
Posts: 10

Re: chromium: hardware video acceleration with VA-API

raisedintheusa wrote:

Seems to not be working again with recent update to 98.0.4758.102

It's working. Check your flags. You need at least:

--use-gl=desktop
--enable-zero-copy
--enable-accelerated-video-decode
--enable-features=VaapiVideoDecoder
--disable-features=UseChromeOSDirectVideoDecoder

Offline

#647 2022-02-19 18:59:04

raisedintheusa
Member
Registered: 2022-02-18
Posts: 10

Re: chromium: hardware video acceleration with VA-API

You're right, still working, I cleaned up my flags a bit, might have been some interference.

Offline

#648 2022-02-25 13:25:09

mindbreaker
Member
Registered: 2006-01-23
Posts: 20

Re: chromium: hardware video acceleration with VA-API

LinX wrote:
raisedintheusa wrote:

Seems to not be working again with recent update to 98.0.4758.102

It's working. Check your flags. You need at least:

--use-gl=desktop
--enable-zero-copy
--enable-accelerated-video-decode
--enable-features=VaapiVideoDecoder
--disable-features=UseChromeOSDirectVideoDecoder

Thank you so much. After years without working hw acceleration it's working again for me. [i5-7200U laptop with intel-media-driver and chromium 98.0.4758.102]

I added --disable-remote-fonts to get rid of the typical ugly fonts. Everything has to be in clear verdana for me smile

Offline

#649 2022-04-07 17:26:51

brunkel
Member
Registered: 2022-04-07
Posts: 3

Re: chromium: hardware video acceleration with VA-API

Hi

I followed the wiki pages to get the hardware acceleration working in brave but can't seem to get it working.
brave://gpu shows that I have "Video Decode: Hardware accelerated" but when I take a look at the media dev tools the "video decode -> hardware decoder" still displays false.

The packages I installed:
- libva-vdpau-driver-vp9-git
- nvidia-utils

lspci -k | grep -A 2 -E "(VGA|3D)"

01:00.0 VGA compatible controller: NVIDIA Corporation GP107 [GeForce GTX 1050] (rev a1)
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 3354
        Kernel driver in use: nvidia
vainfo

vainfo: VA-API version: 1.13 (libva 2.14.0)
vainfo: Driver version: Splitted-Desktop Systems VDPAU backend for VA-API - 0.7.4
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG4Simple            : VAEntrypointVLD
      VAProfileMPEG4AdvancedSimple    : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
tail -n2 ~/.zprofile

export LIBVA_DRIVER_NAME="vdpau"
export VDPAU_DRIVER="nvidia"
cat ~/.config/brave-flags.conf

--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-zero-copy

--enable-features=VaapiVideoDecoder
--use-gl=egl
--disable-features=UseChromeOSDirectVideoDecoder

--force-dark-mode

This is the output I'm getting with the --use-gl=egl flag when I tried --use-gl=desktop the libva error is gone but then brave crashes when playing videos.

brave

libva error: /usr/lib/dri/vdpau_drv_video.so init failed
[78197:78197:0100/000000.256393:ERROR:gpu_init.cc(446)] Passthrough is not supported, GL is egl, ANGLE is

Last edited by brunkel (2022-04-07 17:46:19)

Offline

#650 2022-04-08 18:26:42

DAC324
Member
Registered: 2020-03-12
Posts: 80

Re: chromium: hardware video acceleration with VA-API

There is an interesting aspect about Youtube I just found out on Reddit (https://www.reddit.com/r/chrome/comment … &context=3).

YouTube is now using AV1 as a default, instead of VP9 formerly used. As the guy on Reddit has encountered, hardware acceleration for AV1 only works on the very latest graphics hardware. If your graphics card is older than a few weeks, AV1 hardware acceleration will not work in Chromium.

Only thing you can do about that is: Go to Youtube's settings, Playback and Performance, and select "prefer AV1 for SD". This enables VP9 again for all content better than 480p, and VP9 is hardware accelerated in Chromium even on ancient cards like my GeForce GTX 750 Ti.

Last edited by DAC324 (2022-04-08 18:27:34)

Offline

Board footer

Powered by FluxBB