panfrost on C4 (mesa drivers)

Post Reply
miskol
Posts: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 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.

miskol
Posts: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 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: 1171
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 59 times
Been thanked: 108 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: 103
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4
Has thanked: 30 times
Been thanked: 67 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: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 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: 103
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4
Has thanked: 30 times
Been thanked: 67 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: 1171
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 59 times
Been thanked: 108 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: 437
Joined: Tue Feb 28, 2017 3:55 am
languages_spoken: english
ODROIDs: C2, C4, XU4, MC1, N1, N2
Location: Lake Superior Basin, USA
Has thanked: 39 times
Been thanked: 124 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: 103
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4
Has thanked: 30 times
Been thanked: 67 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: 1171
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 59 times
Been thanked: 108 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: 103
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4
Has thanked: 30 times
Been thanked: 67 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: 103
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4
Has thanked: 30 times
Been thanked: 67 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: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 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: 103
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4
Has thanked: 30 times
Been thanked: 67 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: 2 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: 303
Joined: Fri Oct 25, 2019 4:14 pm
languages_spoken: english
ODROIDs: N2, C4
Has thanked: 80 times
Been thanked: 78 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: 26
Joined: Fri Jun 07, 2019 4:56 pm
languages_spoken: english
Has thanked: 4 times
Been thanked: 0
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: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 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: 303
Joined: Fri Oct 25, 2019 4:14 pm
languages_spoken: english
ODROIDs: N2, C4
Has thanked: 80 times
Been thanked: 78 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: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 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: 26
Joined: Fri Jun 07, 2019 4:56 pm
languages_spoken: english
Has thanked: 4 times
Been thanked: 0
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: 258
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
ODROIDs: XU4,C1,C2,N2,C4
Has thanked: 1 time
Been thanked: 24 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: 26
Joined: Fri Jun 07, 2019 4:56 pm
languages_spoken: english
Has thanked: 4 times
Been thanked: 0
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: 97
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: 17
Joined: Sat Mar 30, 2019 1:43 pm
languages_spoken: english
Has thanked: 0
Been thanked: 0
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: 21
Joined: Mon Dec 22, 2014 9:40 pm
languages_spoken: english, dutch
ODROIDs: ODROID-C1, ODROID-C4
Has thanked: 0
Been thanked: 0
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: 644
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+
Has thanked: 32 times
Been thanked: 84 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

Download latest images for Odroids | Build them from sources | Donate to support development

InFerNo
Posts: 21
Joined: Mon Dec 22, 2014 9:40 pm
languages_spoken: english, dutch
ODROIDs: ODROID-C1, ODROID-C4
Has thanked: 0
Been thanked: 0
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".

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest