panfrost on C4 (mesa drivers)

Post Reply
miskol
Posts: 249
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
Has thanked: 1 time
Been thanked: 17 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: 249
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
Has thanked: 1 time
Been thanked: 17 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: 1120
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 46 times
Been thanked: 93 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: 80
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, C4
Has thanked: 23 times
Been thanked: 48 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: 249
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
Has thanked: 1 time
Been thanked: 17 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: 80
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, C4
Has thanked: 23 times
Been thanked: 48 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: 1120
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 46 times
Been thanked: 93 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: 424
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: 35 times
Been thanked: 116 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: 80
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, C4
Has thanked: 23 times
Been thanked: 48 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: 1120
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 46 times
Been thanked: 93 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: 80
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, C4
Has thanked: 23 times
Been thanked: 48 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: 80
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, C4
Has thanked: 23 times
Been thanked: 48 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: 249
Joined: Wed Jan 15, 2014 2:58 am
languages_spoken: english,slovak
Has thanked: 1 time
Been thanked: 17 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: 80
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, C4
Has thanked: 23 times
Been thanked: 48 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: 7
Joined: Mon May 27, 2019 5:39 pm
languages_spoken: english
ODROIDs: c2, N2
Has thanked: 1 time
Been thanked: 6 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 2):
odroid (Fri Jul 10, 2020 9:25 am) • odroidn2user (Fri Jul 10, 2020 2:46 pm)

odroidn2user
Posts: 254
Joined: Fri Oct 25, 2019 4:14 pm
languages_spoken: english
ODROIDs: N2, C4
Has thanked: 64 times
Been thanked: 67 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: 24
Joined: Fri Jun 07, 2019 4:56 pm
languages_spoken: english
Has thanked: 2 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"

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 0 guests