Score:1

How should I enable hardware graphics acceleration in Chromium web-browser running on Ubuntu MATE 21.10 on RPi 4 (armhf)?

zw flag

I have just installed Ubuntu MATE 21.10 (32-bit, armhf) on my Raspberry Pi 4 with 4 Gb of RAM. Note: I need 32-bit version to have Modelica compiler available. All settings are default. Information about video driver is below:

$ lsmod | grep drm
drm_kms_helper        282624  3 vc4
cec                    65536  2 vc4,drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
drm                   540672  12 v3d,vc4,gpu_sched,drm_kms_helper

$ grep -E "^dtoverlay|^max_framebuffers|^gpu_mem|^hdmi" /boot/firmware/config.txt 
max_framebuffers=2
dtoverlay=vc4-fkms-v3d
gpu_mem=128

$ cat /proc/device-tree/soc/firmwarekms@7e600000/status
okay

$ cat /proc/device-tree/v3dbus/v3d@7ec04000/status
okay

$ glxinfo | grep -i opengl
OpenGL vendor string: Broadcom
OpenGL renderer string: V3D 4.2
OpenGL version string: 2.1 Mesa 21.2.2
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 21.2.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:

Then I installed Chromium browser as simple as sudo apt-get install chromium-browser, launched it for first time to enable the following options on chrome://flags:

  • Override software rendering list aka #ignore-gpu-blocklist;
  • GPU rasterization aka #enable-gpu-rasterization;
  • Zero-copy rasterizer aka #enable-zero-copy;
  • Enables Display Compositor to use a new gpu thread. aka #enable-drdc;
  • Out-of-process 2D canvas rasterization. aka #canvas-oop-rasterization.

then relaunched it using chromium --enable-features=VaapiVideoDecoder command.

Desite all these steps done, on chrome://gpu Chromium says that GPU acceleration is not enabled:

Graphics Feature Status

  • Canvas: Software only. Hardware acceleration disabled
  • Canvas out-of-process rasterization: Disabled
  • Compositing: Software only. Hardware acceleration disabled
  • Multiple Raster Threads: Disabled
  • Out-of-process Rasterization: Disabled
  • OpenGL: Disabled
  • Rasterization: Software only. Hardware acceleration disabled
  • Raw Draw: Disabled
  • Skia Renderer: Enabled
  • Video Decode: Software only. Hardware acceleration disabled
  • Vulkan: Disabled
  • WebGL: Disabled
  • WebGL2: Disabled

So the question is in the title.

Score:1
zw flag

The main problem here is that Chromium is shipped as Snap, so VA-API is not available as we are running on ARM.

So the first step is obvious - remove Snap version of Chromium by sudo snap remove chromium.

The second step is installation of Chromium as deb-package from RaspberryPi OS repository using below commands:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 82B129927FA3303E
sudo apt-add-repository "deb http://archive.raspberrypi.org/debian/ bullseye main"

cat <<EOF | sudo tee /etc/apt/preferences.d/pin-chromium
Package: *
Pin: release o=Raspberry Pi Foundation
Pin-Priority: -1

Package: chromium*
Pin: release o=Raspberry Pi Foundation
Pin-Priority: 1000
EOF

sudo apt-get update
sudo apt-get install chromium-browser

Then launch Chromium to configure it as usual - enable the following options on chrome://flags:

  • Override software rendering list aka #ignore-gpu-blocklist;
  • GPU rasterization aka #enable-gpu-rasterization;
  • Zero-copy rasterizer aka #enable-zero-copy;
  • Enables Display Compositor to use a new gpu thread. aka #enable-drdc;
  • Out-of-process 2D canvas rasterization. aka #canvas-oop-rasterization.

Relaunch it using chromium-browser --enable-features=VaapiVideoDecoder, visit chrome://gpu to ensure that you have all (excluding Vulkan) options enabled:

Graphics Feature Status

  • 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
  • Skia Renderer: Enabled
  • Video Decode: Hardware accelerated
  • Vulkan: Disabled
  • WebGL: Hardware accelerated
  • WebGL2: Hardware accelerated

To make --enable-features=VaapiVideoDecoder flag permanent one should edit the relevant config-file programmatically as shown below:

echo 'CHROMIUM_FLAGS="${CHROMIUM_FLAGS} --enable-features=VaapiVideoDecoder"' | sudo tee /etc/chromium.d/92-vaapi-hardware-decoding

As the result all web-players will play 1080p without lags and tearing.

Milor123 avatar
ng flag
Thank you very much for the guide, question bro, how can i stay sure that i am using "--enable-features=VaapiVideoDecoder", i am in windows using a other program that execute chromium, i've set this parameter but i am not sure if it was applied, what should i do for check it?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.