panfrost on C4 (mesa drivers)

Post Reply
miskol
Posts: 264
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 25 times
Contact:

panfrost on C4 (mesa drivers)

Post by miskol »

So If anybody would like to try panfrost on C4 (https://www.collabora.com/news-and-blog ... ics-blobs/)
You will need to build ubuntu 20.04 armbian https://github.com/armbian/build
./compile.sh BOARD=odroidc4 BRANCH=dev RELEASE=focal BUILD_MINIMAL=yes BUILD_DESKTOP=no KERNEL_ONLY=no KERNEL_CONFIGURE=no COMPRESS_OUTPUTIMAGE=sha,gpg,img

And then you will need to add PAN_MESA_DEBUG=bifrost to image
sudo sh -c "echo 'PAN_MESA_DEBUG=bifrost' >> /etc/environment"

And then add mesa master ppa (https://launchpad.net/~oibaf/+archive/u ... cs-drivers)
sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt upgrade

and you can try ubuntu desktop(gnome)
sudo apt install ubuntu-desktop -y
Last edited by miskol on Wed Jun 24, 2020 9:15 pm, edited 1 time in total.
These users thanked the author miskol for the post:
superpowter77 (Mon May 17, 2021 4:03 am)

miskol
Posts: 264
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by miskol »

If anybody want to try panfrost on N2
it is "working" but it will crash after some time
These users thanked the author miskol for the post (total 2):
brad (Fri Jun 19, 2020 8:33 pm) • jgmdev (Sat Jun 20, 2020 12:30 am)

brad
Posts: 1459
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 C4 HC4 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 136 times
Been thanked: 223 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by brad »

Will be interesting to see feature and performance comparison of panfrost vs libMali on C4 (and also N2)

Panfrost has open source and heavy development and should support X11. It also comes as part of the mesa stack so no messy configurations of binary blobs.

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 150 times
Been thanked: 262 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by jgmdev »

miskol wrote:
Fri Jun 19, 2020 6:09 pm
If anybody want to try panfrost on N2
it is "working" but it will crash after some time
That is a piece of good news! Even if crashing this means the developers started adding support for it! I haven't made time to test newest panfrost changes on the C4, but now (thanks to you) I know it works on the N2 and feel more motivated :D Time to compile mesa from git!

miskol
Posts: 264
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by miskol »

Ppa from my first post contains mesa packages with daily mesa builds from mesa git master.
All work fine also for lima odroid C2

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 150 times
Been thanked: 262 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by jgmdev »

miskol wrote:
Sat Jun 20, 2020 1:54 am
Ppa from my first post contains mesa packages with daily mesa builds from mesa git master.
All work fine also for lima odroid C2
I'm running on archlinux so can't use those unless I repackage them. I did compiled mesa from git with panfrost dri driver and set the environment variable to bifrost but the odroid n2 was still using llvmpipe when doing glxinfo. Does your glxinfo displays panfrost? Also I loaded the panfrost kernel module but no luck, will test the build on C4 and see if it works.

Edit:

Tested my mesa-git build on the odroid c4 and got same llvmpipe result instead of panfrost on glxinfo :(

brad
Posts: 1459
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 C4 HC4 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 136 times
Been thanked: 223 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by brad »

jgmdev wrote:
Sat Jun 20, 2020 4:02 am
Tested my mesa-git build on the odroid c4 and got same llvmpipe result instead of panfrost on glxinfo :(
I think you will need the mali kernel driver which is not part of the kernel source - https://github.com/superna9999/meson_g12a_mali_bifrost

This is the dkms module you already had working on arch? it creates the /dev/mali0 device

hominoid
Posts: 571
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, C4, XU4, MC1, N1, N2, N2+, HC4
Location: Lake Superior Basin, USA
Has thanked: 65 times
Been thanked: 213 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by hominoid »

miskol wrote:
Fri Jun 19, 2020 6:08 pm
And then you will need to add PAN_MESA_DEBUG=bifrost to image
sudo sh -c "echo 'PAN_MESA_DEBUG=bifrost' >> /etc/enviroment"
@miskol, you have a typo in the above command. It should be
sudo sh -c "echo 'PAN_MESA_DEBUG=bifrost' >> /etc/environment"
These users thanked the author hominoid for the post:
miskol (Wed Jun 24, 2020 9:15 pm)

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 150 times
Been thanked: 262 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by jgmdev »

brad wrote:
Sat Jun 20, 2020 11:00 am
jgmdev wrote:
Sat Jun 20, 2020 4:02 am
Tested my mesa-git build on the odroid c4 and got same llvmpipe result instead of panfrost on glxinfo :(
I think you will need the mali kernel driver which is not part of the kernel source - https://github.com/superna9999/meson_g12a_mali_bifrost

This is the dkms module you already had working on arch? it creates the /dev/mali0 device
I'm using version 24.0 patched by tobetter to work under latest 5.x kernels. If I recall correctly last time I tried compiling superna9999/meson_g12a_mali_bifrost under a newer kernel it didn't worked... Also I thought panfrost was completely independent from mali kernel driver...

Would be nice to have some documentation on how to properly get the panfrost driver working under mali bifrost devices. I did saw a patched kernel to make it work under the odroid n2 and go advance posted by main panfrost developer, but I don't know if that is still needed...

brad
Posts: 1459
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 C4 HC4 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 136 times
Been thanked: 223 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by brad »

jgmdev wrote:
Fri Jun 26, 2020 1:56 am
I'm using version 24.0 patched by tobetter to work under latest 5.x kernels. If I recall correctly last time I tried compiling superna9999/meson_g12a_mali_bifrost under a newer kernel it didn't worked... Also I thought panfrost was completely independent from mali kernel driver...

Would be nice to have some documentation on how to properly get the panfrost driver working under mali bifrost devices. I did saw a patched kernel to make it work under the odroid n2 and go advance posted by main panfrost developer, but I don't know if that is still needed...
Yes looking at that I think you might be right, did you happen to find mali device somewhere in /dev/ with the panfrost driver enabled?

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 150 times
Been thanked: 262 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by jgmdev »

brad wrote:
Fri Jun 26, 2020 11:47 am
Yes looking at that I think you might be right, did you happen to find mali device somewhere in /dev/ with the panfrost driver enabled?
Tested with the mali bifrost kernel driver uninstalled and modprobe panfrost doesn't seems to add /dev/mali* With the mali bifrost kernel driver installed /dev/mali0 is loaded as expected, but it seems that panfrost isn't able to detect the g31 gpu. Maybe a patched kernel is needed after all that introduces the id's of the G31 gpu and G52 gpu in odroid n2 case (but that is just me speculating).

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 150 times
Been thanked: 262 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by jgmdev »

I just asked on the panfrost irc channel and some one told me that the g31 and g52 aren't whitelisted yet on the panfrost kernel driver and these patches are required:

https://patches.linaro.org/patch/187792/
https://patches.linaro.org/patch/187793/

So I guess armbian kernel is patched to add G31 and G52 to panfrost because without that it shouldn't work and llvmpipe would be the one doing the rendering.

miskol
Posts: 264
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by miskol »

jgmdev wrote:
Sat Jun 27, 2020 3:44 am
I just asked on the panfrost irc channel and some one told me that the g31 and g52 aren't whitelisted yet on the panfrost kernel driver and these patches are required:

https://patches.linaro.org/patch/187792/
https://patches.linaro.org/patch/187793/

So I guess armbian kernel is patched to add G31 and G52 to panfrost because without that it shouldn't work and llvmpipe would be the one doing the rendering.
armbian for C4 use mainline kernel +
https://github.com/armbian/build/tree/m ... eson64-dev
So you can check it :)
These users thanked the author miskol for the post (total 3):
brad (Sun Jun 28, 2020 4:31 pm) • jgmdev (Mon Jun 29, 2020 10:07 am) • odroid (Mon Jun 29, 2020 10:21 am)

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 150 times
Been thanked: 262 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by jgmdev »

miskol wrote:
Sat Jun 27, 2020 9:37 pm
armbian for C4 use mainline kernel +
https://github.com/armbian/build/tree/m ... eson64-dev
So you can check it :)
Whoa, didn't expected all those patches :D

Toggleton
Posts: 8
Joined: Mon May 27, 2019 5:39 pm
languages_spoken: english
ODROIDs: C2, N2, C4
Has thanked: 3 times
Been thanked: 9 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by Toggleton »

Did get it to work on Manjaro swayWM edition. Proof https://i.imgur.com/2mkucaa.png
Image
With these 2 patches did it only show a black screen and it did spam errors.
https://patches.linaro.org/patch/187792/
https://patches.linaro.org/patch/187793/

but with these does it work now as it does on armbian :) (not sure if all of them are needed but 4h compile time is to long to test it :D )
0056-FROMLIST-v1-drm-panfrost-Fix-inbalance-of-devfreq-re.patch
0057-FROMLIST-v2-drm-panfrost-Fix-runtime-PM-imbalance-on.patch
0058-FROMLIST-v1-drm-panfrost-Fix-runtime-PM-imbalance-in.patch
0063-WIP-drm-panfrost-add-support-for-custom-soft-reset-o.patch
source: https://github.com/armbian/build/tree/2 ... eson64-dev that meson64-dev got deleted and in meson64-current did i not find these patches anymore.

Will write later a step by step guide and a updated PKGBUILD for ManjaroArm there viewtopic.php?f=203&t=38640 Could be that it works on archlinuxarm too but i have not tested it.
These users thanked the author Toggleton for the post (total 3):
odroid (Fri Jul 10, 2020 9:25 am) • odroidn2user (Fri Jul 10, 2020 2:46 pm) • jgmdev (Thu Jul 16, 2020 6:44 am)

odroidn2user
Posts: 419
Joined: Fri Oct 25, 2019 4:14 pm
languages_spoken: english
ODROIDs: N2, C4
Has thanked: 117 times
Been thanked: 111 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by odroidn2user »

Interesting! And wonderful to see :) Hopefully at some point soon Manjaro itself will enable those patches.

Also, early positive reports on the Odroid GO Advance here: viewtopic.php?f=194&p=298943&sid=96950d ... aa#p298892

According to the lead dev, even full Gnome 3 on Wayland should work with the G31 now.

deuteragenie
Posts: 44
Joined: Fri Jun 07, 2019 4:56 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 9 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by deuteragenie »

Looking fwd to having this work on the N2.

Could be interesting to compile (daily, given the fast development pace of Panfrost) mesa with some optimization settings:

"--buildtype=release"
"-Doptimization=3"
"-Ddebug=false"
"-Db_ndebug=true"
"-Dstrip=true"
"-Dzstd=true"

and enable LTO:

"-Db_lto=true"
"-Dllvm=disabled"

miskol
Posts: 264
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by miskol »

I tested panfrost(mesa master) today 23.07.2020 and performance is better every day on C4
glmark2 is running over 60fps and more except 1 test
still some artefacts on gnome with wayland

N2 still in same state :(
These users thanked the author miskol for the post (total 2):
odroid (Thu Jul 23, 2020 6:40 pm) • odroidn2user (Sun Jul 26, 2020 4:31 am)

odroidn2user
Posts: 419
Joined: Fri Oct 25, 2019 4:14 pm
languages_spoken: english
ODROIDs: N2, C4
Has thanked: 117 times
Been thanked: 111 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by odroidn2user »

miskol wrote:
Thu Jul 23, 2020 6:31 pm
I tested panfrost(mesa master) today 23.07.2020 and performance is better every day on C4
glmark2 is running over 60fps and more except 1 test
still some artefacts on gnome with wayland

N2 still in same state :(
Besides glmark2, how usable for actual daily use is the panfrost driver with gnome/wayland?
You mention some artefacts, could you give a little more insights?

miskol
Posts: 264
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by miskol »

odroidn2user wrote:
Sun Jul 26, 2020 4:33 am
miskol wrote:
Thu Jul 23, 2020 6:31 pm
I tested panfrost(mesa master) today 23.07.2020 and performance is better every day on C4
glmark2 is running over 60fps and more except 1 test
still some artefacts on gnome with wayland

N2 still in same state :(
Besides glmark2, how usable for actual daily use is the panfrost driver with gnome/wayland?
You mention some artefacts, could you give a little more insights?
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3308
These users thanked the author miskol for the post (total 2):
deuteragenie (Tue Jul 28, 2020 6:24 am) • odroidn2user (Tue Jul 28, 2020 7:18 pm)

deuteragenie
Posts: 44
Joined: Fri Jun 07, 2019 4:56 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 9 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by deuteragenie »

I tested panfrost(mesa master) today 23.07.2020 and performance is better every day on C4
glmark2 is running over 60fps and more except 1 test
Out of curiosity, could you post the results of glmark2-es2-fbdev --off-screen with panfrost ?

miskol
Posts: 264
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 25 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by miskol »

deuteragenie wrote:
Tue Jul 28, 2020 6:21 am
I tested panfrost(mesa master) today 23.07.2020 and performance is better every day on C4
glmark2 is running over 60fps and more except 1 test
Out of curiosity, could you post the results of glmark2-es2-fbdev --off-screen with panfrost ?
glmark2-es2-wayland --off-screen
=======================================================
glmark2 2014.03+git20150611.fa71af2d
=======================================================
OpenGL Information
GL_VENDOR: Panfrost
GL_RENDERER: Mali G31 (Panfrost)
GL_VERSION: OpenGL ES 2.0 Mesa 20.2.0-devel (git-c7626ac 2020-07-29 focal-oibaf-ppa)
=======================================================
[build] use-vbo=false: FPS: 254 FrameTime: 3.937 ms
[build] use-vbo=true: FPS: 299 FrameTime: 3.344 ms
[texture] texture-filter=nearest: FPS: 913 FrameTime: 1.095 ms
[texture] texture-filter=linear: FPS: 884 FrameTime: 1.131 ms
[texture] texture-filter=mipmap: FPS: 915 FrameTime: 1.093 ms
[shading] shading=gouraud: FPS: 182 FrameTime: 5.495 ms
[shading] shading=blinn-phong-inf: FPS: 184 FrameTime: 5.435 ms
[shading] shading=phong: FPS: 161 FrameTime: 6.211 ms
[shading] shading=cel: FPS: 158 FrameTime: 6.329 ms
[bump] bump-render=high-poly: FPS: 64 FrameTime: 15.625 ms
[bump] bump-render=normals: FPS: 633 FrameTime: 1.580 ms
[bump] bump-render=height: FPS: 548 FrameTime: 1.825 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 233 FrameTime: 4.292 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 96 FrameTime: 10.417 ms
[pulsar] light=false:quads=5:texture=false: FPS: 850 FrameTime: 1.176 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 73 FrameTime: 13.699 ms
[desktop] effect=shadow:windows=4: FPS: 359 FrameTime: 2.786 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 48 FrameTime: 20.833 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 48 FrameTime: 20.833 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 52 FrameTime: 19.231 ms
[ideas] speed=duration: FPS: 130 FrameTime: 7.692 ms
[jellyfish] <default>: FPS: 151 FrameTime: 6.623 ms
[terrain] <default>: FPS: 8 FrameTime: 125.000 ms
[shadow] <default>: FPS: 124 FrameTime: 8.065 ms
[refract] <default>: FPS: 16 FrameTime: 62.500 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 435 FrameTime: 2.299 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 270 FrameTime: 3.704 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 571 FrameTime: 1.751 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 414 FrameTime: 2.415 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 284 FrameTime: 3.521 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5:Segmentation fault
These users thanked the author miskol for the post (total 3):
odroid (Wed Jul 29, 2020 7:22 pm) • deuteragenie (Thu Jul 30, 2020 3:57 am) • joy (Fri Jul 31, 2020 1:32 pm)

deuteragenie
Posts: 44
Joined: Fri Jun 07, 2019 4:56 pm
languages_spoken: english
Has thanked: 14 times
Been thanked: 9 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by deuteragenie »

Thank you, it looks very promising indeed. I suppose the segfault will be fixed soon.

gseaman
Posts: 98
Joined: Fri Jan 01, 2016 2:42 pm
languages_spoken: english
ODROIDs: c1+/c4
Location: WA, USA
Has thanked: 0
Been thanked: 0
Contact:

Re: panfrost on C4 (mesa drivers)

Post by gseaman »

When this is working, the C4 is going to be a great board.

RussianNeuroMancer
Posts: 67
Joined: Sat Mar 30, 2019 1:43 pm
languages_spoken: english
Has thanked: 2 times
Been thanked: 3 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by RussianNeuroMancer »

miskol wrote:
Fri Jun 19, 2020 6:09 pm
it is "working" but it will crash after some time
Is it become more stable recently? Or ARM's driver is still preferred in terms of stability?

Also what crash exactly? Kernel driver or apps in user space?

InFerNo
Posts: 28
Joined: Mon Dec 22, 2014 9:40 pm
languages_spoken: english, dutch
ODROIDs: ODROID-C1, ODROID-C4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: panfrost on C4 (mesa drivers)

Post by InFerNo »

Is it only possible to use armbian build on Ubuntu because on my Arch desktop I keep getting

Code: Select all

[ error ] Running this tool on non x86-x64 build host in not supported

Code: Select all

uname -a
Linux ranger 5.7.11-arch1-1 #1 SMP PREEMPT Wed, 29 Jul 2020 21:38:21 +0000 x86_64 GNU/Linux

igorpec
Posts: 1022
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, HC4, C4, C2, C1+
Has thanked: 66 times
Been thanked: 149 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by igorpec »

InFerNo wrote:
Mon Aug 10, 2020 4:33 am
Is it only possible to use armbian build on Ubuntu because on my Arch desktop I keep getting

Code: Select all

[ error ] Running this tool on non x86-x64 build host in not supported
Porting a complex tool to all possible Linux distros is expensive (we can't afford) but luckily we have Docker to mitigate this problem.
https://docs.armbian.com/Developer-Guid ... th-Docker/
or full virtualisation.
ARMBIAN
Linux for ARM development boards
What is Armbian?

InFerNo
Posts: 28
Joined: Mon Dec 22, 2014 9:40 pm
languages_spoken: english, dutch
ODROIDs: ODROID-C1, ODROID-C4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: panfrost on C4 (mesa drivers)

Post by InFerNo »

Yes, of course, I understand that, but the error message doesn't say that so I asked to be sure.

This part is done after the image is flashed and I have booted the device, right?

Code: Select all

And then you will need to add PAN_MESA_DEBUG=bifrost to image
sudo sh -c "echo 'PAN_MESA_DEBUG=bifrost' >> /etc/environment"
Ok, so I added this to the running image and I have tried installing Gnome as in the OP, but graphics state "llvmpipe".

InFerNo
Posts: 28
Joined: Mon Dec 22, 2014 9:40 pm
languages_spoken: english, dutch
ODROIDs: ODROID-C1, ODROID-C4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: panfrost on C4 (mesa drivers)

Post by InFerNo »

I feel like I missed a crucial step somewhere :-)

Before ppa:

Code: Select all

    OpenGL Information
    GL_VENDOR:     VMware, Inc.
    GL_RENDERER:   llvmpipe (LLVM 10.0.0, 128 bits)
    GL_VERSION:    3.1 Mesa 20.0.8
After ppa:

Code: Select all

    OpenGL Information
    GL_VENDOR:     Mesa/X.org
    GL_RENDERER:   llvmpipe (LLVM 10.0.1, 128 bits)
    GL_VERSION:    3.1 Mesa 20.3.0-devel (git-eb78777 2020-08-19 focal-oibaf-ppa)
These users thanked the author InFerNo for the post:
odroidn2user (Wed Aug 19, 2020 6:24 pm)

jgmdev
Posts: 368
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4, HC4
Has thanked: 150 times
Been thanked: 262 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by jgmdev »

InFerNo wrote:
Wed Aug 19, 2020 6:14 pm
I feel like I missed a crucial step somewhere :-)
If you do sudo dmesg | grep panfrost do you get any initialization messages like:

Code: Select all

[   10.021359] panfrost ffe40000.gpu: clock rate = 799999987
[   10.039178] panfrost ffe40000.gpu: supply mali not found, using dummy regulator
[   10.045103] panfrost ffe40000.gpu: mali-g52 id 0x7212 major 0x0 minor 0x0 status 0x0
[   10.052716] panfrost ffe40000.gpu: features: 00000000,13de77ff, issues: 00000000,00000400
[   10.069198] panfrost ffe40000.gpu: Features: L2:0x07110206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xff JS:0x7
[   10.083122] panfrost ffe40000.gpu: shader_present=0x3 l2_present=0x1
[   10.092876] [drm] Initialized panfrost 1.1.0 20180908 for ffe40000.gpu on minor 1
That is my output on the Odroid N2 which should look somehow similar on the Odroid C4

If you don't get output like that you may need to patch the kernel to enable bifrost support. I was experimenting with the Odroid N2 (haven't experimented with the C4 since finding these patches) and added a PKGBUILD to build the kernel, which applies 6 patches from https://github.com/superna9999/linux/tr ... st-bifrost (while that PKGBUILD is targeted to the Odroid N2 I think it should also work on the C4).

Discovered that while reading these irc logs which seem to have the clue to properly enable the support:

https://freenode.irclog.whitequark.org/ ... 2020-07-20
https://freenode.irclog.whitequark.org/ ... 2020-07-23

On the Odroid N2 I haven't gotten any luck (since it seems something else needs to be enabled on mesa as I understood on the irc conversation) but haven't tested recently on the Odroid C4 with this new information and patches, you may give it a try.

Also you may want to experiment by uninstalling/installing the mali kernel driver and checking the output of sudo dmesg | grep panfrost (after a reboot) with it uninstalled and installed. I noticed that when the mali kernel driver was uninstalled panfrost initialization messages appeared, while when it was installed the messages did not show. But I'm not sure yet if the mali kernel driver is needed at all... I think it is indeed needed, I have to do some C4 testing too to arrive at a conclusion...

InFerNo
Posts: 28
Joined: Mon Dec 22, 2014 9:40 pm
languages_spoken: english, dutch
ODROIDs: ODROID-C1, ODROID-C4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: panfrost on C4 (mesa drivers)

Post by InFerNo »

sudo dmesg | grep panfrost gives me no output whatsoever, so it's definitely not enabled. I followed the instructions in the OP.

I built armbian using an Ubuntu VM, which created Armbian_20.08.0-trunk_Odroidc4_focal_dev_5.7.14_minimal.img

I found a post by NicoD and he actually has the same instructions, add the PPA, then update the system, but for some reason that doesn't really work for me.

Code: Select all

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Mesa/X.org (0xffffffff)
    Device: llvmpipe (LLVM 10.0.1, 128 bits) (0xffffffff)
    Version: 20.3.0
    Accelerated: no
    Video memory: 3753MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.5
    Max compat profile version: 3.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 10.0.1, 128 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 20.3.0-devel (git-d2cf6a8 2020-08-26 focal-oibaf-ppa)
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 3.1 Mesa 20.3.0-devel (git-d2cf6a8 2020-08-26 focal-oibaf-ppa)
OpenGL shading language version string: 1.40
OpenGL context flags: (none)

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.3.0-devel (git-d2cf6a8 2020-08-26 focal-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

InFerNo
Posts: 28
Joined: Mon Dec 22, 2014 9:40 pm
languages_spoken: english, dutch
ODROIDs: ODROID-C1, ODROID-C4
Has thanked: 0
Been thanked: 1 time
Contact:

Re: panfrost on C4 (mesa drivers)

Post by InFerNo »

Redid these steps yesterday and today, I still keep getting "llvmpipe".

biterror
Posts: 33
Joined: Tue Oct 27, 2015 4:01 pm
languages_spoken: english
ODROIDs: C1+, XU4
Has thanked: 2 times
Been thanked: 0
Contact:

Re: panfrost on C4 (mesa drivers)

Post by biterror »

I started with the ubuntu server install (ubuntu-21.04-server-odroidc4-20210502.img), did apt update and apt upgrade, tried to install a minimum X environment and am running kernel 5.14.0. Chromium reports it's not using any graphics acceleration (chrome://gpu). The panfrost driver is there according to lsmod. How can I find out what's missing?

This is what chromium prints when I start it from a shell:

Code: Select all

$ chromium-browser
/usr/bin/chromium-browser: 12: xdg-settings: not found
2021/09/16 10:01:12.869719 cmd_run.go:1002: WARNING: cannot create user data directory: failed to verify SELinux context of /home/odroid/snap: exec: "matchpathcon": executable file not found in $PATH

(chrome:10613): Gtk-WARNING **: 10:01:13.706: Theme parsing error: gtk.css:1566:23: 'font-feature-settings' is not a valid property name

(chrome:10613): Gtk-WARNING **: 10:01:13.723: Theme parsing error: gtk.css:3618:25: 'font-feature-settings' is not a valid property name

(chrome:10613): Gtk-WARNING **: 10:01:13.728: Theme parsing error: gtk.css:4080:23: 'font-feature-settings' is not a valid property name
[10613:10817:0916/100114.320959:ERROR:object_proxy.cc(642)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[10613:10817:0916/100114.322760:ERROR:object_proxy.cc(642)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[10613:10817:0916/100114.324676:ERROR:object_proxy.cc(642)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
libEGL warning: DRI2: failed to create dri screen
libEGL warning: DRI2: failed to create dri screen
[10768:10768:0916/100115.139764:ERROR:gpu_init.cc(441)] Passthrough is not supported, GL is egl
[10768:10768:0916/100115.162999:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
Fontconfig error: Cannot load default config file
I don't want to install the complete desktop environment because I only need a browser with some custom C programs.

Once I get this working I will post a complete list of commands required to set up a minimal kiosk type system on the C4.

User avatar
mad_ady
Posts: 9931
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 629 times
Been thanked: 767 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by mad_ady »

Look for the ChromeOS post for the N2 for ideas.

biterror
Posts: 33
Joined: Tue Oct 27, 2015 4:01 pm
languages_spoken: english
ODROIDs: C1+, XU4
Has thanked: 2 times
Been thanked: 0
Contact:

Re: panfrost on C4 (mesa drivers)

Post by biterror »

mad_ady wrote:
Thu Sep 16, 2021 10:16 pm
Look for the ChromeOS post for the N2 for ideas.
Thanks. I read the thread but didn't find the missing piece yet..

loopback7084
Posts: 2
Joined: Tue Oct 05, 2021 7:50 pm
languages_spoken: english
ODROIDs: odroid-c4
Has thanked: 1 time
Been thanked: 0
Contact:

Re: panfrost on C4 (mesa drivers)

Post by loopback7084 »

Hi everyone.... first post, please don't flame me too much... I'm looking for some help...

I have the Armbian Focal Minimal image running with the panfrost drivers on the odroid C4:-

Code: Select all

# uname -a
Linux odroid-4809f9 5.10.60-meson64 #21.08.1 SMP PREEMPT Wed Aug 25 19:29:40 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux

Code: Select all

# dmesg | grep panfrost
[    4.376151] panfrost ffe40000.gpu: clock rate = 24000000
[    4.376227] panfrost ffe40000.gpu: dev_pm_opp_set_regulators: no regulator (mali) found: -19
[    4.385122] panfrost ffe40000.gpu: mali-g31 id 0x7093 major 0x0 minor 0x0 status 0x0
[    4.385132] panfrost ffe40000.gpu: features: 00000000,3fde77ff, issues: 00000000,00000400
[    4.385136] panfrost ffe40000.gpu: Features: L2:0x07100206 Shader:0x00000000 Tiler:0x00000209 Mem:0x1 MMU:0x00002821 AS:0xff JS:0x7
[    4.385139] panfrost ffe40000.gpu: shader_present=0x1 l2_present=0x1
[    4.404314] [drm] Initialized panfrost 1.1.0 20180908 for ffe40000.gpu on minor 0
And I'm trying to display ( I don't really care how ).... H264 encoded video files.... everything I've read suggests that MPV, invoked with:

Code: Select all

# mpv -v --drm-connector=HDMI-A-1 --hwdec=vpdau --vo=gpu atomic_mashed.mp4
should be able to play hardware accelerated H264 videos... however MPV keeps reverting to software decoding :-/

Code: Select all

[vo/gpu] Probing for best GPU context.
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :0
[vo/gpu/x11] Display 0 (HDMI-1): [0, 0, 1280, 720] @ 50.177096 FPS
[vo/gpu/x11] Current display FPS: 50.177096
[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 0x9, visual ID 0x21
[vo/gpu/opengl] GL_VERSION='3.1 (Core Profile) Mesa 21.3.0-devel (git-0a592db 2021-10-05 focal-oibaf-ppa)'
[vo/gpu/opengl] Detected desktop OpenGL 3.1.
[vo/gpu/opengl] GL_VENDOR='Panfrost'
[vo/gpu/opengl] GL_RENDERER='Mali-G31 (Panfrost)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='1.40'
[vo/gpu/opengl] Loaded extension GL_ARB_sync.
[vo/gpu/opengl] Loaded extension GL_ARB_get_program_binary.
[vo/gpu/opengl] Loaded extension GL_ARB_shader_image_load_store.
[vo/gpu/opengl] Loaded extension GL_ARB_shader_storage_buffer_object.
[vo/gpu/opengl] Loaded extension GL_ARB_arrays_of_arrays.
[vo/gpu/opengl] Loaded extension GL_ARB_debug_output.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] Disabling HDR peak computation (one or more of the following is not supported: compute shaders=0, SSBO=1).
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Assuming 50.177096 FPS for display sync.
[vd] Container reported FPS: 30.000000
[vd] Codec list:
[vd]     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd]     h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd] Opening decoder h264
[vd] No hardware decoding available for this codec.
[vd] Using software decoding.
[vd] Detected 4 logical cores.
[vd] Requesting 5 threads for decoding.
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
I've tried everything I can think of.... encoded the video file using different H264 Profiles ( main, base, high10, high444 ) and different pix_fmt options ( usually yuv420p )

But for some reason I can't get the GPU to accept the file and decode... been going at this for days.... really appreciate any help.

NB:- I've also tried ffplay/ffmpeg, mplayer, c2play - with even less success:- some revert to software decode... some just crash out altogether....

Update:- I've also got an eMMC with the latest Ubuntu image from @tobetter ( again with panfrost ).... although the versions ( and seemingly the capabilities ) of the drivers are slightly different... the net result is the same:-

Code: Select all


# uname -a
Linux odroid-4809f9 5.10.0-odroid-panfrost-arm64 #1 SMP PREEMPT Ubuntu 5.10.12-202102040913~groovy (2021-02-04) aarch64 aarch64 aarch64 GNU/Linux

mpv -v --vo=gpu --hwdec=vpdau atomic_mashed.mp4
[vo/gpu] Probing for best GPU context.
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :0
[vo/gpu/x11] Display 0 (HDMI-1): [0, 0, 1280, 720] @ 50.177096 FPS
[vo/gpu/x11] Current display FPS: 50.177096
[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 0x9, visual ID 0x21
[vo/gpu/opengl] GL_VERSION='3.1 (Core Profile) Mesa 21.1.0-devel (git-14b2dc0013)'
[vo/gpu/opengl] Detected desktop OpenGL 3.1.
[vo/gpu/opengl] GL_VENDOR='Panfrost'
[vo/gpu/opengl] GL_RENDERER='Mali G31 (Panfrost)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='1.40'
[vo/gpu/opengl] Loaded extension GL_ARB_sync.
[vo/gpu/opengl] Loaded extension GL_ARB_get_program_binary.
[vo/gpu/opengl] Loaded extension GL_ARB_shader_storage_buffer_object.
[vo/gpu/opengl] Loaded extension GL_ARB_arrays_of_arrays.
[vo/gpu/opengl] Loaded extension GL_ARB_debug_output.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] Disabling HDR peak computation (one or more of the following is not supported: compute shaders=0, SSBO=1).
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Assuming 50.177096 FPS for display sync.
[vd] Container reported FPS: 30.000000
[vd] Codec list:
[vd]     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd]     h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd]     h264_cuvid (h264) - Nvidia CUVID H264 decoder
[vd] Opening decoder h264
[vd] No hardware decoding available for this codec.
[vd] Using software decoding.
[vd] Detected 4 logical cores.
[vd] Requesting 5 threads for decoding.
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)

Code: Select all

# dmesg  | grep panfrost
[    4.292188] panfrost ffe40000.gpu: clock rate = 24000000
[    4.292268] panfrost ffe40000.gpu: dev_pm_opp_set_regulators: no regulator (mali) found: -19
[    4.294057] panfrost ffe40000.gpu: mali-g31 id 0x7093 major 0x0 minor 0x0 status 0x0
[    4.294100] panfrost ffe40000.gpu: features: 00000000,3fde77ff, issues: 00000000,00000400
[    4.294104] panfrost ffe40000.gpu: Features: L2:0x07100206 Shader:0x00000000 Tiler:0x00000209 Mem:0x1 MMU:0x00002821 AS:0xff JS:0x7
[    4.294108] panfrost ffe40000.gpu: shader_present=0x1 l2_present=0x1
[    4.304252] [drm] Initialized panfrost 1.1.0 20180908 for ffe40000.gpu on minor 0

User avatar
mad_ady
Posts: 9931
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 629 times
Been thanked: 767 times
Contact:

Re: panfrost on C4 (mesa drivers)

Post by mad_ady »

The GPU doesn't decode h264. It's the VPU's job. Mainline kernel is slowly adding VPU/VDEC support for h264, but I haven't seen it working.
The GPU handles rendering on screen, and in the meantime (with mainline kernet at least), you'll have to settle for software decoding.

hanguofu
Posts: 16
Joined: Fri Sep 28, 2018 2:35 am
languages_spoken: english
Has thanked: 0
Been thanked: 0
Contact:

Re: panfrost on C4 (mesa drivers)

Post by hanguofu »

Hi , loopback7084 : Have you tried tobetter's "Ubuntu 21.04 for ODROID-N2/C4/HC4" with cmd. : mpv -v --vo=gpu atomic_mashed.mp4 ?

chatplosion
Posts: 17
Joined: Wed Jan 29, 2020 3:35 pm
languages_spoken: german, english
ODROIDs: Odroid-N2 4GB-RAM CoreELEC
Has thanked: 5 times
Been thanked: 0
Contact:

Re: panfrost on C4 (mesa drivers)

Post by chatplosion »

I have an idea. Does anyone want to try the newest Mesa3D with Vulkan?
But there is no warranty that it works or crashes your system.

First: You find the source of it here https://gitlab.freedesktop.org/mesa/mesa

Second: You need to get meson and ninja

Code: Select all

sudo apt update
sudo apt install meson ninja-build
Third: cloning the code with git and look for dependencies

Code: Select all

git clone https://gitlab.freedesktop.org/mesa/mesa.git mesa3d-source-master
cd mesa3d-source-master
git fetch
git pull
mkdir build
cd build
meson -Ddri-drivers=auto -Dvulkan-drivers=panfrost -Dgallium-drivers=panfrost -Dllvm=disabled ..
It shows you what is missing. Get everything missing.

Fourth: compile

Code: Select all

aC='' && [ "$(uname -m)" = x86_64 ] && a=64
c="$(lscpu -p | grep -v '#' | sort -u -t , -k 2,4 | wc -l)" ; [ "$c" -eq 0 ] && c=1
meson -Ddri-drivers=auto -Dvulkan-drivers=panfrost -Dgallium-drivers=panfrost -Dllvm=disabled ..
ninja -j$c
Fifth: install and pray that all was going good

By the way my N2+ halted while compiling. I never got the chance to test it.

Good luck!

Code: Select all

sudo ninja install
init 6

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest