Ubuntu22.04 chromium can not use hardware acceleration

Which system do you use? Android, Ubuntu, OOWOW or others?

ubuntu22.04 through OOWOW install

Please describe your issue below:

follow Edge2 Chromium with WebGL [Khadas Docs] instructions, chromium still can not use hardware acceleration

Post a console log of your issue below:

chrome://flags 

Chromium        107.0.5304.62 (Developer Build) Ubuntu 22.04 (64-bit)
Revision        1eec40d3a5764881c92085aaee66d25075c159aa-refs/branch-heads/5304@{#942}
OS      Linux
JavaScript      V8 10.7.193.16
User Agent      Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Command Line    /usr/lib/chromium-browser/chromium-browser --enable-pinch --enable-crashpad --flag-switches-begin --enable-gpu-rasterization --enable-webgpu-developer-features --ignore-gpu-blocklist --ozone-platform-hint=wayland --enable-features=EnableDrDc,Vulkan --flag-switches-end --ozone-platform=wayland --desktop-startup-id=gnome-shell/Chromium Web Browser/2172-0-Khadas_TIME28887
Executable Path /usr/lib/chromium-browser/chromium-browser
Profile Path    /home/khadas/.config/chromium/Default

after enable flags based on the https://docs.khadas.com/products/sbc/edge2/applications/chromium
check gpu ,still can not use hardware acceleration

chrome://gpu
Graphics Feature Status
Canvas: Software only, hardware acceleration unavailable
Canvas out-of-process rasterization: Disabled
Direct Rendering Display Compositor: Disabled
Compositing: Software only. Hardware acceleration disabled
Multiple Raster Threads: Enabled
OpenGL: Disabled
Rasterization: Software only. Hardware acceleration disabled
Raw Draw: Disabled
Video Decode: Software only. Hardware acceleration disabled
Video Encode: Software only. Hardware acceleration disabled
Vulkan: Disabled
WebGL: Software only, hardware acceleration unavailable
WebGL2: Software only, hardware acceleration unavailable
WebGPU: Disabled

other inforatmion
after install mesa-utils

khadas@Khadas:~$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 4.5
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 22.0.5
OpenGL core profile shading language version string: 4.50
OpenGL version string: 4.5 (Compatibility Profile) Mesa 22.0.5
OpenGL shading language version string: 4.50
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.0.5
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    GL_EXT_shader_implicit_conversions, GL_EXT_shader_integer_mix,
khadas@Khadas:~$

after use apt install vainfo va-driver-all

khadas@Khadas:~$ vainfo
libva info: VA-API version 1.14.0
libva error: vaGetDriverNameByIndex() failed with invalid VADisplay, driver_name = (null)
vaInitialize failed with error code 3 (invalid VADisplay),exit
khadas@Khadas:~$

khadas@Khadas:~$ sudo dmesg | grep gpu
[   12.164539] vdd_gpu_s0: supplied by vcc5v0_sys
[   12.165355] vdd_gpu_s0: 550 <--> 950 mV at 750 mV, enabled
[   13.926375] rockchip-pm-domain fd8d8000.power-management:power-controller: Looking up gpu-supply from device tree
[   13.926452] rockchip-pm-domain fd8d8000.power-management:power-controller: Looking up gpu-supply property in node /power-management@fd8d8000/power-controller failed
[   13.926665] mali fb000000.gpu: Kernel DDK version g11p0-01eac0
[   13.926692] mali fb000000.gpu: Looking up mali-supply from device tree
[   13.943177] mali fb000000.gpu: Looking up mem-supply from device tree
[   13.946650] mali fb000000.gpu: Looking up mali-supply from device tree
[   13.954273] vdd_gpu_s0: could not add device link fb000000.gpu: -EEXIST
[   13.954279] vdd_gpu_s0: Failed to create debugfs directory
[   13.954290] mali fb000000.gpu: Looking up mem-supply from device tree
[   13.954316] vdd_gpu_s0: could not add device link fb000000.gpu: -EEXIST
[   13.954322] vdd_gpu_s0: Failed to create debugfs directory
[   13.954726] mali fb000000.gpu: leakage=15
[   13.959714] mali fb000000.gpu: Looking up mali-supply from device tree
[   13.962411] vdd_gpu_s0: could not add device link fb000000.gpu: -EEXIST
[   13.962418] vdd_gpu_s0: Failed to create debugfs directory
[   13.964089] mali fb000000.gpu: pvtm=864
[   13.969358] mali fb000000.gpu: pvtm-volt-sel=3
[   13.985876] mali fb000000.gpu: avs=0
[   14.001376] W : [File] : drivers/gpu/arm/bifrost/platform/rk/mali_kbase_config_rk.c; [Line] : 136; [Func] : kbase_platform_rk_init(); power-off-delay-ms not available.
[   14.011000] mali fb000000.gpu: r0p0 status 5 is unknown; treating as r0p0 status 0
[   14.013493] mali fb000000.gpu: GPU identified as 0x7 arch 10.8.6 r0p0 status 0
[   14.015982] mali fb000000.gpu: No priority control manager is configured
[   14.023058] mali fb000000.gpu: No memory group manager is configured
[   14.025350] mali fb000000.gpu: Protected memory allocator not available
[   14.028570] mali fb000000.gpu: l=10000 h=85000 hyst=5000 l_limit=0 h_limit=800000000 h_table=0
[   14.039336] mali fb000000.gpu: Probed as mali0
[   14.437041] I : [File] : drivers/gpu/arm/mali400/mali/linux/mali_kernel_linux.c; [Line] : 405; [Func] : mali_module_init(); svn_rev_string_from_arm of this mali_ko is '', rk_ko_ver is '5', built at '20:24:58', on 'Oct 18 2022'.
[   28.495055] mali fb000000.gpu: Loading Mali firmware 0x1010000
[   28.495373] mali fb000000.gpu: Protected memory allocator not found, Firmware protected mode entry will not be supported
[   28.495384] mali fb000000.gpu: Protected memory allocator not found, Firmware protected mode entry will not be supported
[   28.495387] mali fb000000.gpu: Protected memory allocator not found, Firmware protected mode entry will not be supported
khadas@Khadas:~$ sudo dmesg | grep vga
khadas@Khadas:~$ sudo dmesg | grep video
[   10.762922] videodev: Linux video capture interface: v2.00
[   11.599947] mpp_service mpp-srv: 0a62e4a3751f author: ZiHan Huang 2022-05-17 Revert "video: rockchip: mpp: write a sem around session dma operations"
[   13.030413] : get_remote_sensor: video pad[0] is null
[   13.035156] : get_remote_sensor: video pad[0] is null
[   13.039910] : get_remote_sensor: video pad[0] is null
[   13.044659] : get_remote_sensor: video pad[0] is null
[   13.069314] : get_remote_sensor: video pad[0] is null
[   13.073891] : get_remote_sensor: video pad[0] is null
[   13.078500] : get_remote_sensor: video pad[0] is null
[   13.083136] : get_remote_sensor: video pad[0] is null
[   13.107272] : get_remote_sensor: video pad[0] is null
[   13.111680] : get_remote_sensor: video pad[0] is null
[   13.122226] : get_remote_sensor: video pad[0] is null
[   13.126777] : get_remote_sensor: video pad[0] is null
[   13.181927] usbcore: registered new interface driver uvcvideo

Screenshot from 2022-11-04 02-56-52

Hello @leslie

Please double check the falgs you have setup correct as documentation/

请问有进展吗 dmesg 中的gpu 那些信息能否介绍一下 安装mesa-utils后 发现opengl之类的都装上了 跑glxgears fps数很正常 cat /proc/interrupts 发现 gpu相关的中断也都在增长 说明gpu在使用中 , vaapi的dirver安装后 好像缺少一个liba的库 不知道这个和chromium的 启动不了 webgl的硬件加速是否有关

现在的是因为gpio那个信息一直在dmesg里打印 我想看有用的其他信息都没有了 例如gpu vga之类的开机信息之类的

@leslie 进Setting->About 看看,截个图出来。

Hello @leslie

目前看来桌面gpu环境是没问题的,至于WebGL不能用的问题,如果操作没问题,那么原因可能是Chromium更新了,从而导致之前的配置方法失效了。

有应对方案吗?想拿来看看8k视频效果怎样

你们有在最新的版本上验证过吗?还是我这台个体的原因

https://webglsamples.org

It does not appear your computer supports WebGL.
Click here for more information.

Status: Could not create a WebGL context, VENDOR = 0xffff, DEVICE = 0xffff, GL_VENDOR = ARM, GL_RENDERER = Mali-LODX, GL_VERSION = v1.g6p0, Sandboxed = no, Optimus = no, AMD switchable = no, Reset notification strategy = 0x8252, ErrorMessage = bindToCurrentThread failed: .

需要自己编译webgl驱动吗?怎么整?你们有在你们的环境里验证这个问题 或者我怎么装能支持的chromimu版本?给个教程

Hello @leslie

目前我们这边测试已经可以用了,稍后会给你一个处理方法。

需要参考下面的步骤更新一下GPU库。

sudo cp /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0 /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0.backup
sudo ln -fs /usr/lib/aarch64-linux-gnu/libMali.so /usr/lib/aarch64-linux-gnu/libgbm.so.1.0.0
sync

然后在试试,设置方法和之前一样。

I configured this all according to the info here and it works, but Chromium is very buggy and flickers now. Is this the expected behavior?

Hello @nmajin

Yes, the performance of Chromium with hardware acceleration is not good.

Does anyone know if Ubuntu is every going to get hardware acceleration support with Chromium or any browser for that matter?

I think openFyde may be the only OS that worked out well for me in regards to actually using the GPU properly, but I could not get my audio to work properly.

For openFyde to need to choose the right sound card manually, it should work.

Is this something that needs to be done in the crosh shell?

I only have an option via the UI for “internal” and “ HDMI/DP”. “Internal” does nothing but going from internal and back to HDMI/DP seems to temporarily work for 1 video via YouTube in Chromium. Then audio doesn’t work again.

Hi, I got the same problem by following the steps from wiki. It turns out the chromium-beta doesn’t have the hardware acceleration enabled at all. I got everything in yellow or red.

However the snap version of chromium has some of them enabled. Compare to your screenshot, there are a few items that are different:

  • Compositing: my setup shows Software only. Hardware acceleration disabled.
  • Skia Graphite: Disabled
  • WebGL: Hardware accelerated but at reduced performance

Do you have some suggestions to tune it?