7Ji-PKGBUILDs / .meta

1 stars 0 forks source link

chromium-mpp-v122.0.6261.128 NO VPU Hardware Acceleration #40

Closed JFLim1 closed 1 month ago

JFLim1 commented 3 months ago

Hi @7Ji,

Thank you for the new chromium-mpp-v122.0.6261.128. Somehow cannot get vpu hardware acceleration to work. On chromium-mpp-114.0.5735.198-4 vpu hardware acceleration works with panthor mesa-panfros-git or mesa-24.1.0.

Re-run

sudo systemctl enable --now libv4l-rkmpp-setup.service

Still the same, NO vpu hardware acceleration.

GPU driver Panthor: mesa-panfrost-git or mesa-24.1.1-1 both NO vpu hardware acceleration.

kwankiu commented 2 months ago

@7Ji, it seems like chromium-mpp v122 does NOT provides any hardware acceleration currently,

It seems like mpp video decode is not working with this chromium and according to chrome://gpu, WebGPU is unavailable meaning that there are no egl / no graphics acceleration as well.

This behaviour happens on BOTH panfork and panthor :

While some have got chromium-mpp v122 working (possibly with Ubuntu or non-arch system), it seems to be known that chromium after v114 frequently crashes randomly with panthor. As reported by serval users and amazingfate.

In that case, would it be a good idea to revert chromium-mpp back to v114?

@hbiyik FYI

7Ji commented 1 month ago

@kwankiu You could revert it as long as 114 works. But be warned it wouldn't be a simple revert. The 114 before bumping was already not buildable due to dependency changes and it would need yet more pacthing to be buildable.

JFLim1 commented 1 month ago

Hi @7Ji & @kwankiu, Currently testing chromium-mpp_v125 for Noble by @mazingfate (he found the commit that would crash chromium: https://github.com/chromium/chromium/commit/67d69c1b628b54c1442d8e494852d6403a21446a).

Chromium-mpp-v125 for Noble seems stable on Panfork and Panthor on limited testing so far. Vpu hardware acceleration is supported.

May I suggest building chromium-mpp_v125 to replace chromimu-mpp_v122.

7Ji commented 1 month ago

I'm planning to update this to 126 instead of reverting to 114 or 125, @JFLim1 @kwankiu your suggestion?

kwankiu commented 1 month ago

I'm planning to update this to 126 instead of reverting to 114 or 125, @JFLim1 @kwankiu your suggestion?

Yes, updating to v126 would be great (if HW Acceleration works).

JFLim1 commented 1 month ago

I'm planning to update this to 126 instead of reverting to 114 or 125, @JFLim1 @kwankiu your suggestion?

Based on what I heard from amazingfate, currently Rockchip had only release Chromium-mpp_v125:

Rockchip only provides mpp patches for v125 now. Be patient and wait for Jeffy's update: https://github.com/JeffyCN/meta-rockchip/tree/master/dynamic-layers/recipes-browser/chromium/

Not sure whether mpp patches had been released for chromium_v126.

chromium-mpp_v125 is working find on Ubuntu Noble with vpu hw acceleration (only with --ozone-platform=wayland) and there is no random crashes so far as I can tell.

7Ji commented 1 month ago

You could've checked the URL by yourself before pasting it, 126 was released 3 days ago.

JFLim1 commented 1 month ago

You could've checked the URL by yourself before pasting it, 126 was released 3 days ago.

Oops. Sorry about this.

7Ji commented 1 month ago

I have a partially working 126 locally, it still needs some more compile-time patching to avoid run-time patching (chromium decides to look up libv4l from /usr/lib64 in different .cc files for every update, which is not available in Arch FHS). But it should be pushed after those patching.

7Ji commented 1 month ago

Closed by https://github.com/7Ji-PKGBUILDs/chromium-mpp/commit/a6335364e24608ca751dd8903245257ed4e8f550

Also the command line arguments are different due to upstream chormium update: https://github.com/7Ji-PKGBUILDs/chromium-mpp/commit/c70458694b457ac42508bbdba0f4cea2fdee859f

JFLim1 commented 1 month ago

Hi @7Ji, Thanks for the chromium-mpp_v126. For clarification, does chromium-mpp_v126 works with Panthor, Gnome-Wayland and kernel-6.1.75-joshua-git? Tried it but no vpu hw acceleration.

Or it will only work with X11, Panfork and bsp-kernel-5.10?

7Ji commented 1 month ago

it will only work with X11, Panfork and bsp-kernel-5.10

kwankiu commented 1 month ago

it will only work with X11, Panfork and bsp-kernel-5.10

On Armbian and Joshua-Riek's Ubuntu, chromium-mpp could work with Wayland, Panfork/Panthor and BSP 6.1 just like how it did on Arch with the old chromium-mpp v114, is there any reason why doesnt it works on newer system/chromium-mpp? Could we implement the way Armbian/Joshua-Riek did? Or is there anything we could try / fixing?

7Ji commented 1 month ago

it will only work with X11, Panfork and bsp-kernel-5.10

On Armbian and Joshua-Riek's Ubuntu, chromium-mpp could work with Wayland, Panfork/Panthor and BSP 6.1 just like how it did on Arch with the old chromium-mpp v114, is there any reason why doesnt it works on newer system/chromium-mpp? Could we implement the way Armbian/Joshua-Riek did? Or is there anything we could try / fixing?

Wayland would work but it only works with Gnome, and I don't consider it fully working as it won't work on plasma or sway. x11 + panfork + bsp 5.10 always work, no matter which DE or WM.

Did mpp patched chromium ever work on panthor? Don't be fooled by chrome://gpu output only, it alone does not tell the actual decoding state, but only the queried result. Do actual debugging with echo 7 | sudo tee /sys/module/rk_vcodec/parameters/mpp_dev_debug and dmesg -w, if there's actual decoding happening then for each frame a new dmesg log should be written, and on panthor that shouldn't even work. libv4l-rkmpp was always intended to be used with mali blob drivers, and only panfork can be used alongside blob drivers.

Also please state the exact combination of kernel + driver + display protocol. 6.1 is out of the question because here the only actively maintained 6.1 bsp kernel has hbiyik's panthor patches as it's both the only 6.1 kernel being maintained and the only kernel hbiyik wanted to add panthor support to. If you want to split them up to one with panthor and one with in-kernel mali blob stub then you can do that as you like it.

JFLim1 commented 1 month ago

Hi @7Ji @kwankiu, Just a feedback. My experience with KDE Plasma Wayland is that it works well with Panthor and amazingfate's Chromium-rkmpp_v126 have vpu hw acceleration. KDE Plasma-Wayland is not stable with Panfork (frequent Plasmashell crashes)

Can confirm amazingfate's chromium-rkmpp-v126 have vpu hw acceleration on Panfork/Panthor

So far could not get chromium-mpp_v126 on Archlinux yet running on x11+mali_blob+Panfork+bsp-5.10 to have vpu hw acceleration, with this command:

LD_LIBRARY_PATH=/usr/lib/mali-valhall-g610/x11-gbm chromium --use-gl=angle --use-angle=gles-egl --use-cmd-decoder=passthrough

Install these pkgs: sudo pacman -Syu libmali-valhall-g610-{dummy,gbm,wayland-gbm,x11-gbm,x11-wayland-gbm}

Will try again later.

Edit: The bonus using Panthor is Firefox is stable and does not freeze or crash randomly as with Panfork.

Don't get me wrong, am not pitting Panfork vs Panthor.

JFLim1 commented 1 month ago

@7Ji

Did mpp patched chromium ever work on panthor?

Just a feedback. On Armbian-Jammy-KDE-Neon-6.1.75-vendor-rk35xx with Panthor (mesa-24.1.5 or earlier mesa-24.1.x or oibaf-mesa-24.2-devel) as far as I can tell amazingfate's Chromium-rkmpp-v126 or Chromium-rkmpp-v125 vpu hardware acceleration seems to work streaming 4K/60 Youtube videos based on CPU resources usage and chrome://media-internals.

image

Similarly on Joshua Riek Ubuntu-Jammy with kernel-5.10.160/209 with Panfork or Ubuntu-Noble with kernel-6.1.75 with Panthor.

kwankiu commented 1 month ago

@7Ji @JFLim1,

I have tested this chromium-mpp v126 on both latest BSP 5.10 and 6.1 kernel, on 6.1, i tested both panfork and panthor. I have also tried x11-gbm, wayland-gbm and x11-wayland-gbm, and all test behaves the same that it does not work (WebGL works, no Video Decode Acceleration).

This is tested on the Khadas Edge 2 on a clean installation of Arch Linux ARM with Gnome (the default Wayland session, as gdm login doesnt shows any alternative session option). (I can confirm that i have been using the same installation method when we had chromium-mpp v114 and it was working)

libv4l-rkmpp service: image

Running chromium with the following command without LD_LIBRARY_PATH or libmali, chrome://gpu shows:

chromium --use-gl=angle --use-angle=gles-egl --use-cmd-decoder=passthrough

image

But when i run chromium with the command you updated as below, chrome://gpu shows: (with LD_LIBARY_PATH and i have tried all x11-gbm, wayland-gbm and x11-wayland-gbm, chrome://gpu gives the same result)

LD_LIBRARY_PATH=/usr/lib/mali-valhall-g610/x11-gbm chromium --use-gl=angle --use-angle=gles-egl --use-cmd-decoder=passthrough

image

And so far no matter what i tried, video accerlation infomation shows nothing: image

Btw, I have noticed that this error appears on both panfork and panthor:

 rol.CreateCommandBuffer.
Warning: vkCreateInstance: Found no drivers!
Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
    at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:101)

And cat /dev/video-dec0 shows:

 [user@alarm ~]$ cat /dev/video-dec0
type=dec
codecs=VP8:VP9:H.264:H.265:AV1
max-width=7680
max-height=4320

Btw, it seems like WebGL is unsupported with chromium (no matter mpp or mainline) by default with both panfork and panthor, using --use-gl=egl loads WebGL content, but it gives me an unusable 1 or 2fps with WebGL Aquarium.

Using --use-gl=angle --use-angle=gles-egl do works well no matter with or without libmali (LD_LIBRARY_PATH), and it works both on panfork and panthor.

However, there is no Video Decode Acceleration.

kwankiu commented 1 month ago

Btw, adding flags and LD_LIBRARY_PATH to /etc/chromium-browser/default doesnt work anymore, do you know if there's an updated path or solution to this?

JFLim1 commented 1 month ago

@kwankiu, Have the same or similar experience with Chromium-mpp_v126 (7Ji-Repo) on Archlinux-Gnome with bsp-kernel 6.1.75 with Panthor. WebGL works but NO vpu hardware acceleration. Just like what @7Ji mentioned -- no vpu acceleraton with Panthor, kernel 6.1

With Chromium-mpp_v126(7Ji-Repo) on bsp-5.10, X11, Panfork somehow I could not get vpu hardware acceleration to work either (Chromium video info shows nothing) and tested with 4K video high CPU usage.

Did managed to get Chromium-mpp_v126 to run with vpu hardware acceleration with bsp-kernel-5.10? + Panfork?

7Ji commented 1 month ago

Do actual debugging with echo 7 | sudo tee /sys/module/rk_vcodec/parameters/mpp_dev_debug and dmesg -w

hardware acceleration seems to work streaming 4K/60 Youtube videos based on CPU resources usage and chrome://media-internals.

@JFLim1 Please, provide a 6.1 + panthor screenshot with the kernel log on your whatever the distro is. I don't ever believe libv4l-rkmpp work with panthor.

Please, don't even try to dig decoding problems if GPU doesn't even work. When you saw software only in chrome://gpu don't even go to try with debugging.

This thread is not helping at improving the state. I'm unsubscribing from the thread.

JFLim1 commented 1 month ago

Hi @7Ji ,

Is this what you are looking for?

Linux orangepi5-plus 6.1.75-vendor-rk35xx #1 SMP Fri Jul 19 14:49:03 UTC 2024 aarch64 aarch64 aarch64 GNU/Linux

jfl@orangepi5-plus:~$ glxinfo -B
name of display: :1
display: :1  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Mesa (0xffffffff)
    Device: Mali-G610 (Panfrost) (0xffffffff)
    Version: 24.1.5
    Accelerated: yes
    Video memory: 15967MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 3.1
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.1
OpenGL vendor string: Mesa
OpenGL renderer string: Mali-G610 (Panfrost)
OpenGL core profile version string: 3.1 Mesa 24.1.5 - kisak-mesa PPA
OpenGL core profile shading language version string: 1.40
OpenGL core profile context flags: (none)

OpenGL version string: 3.1 Mesa 24.1.5 - kisak-mesa PPA
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.1 Mesa 24.1.5 - kisak-mesa PPA
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10

jfl@orangepi5-plus:~$ 
jfl@orangepi5-plus:/var/log$ apt list *mesa* --installed
Listing... Done
libegl-mesa0/jammy,now 24.1.5~kisak1~j arm64 [installed,automatic]
libgl1-mesa-dri/jammy,now 24.1.5~kisak1~j arm64 [installed]
libglapi-mesa/jammy,now 24.1.5~kisak1~j arm64 [installed,automatic]
libglu1-mesa/jammy,now 9.0.2-1 arm64 [installed,automatic]
libglx-mesa0/jammy,now 24.1.5~kisak1~j arm64 [installed]
mesa-utils-bin/jammy,now 8.4.0-1ubuntu1 arm64 [installed,automatic]
mesa-utils/jammy,now 8.4.0-1ubuntu1 arm64 [installed

image

7Ji commented 1 month ago

Do actual debugging with echo 7 | sudo tee /sys/module/rk_vcodec/parameters/mpp_dev_debug and dmesg -w, if there's actual decoding happening then for each frame a new dmesg log should be written, and on panthor that shouldn't even work.

Do I need to paste this over and over again?