Chromium GPU support on Manjaro
#1
Hi everyone!                                                                                             
                                                                                                         
I've tried to enable GPU support and hardware video decoding in Chromium on Manjaro using the flags found in the Wiki. While they indeed make chrome://gpu show "Hardware accelerated" for most of the grahics sub-systems, they actually cause Chromium to run slower and more sluggish than without. And hardware-based video decoding still doesn't work, chrome://media-internals shows it's using a software decoder nonetheless.

I was almost ready to accept that having GPU suport in Chromium on Linux is just not really supported, even more so on ARM. Then I tried one of the ChromiumOS images (ayufan's R77) and much to my suprise, GPU support and hardware acceleration worked just fine! GL support, VP8/9 and MP4 hardware decoding - it just worked and Chromium also felt faster all around. From chrome://gpu :                                       
                                                                                                         
Manjaro:
GPU0  VENDOR= 0x0000 [VMware, Inc.], DEVICE=0x0000 [llvmpipe (LLVM 9.0.1, 128 bits)] *ACTIVE*

ChromiumOS:
GPU0  VENDOR = 0x0000 [ARM], DEVICE= 0x0000 [Mali-T860] *ACTIVE*                                         

Can somebody shed some light on why GPU support works fine in ChromiumOS but not in Manjaro? Which (kernel?) patches, drivers, config, flags do make the difference here?
                                                                                                         
(Note that apart from Chromium, hw decoding works just fine for me in Manjaro using mpv for example.)    

Thanks,                                                                                                  
krist
#2
I think you have to install the Mesa-git package when using Manjaro with Panfrost drivers. Not using Chromium, but it also improved rendering in Firefox a lot (switched from Basic to OpenGL renderer). Mesa-git has a version >= 20.1, which has some huge improvements to OpenGL support for the Pinebook Pro (stable Mesa is on 20.0.xyz).
#3
(04-19-2020, 08:46 AM)appelgriebsch Wrote: I think you have to install the Mesa-git package when using Manjaro with Panfrost drivers. Not using Chromium, but it also improved rendering in Firefox a lot (switched from Basic to OpenGL renderer). Mesa-git has a version >= 20.1, which has some huge improvements to OpenGL support for the Pinebook Pro (stable Mesa is on 20.0.xyz).

Thanks for your reply. I tried mesa-git, but unfortunately it didn't change anything.

From the bits and pieces I've gathered so far, it looks like the OS images that have working GPU support and hardware video rendering in Chromium (I tried ChromiumOS R77 and Bionic Mate so far, both by ayufan) are using the older Rockchip-supplied drivers with the binary blobs, not the Panfrost one Manjaro uses. Probably Panfrost doesn't support Chromium yet?
#4
It's a wild combination of many things, from what I know about it (I might be wrong!):

Mesa / OpenGL / Panfrost (GPU) is different from hardware video decoding (VPU).

Non-blob VPU hardware decoding is still being implemented in the kernel (hantro driver) and also needs libva-v4l2-request (the whole vaapi-/libva-/etc.-concept is a somewhat messy one). Work is being done on this, experimental patches are at https://forum.pine64.org/showthread.php?tid=9171.
To add to this, not all codecs are yet supported (vp8/vp9(?) is still unsupported, iirc).

And then chromium probably actually needs to be built with va-api support; for reasons the ChromiumOS changes for this are not included in mainline Chromium.

(And if I recall correctly, there was also some ChromiumOS-specific libva-v4l2-request-thing that wasn't just easily portable or something along that line, but I can't find this right now, so take this with a few grains of salt).

There's https://aur.archlinux.org/packages/chromium-vaapi/ with at least the Chromium-patches included, but that's for x86_64 only. I've been building caidao (ungoogled-chromium) with the va-api patches for a while now for x86_64 and aarch64 (https://forum.pine64.org/showthread.php?tid=9452), but this, of course, isn't enough (yet) to get hardware video decoding without blobs on Manjaro, unfortunately, for the other reasons above.
#5
Thanks for all the info llsf! I just tried the latest Caidao (readily compiled package from your Gitlab's CI pipeline) and while it doesn't enable any hardware video decoding, it does enable GPU support via Panfrost (even w/out any Chromium flags). Nice! Is this because I'm still using mesa-git?

GPU0 VENDOR= 0x0000 [Panfrost], DEVICE=0x0000 [Mali T860 (Panfrost)] *ACTIVE*
#6
(04-19-2020, 06:39 AM)krist Wrote: Can somebody shed some light on why GPU support works fine in ChromiumOS but not in Manjaro? Which (kernel?) patches, drivers, config, flags do make the difference here?

Binaries called "chrome" or "chromium" are explicitly blacklisted by the panfrost driver.

(04-19-2020, 06:39 AM)krist Wrote: (Note that apart from Chromium, hw decoding works just fine for me in Manjaro using mpv for example.)   

I don't really believe that, especially the "just fine" part. I would really like to know which libraries you compiled and with which flags.
What does mpv say when you push Ctrl+h during a video?
#7
(04-20-2020, 06:40 AM)maxjrh Wrote: Binaries called "chrome" or "chromium" are explicitly blacklisted by the panfrost driver.

Is that the reason caidao works? 

(04-20-2020, 06:40 AM)maxjrh Wrote:
(04-19-2020, 06:39 AM)krist Wrote: (Note that apart from Chromium, hw decoding works just fine for me in Manjaro using mpv for example.)   

I don't really believe that, especially the "just fine" part. I would really like to know which libraries you compiled and with which flags.
What does mpv say when you push Ctrl+h during a video?

Of course you're right, I mixed up GPU/VPU. mpv does NOT use hw-accel. video decoding, but it does use the GPU Renderer via Panfrost:

[vo/gpu/opengl] EGL_VERSION=1.4
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/opengl] Choosing visual EGL config 0x5, visual ID 0x21
[vo/gpu/opengl] GL_VERSION='2.1 Mesa 20.1.0-devel (git-ff8daa0136)'
[vo/gpu/opengl] Detected desktop OpenGL 2.1.
[vo/gpu/opengl] GL_VENDOR='Panfrost'
[vo/gpu/opengl] GL_RENDERER='Mali T860 (Panfrost)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='1.20'

[cplayer] VO: [gpu] 1280x720 yuv420p
[cplayer] VO: Description: Shader-based GPU Renderer
#8
In response to a now removed question and for note keeping:

As I understand it, the GPU and VPU are both devices within the "Multi-Media Processor". Panfrost is the driver for the GPU, while the driver for the VPU is called Hantro. Both are found in the latest mainline Linux kernel. Hantro does just JPEG so far, but video decoding including VP8/9 and h264 is on the roadmap.

http://opensource.rock-chips.com/wiki_Fi...iagram.png
https://github.com/torvalds/linux/tree/m...dia/hantro
https://github.com/torvalds/linux/tree/m...m/panfrost
#9
panfrost will allow for gpu acceleration. accelerated media decoding will occur in hantro and rkvdec and is not ready for chromium or firefox, which would rely on vaapi. from what i see things should be coming together in kernel 5.8, so not much more patience required.

also, mpv CAN use hardware decoding if you are using v4l2-request.
#10
I tried booting up current Manjaro with the old rockchip kernel (from ayufan's Bionic images) to have proper hw acceleration for now (gpu/vpu). To my surprise it mostly worked out of the box. Wifi support needed some extra work as I had to figure out which firmware blobs to put where (the wifi drivers were obviously made for Android, the blobs need to reside at /system or /vendor) and turn off mac randomisation as this seems unsupported (NetworkManager has it turned on per default).

The kernel ran mostly fine (suspend works etc.) except for – you might have guessed it – gpu/vpu support. Chromium just doesn't pick up the gpu/vpu like it does using the Ubuntu Bionic or ChromiumOS images. What am I missing here?

Most of my Linux experience comes from running servers (and a bit of Android hacking some years ago), so when it comes to graphics I'm kinda lost Undecided

Any help appreciated!


Possibly Related Threads…
Thread Author Replies Views Last Post
  Manjaro update broke hardware video acceleration with mpv myself600 2 227 01-25-2023, 09:12 AM
Last Post: myself600
  Issue with booting Manjaro from encrypted NVMe drive on pbp Cs137 0 93 01-19-2023, 01:47 PM
Last Post: Cs137
  Manjaro ARM 20.04 spikerguy 68 78,575 01-08-2023, 07:22 PM
Last Post: vandys
  org.kde.plasma.core not installed (Manjaro) twirlip 0 106 01-06-2023, 09:47 AM
Last Post: twirlip
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 2 286 12-31-2022, 12:18 PM
Last Post: pine4546464
  Armbian is [edit: no longer] dropping support for Pinebook Pro TRS-80 4 2,565 12-23-2022, 12:01 AM
Last Post: TRS-80
  Armbian VPU decoding support coming soon LivingLinux 0 296 11-13-2022, 02:32 PM
Last Post: LivingLinux
  PineBook HOW TO REINSTALL ARCH-Manjaro. Ice-O-Star 0 425 10-22-2022, 10:46 AM
Last Post: Ice-O-Star
  newer ""emmc-installer" images (manjaro xfce) magistral 1 425 10-10-2022, 06:22 AM
Last Post: maxjrh
  Webcam not working in Manjaro with Cheese, but works in Armbian petaramesh 1 375 09-30-2022, 10:09 AM
Last Post: crazyquark

Forum Jump:


Users browsing this thread: 1 Guest(s)