[HowTo] Enable Hardware Video Acceleration / Video Decode In Google Chrome, Brave, Vivaldi And Opera Browsers


:information_source: UPDATE This guide is severely out of date as Google has changed a lot since I last updated it.

However, one might test only these flags:

--enable-features=VaapiVideoEncoder,VaapiVideoDecodeLinuxGL
--enable-gpu

Difficulty: ★★☆☆☆

Requirements:

  • Google Chrome >=88
  • Brave >= 1.19
  • Vivaldi >=3.6
  • Opera >=74

For Chromium and Firefox, see their corresponding Arch Wiki articles:

:information_source: Note: This doesn’t work on Wayland. You can use VA-API on XWayland, using the --use-gl=egl command line flag (untested).

1. Enable the following web browser flags:

:warning: Warning: Disabling the rendering blacklist may cause unstable behavior, including crashes of the host. See the bug reports in chrome://gpu for details.

Additionally the flag --disable-gpu-driver-bug-workarounds may need to be passed to prevent GPU workaround from being used. Flags in chrome://gpu should state “Hardware accelerated” when configured and available.

  • For Google Chrome:

    • Create ~/.config/chrome-flags.conf and populate it with the following:

      --ignore-gpu-blocklist
      --enable-gpu-rasterization
      --enable-zero-copy
      --enable-features=VaapiVideoDecoder
      --disable-features=UseChromeOSDirectVideoDecoder
      

      X11:

      --use-gl=desktop
      

      XWayland:

      --use-gl=egl
      --ozone-platform-hint=auto
      
    • Skip to Step 2

  • For Vivaldi:

    • The Vivaldi community package is configured to read flags from ~/.config/vivaldi-stable.conf. See Google Chrome above.
  • For Opera:

    • The Opera community package is configured to read flags from /etc/opera/default:

      OPERA_FLAGS="
      --enable-a-flag
      --enable-another-flag
      "
      

  • For Brave and possibly others:
    Since other browsers are not configured to use a user config file like Chrome, you’ll need to enable the flags in chrome://flags:

    • Override software rendering list: chrome://flags/#ignore-gpu-blocklist
    • Use GPU to rasterize web content: chrome://flags/#enable-gpu-rasterization
    • Raster threads write directly to GPU memory associated with tiles: chrome://flags/#enable-zero-copy

    You’ll also need to launch the web browser using the following flags:

    E.g. to launch Brave on X11 using this flag:

    brave --use-gl=desktop --enable-features=VaapiVideoDecoder --disable-features=UseChromeOSDirectVideoDecoder
    

    On XWayland:

    brave --use-gl=egl --ozone-platform-hint=auto --enable-features=VaapiVideoDecoder --disable-features=UseChromeOSDirectVideoDecoder
    

    And so on.

  • To make this change permanent, copy the browser .desktop file from /usr/share/applications/ to ~/.local/share/applications/
    (if this folder doesn’t exist, create it).
    By copying the file here, we’re making sure it won’t be overwritten by an update.
  • Then, open the .desktop file (e.g. brave-browser.desktop, etc.) from this ~/.local/share/applications/ location,with a text editor.
    In this file, search for the lines starting with Exec=, and change the executable to include the flags above.
    E.g. for Vivaldi: Exec=/usr/bin/brave --enable-flag %U

2. Install the VA-API driver to be able to decode media:

3. Check if hardware-accelerated video decoding is enabled and working:


Sources:

  • :brain: + :coffee:
29 Likes

A post was split to a new topic: Problem with chromium browsers and “–use-gl=desktop” flag

So simple and effective. Thanks!
Just a thing… Testing this I’ve noticed that YouTube is slowly moving to AV1 instead of VP8/9 video format and forcing us to use it by default. For most of us this is a problem, because AV1 is still being decoded by software on pre-2020 hardware. You can test it with this video and check if chrome://media-internals shows Dav1dVideoDecoder for kVideoDecoderName. If it is your case, you can install NotYetAV1 extension to avoid this issue, since the flag #enable-av1-decoder has been removed from Chrome.
Once done, you can restart your browser, watch the same video and check chrome://media-internals again. MojoVideoDecoder should be working and also "codec":"vp9" or "codec":"vp8" will be shown as kVideoTracks info.
As the extension developer says, this is just for YouTube and a few more sites (?). If anyone could provide a workaround for getting AV1 widely-disabled, it will be welcomed :grinning:.

PS: It also allows video resolutions lower than 720p to be played with VP8/9 codec, so being hardware decoded as well.

2 Likes

I use enhanced-h264ify and block VP8, VP9 & AV1. I just tried NotYetAV1, but it that makes YouTube use VP9 with the VpxVideoDecoder.

Could be hardware related? For me, VP9 is being decoded by MojoVideoDecoder. I’ve also tried enhanced-h264ify, but blocking VP8 and VP9 makes me have no 4K resolution option on some videos.

Yep. My NVIDIA GPU on my primary laptop only supports VP9 hardware decoding via VDPAU.

On my other laptop with an AMD APU, it supports it via VA-API so I only block VP8 & AV1.

1 Like

As of chromium 90 and derivatives, its not mojo anymore, its VideoDecodeAccelerator.

Verified on windows and manjaro

3 Likes

Someone has already created chromium bugreport:
id=1201686 (can’t post the link, unfortunately)

Developers moved the bugreport to won’t fix. So seems like this is it.

How can I downgrade to 89 if I don’t have it in local cache and sudo DOWNGRADE_FROM_ALA=1 downgrade google-chrome returns Unable to downgrade google-chrome ?

pamac remove google-chrome
pamac install firefox

:grin:

6 Likes

…and VDAVideoDecoder on Chrome 91?’’ :roll_eyes:

seems to be d3d11videodecoder on windows now, I’ll check my personal box when I get home

IDK why they change it every release

I’m on brave, which latest is 90, shows

Decoder : VideoDecodeAccelerator
Hardware Decoder: True

Put chrome 91 on to test
Chrome has hard disabled the ability to turn on video decode in chrome://flags
Removed Chrome 91

I’ve updated the guide. With Chromium 91, it’s now --enable-features=VaapiVideoDecoder instead of --enable-accelerated-video-decode.

2 Likes

This is also broken on brave 91

vainfo and vdpauinfo both working, was working before update with brave 90

Cant get to work with --enable-features=VaapiVideoDecoder or --enable-accelerated-video-decode. It’s been broken on every chromium 91 based browser I’ve touched on linux, and they all seem to be missing the flags that were previously there for it from browser://flags.

This seems to be something broken or removed upstream

This is a tutorial, not a support thread. Please create your own thread in #support instead of cross-posting on the Arch forums and here.

1 Like

@Yochanan, so post chrome 88 i had my vid acceleration working with --enable-features=VaapiVideoDecoder switch and everything was working fine. However inbetween chrome 90-92, video acceleration has cease to function again.

after advise from a forum user to uninstall and reinstall with fresh config to fix the issue, i found vid. accel. works only the first time you invoke chrome after clearing the config. every subsequent invocation results in vid. accel. being disabled. then after comparing GPU settings in chrome:///gpu page, i found that ozone platform is loaded only successive chrome invokes. disabling ozone (via flag), gets video acceleration back.

ozone could be disabled by CLI switch --disable-features=UseOzonePlatform or flag #use-ozone-platform.

i’m on X11 with intel i915/965 driver with VAAPI enabled. and still cant makeout whether ozone is meant to help X11 or xwayland users. with G deciding that ozone to be enabled by default, there can be a performance penalty if it is disabled. however it seems it is the only way to get hw v. acceleration back.

2 Likes

Yep, just discovered that earlier and tested it. I updated the guide.

1 Like

A post was split to a new topic: Rendering issues in Google sheets with hardware video acceleration

For those trying to use Electron apps such as Discord, Signal or TutaNota on Wayland but get blank window contents, the Chromium launch option --use-gl=desktop fixes that for me! Make sure to also set up the proper Wayland config as described on the ArchWiki too. (You can indeed put --use-gl=desktop in that file if you want to apply it universally.)

Kind soul by the name of JonnyBoss taught me that over on the GamingOnLinux forum. Was gonna make a thread about it, but this one seems similar enough to only warrant this reply.

1 Like

@Yochanan looks like chrome 95 is the final nail in the coffin for video acceleration on X11/VAAPI users. ozone-platform cannot be disabled anymore, and and video acceleration with it .