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
  Official Debian support moonwalkers 64 64,269 07-08-2024, 01:40 PM
Last Post: Humid Stylus
  Manjaro Sway Theme Broken Eighty8 1 796 03-08-2024, 08:41 AM
Last Post: tophneal
Question Manjaro with Full Disk Encryption and GRUB dumetrulo 1 2,316 02-02-2024, 02:45 AM
Last Post: frankkinney
  Manjaro network problem late 2023 acruhl 1 824 01-19-2024, 11:32 PM
Last Post: Kevin Kofler
  Help installing Manjaro on eMMC of Pinebook Pro pine4546464 4 3,220 12-13-2023, 07:22 PM
Last Post: trillobite
  Need Help Recovering Manjaro /boot Contents on Pinebook Pro calinb 6 3,511 12-11-2023, 03:47 AM
Last Post: calinb
  Manjaro 20.04 not loading from SD (with Manjaro on eMMC) zaius 1 881 12-07-2023, 03:11 PM
Last Post: wdt
  Manjaro ARM: enabling external monitors & fixing Broadcom WiFi after updating trifleneurotic 2 1,635 11-14-2023, 10:57 AM
Last Post: trifleneurotic
  Manjaro [ARM Stable Update] 2021-07-23 issues Bocanila 1 2,398 08-21-2023, 09:10 PM
Last Post: vanessadonald
  [Manjaro] u-boot won't boot from eMMC with (unbootable) SD card present zackw 1 2,491 08-21-2023, 09:08 PM
Last Post: vanessadonald

Forum Jump:


Users browsing this thread: 1 Guest(s)