
Building a 64-bit aarch64 kernel and userspace for the Raspberry Pi 4 - esotericn
https://esotericnonsense.com/blog/rpi-chroot.html
======
qubex
I understand the logic behind the Raspberry Pi Foundation’s decision to
continue releasing a single Raspberrian version in 32-bit mode for
compatibility reasons, but... on the other hand, it does severely handicap
their newer hardware.

~~~
codetrotter
I think a big part of the reason is also the fact that several parts of the
userland don’t compile for aarch64.

See e.g.
[https://github.com/raspberrypi/userland/issues/314](https://github.com/raspberrypi/userland/issues/314)

One of the first comments there also say about the RPi 3:

> The GPU is a 32 bit processor. I haven't checked, but I'm expecting that
> there's a heck of a lot more work to do to get Khronos or other multimedia
> extension stuff up and running against a 64bit kernel than just getting
> userland to build.

Don’t know if that’s the case for the RPi 4 as well.

And another comment too:

> I'm sure there are certain applications where having a 64-bit kernel (let
> alone userland) may be beneficial, but I suspect the hoped-for performance
> improvements didn't materialise, otherwise people would be waving benchmark
> results at us demanding an RPi-supported aarch64 kernel.

I’m missing this too, and am planning on eventually doing some benchmarking of
my own to see if there is any advantage of running the aarch64 kernel for my
applications.

~~~
Vogtinator
The GPU has nothing to do with what the OS on the CPU is doing - it's an
entirely separate architecture anyway (VideoCore 6 on RPi4).

The reason their /opt/vc stuff doesn't support 64bit is because there are
proprietary binaries directly from Broadcom. Also, they use interfaces
provided only by the downstream RPi kernel.

There is a blog post from the RPi foundation about support for VC6 in Mesa.

~~~
the-dude
What do you exactly mean by "/opt/vc" stuff? OpenGL?

Because I am decoding, encoding and rendering 1080p H264 with the VC on a
64-bit kernel.

~~~
jackalo
Things like vcgencmd that allow you to read and write values to the GPU OS
that actually controls the physical hardware.

------
Vogtinator
For openSUSE there's an aarch64 image as well:
[https://en.opensuse.org/HCL:Raspberry_Pi4](https://en.opensuse.org/HCL:Raspberry_Pi4)

It uses mainline Linux, so no USB 3 (only USB 2 OTG/Gadget/Host on USB-C), but
Ethernet is supposed to be working meanwhile.

------
Jonnax
What's the performance difference between 32 and 64 bit?

~~~
qubex
[https://m.youtube.com/watch?v=cPk1pvgK7JA](https://m.youtube.com/watch?v=cPk1pvgK7JA)

------
Abishek_Muthian
Btw, for those who are using RPi3 and want to try aarch64 kernel
-archlinux|ARM has one and I've used it in my experiments to getting smoother
desktop experience on Raspberry Pi[1].

[1]:[https://abishekmuthian.com/getting-smoother-desktop-
experien...](https://abishekmuthian.com/getting-smoother-desktop-experience-
on-raspberry-pi/)

------
boris
Slightly off-topic: is there anything that is as or more powerful than RPi4
but has more/expandable memory (say 16G or more) and still works with mainline
kernel/distributions? In other words, something that I could setup as a build
machine for CI?

~~~
wmf
[https://www.solid-run.com/nxp-lx2160a-family/honeycomb-
works...](https://www.solid-run.com/nxp-lx2160a-family/honeycomb-workstation/)
?

~~~
boris
This looks promising (even at $750 for the motherboard and CPU) but it seems
to be a work in progress, specifically at the bottom of the page it says:

    
    
        Mainline Kernel – work in progress
        UBoot – work in progress
        UEFI – work in progress
    

But if anyone has any experience using this board, please share.

~~~
kick
Why not just build a CI machine? At a $750 price point, you could very easily
build a fantastic one with half an hour's worth of work.

------
bobowzki
Ubuntu also has a nice aarch64 image for raspberry pi 4.

~~~
tssva
The Ubuntu image currently doesn't support USB on the 4GB model unless you
configure the kernel to only use 3 of the 4GB.

~~~
DoofusOfDeath
Thanks for mentioning that! You probably just saved me a few wasted hours.

~~~
DoofusOfDeath
Status update on that bug: [https://www.cnx-software.com/2019/11/04/raspberry-
pi-4-4gb-m...](https://www.cnx-software.com/2019/11/04/raspberry-pi-4-4gb-
models-usb-ports-dont-work-on-ubuntu-19-10/)

------
pantalaimon
Is there something like x32 for ARM?

~~~
my123
Yes, aarch64-ilp32.

It's used in production for Apple Watch Series 4 onwards among other things.

------
navigatr
Is the RPi4 mainlined in the kernel, or does the board require porting new
kernel versions?

~~~
megous
It doesn't seem it has dts file in 5.4 at all.

------
adontz
I've found buildroot much easier to use.

