13

Is there any 64-bit kernel for Raspberry Pi 3? I looked around and from sources I check official page and following kernels are listed there:

  1. NOOBS - this is installer, no OS by itself, right?
  2. Rapsbian - just one download, so I assume 32 bit compatible with all version of Pi
  3. Ubuntu MATE - aarch32 (ARMv7)
  4. Ubuntu Ubuntu Core - seems like 32bit only
  5. OSMC - same downloads for "Raspberry Pi 2 / 3", so 32 bit
  6. LibreELEC - combined build for 2&3, so 32 bit only
  7. PiNet - dunno what this is, but doubt 64 bit
  8. RISC OS - doesn't seem like linux
  9. Weather Station - yeah, just no

So it doesn't seem that there is official 64bit kernel available? Is there any unofficial one? Can I just compile one and expect it to work (I guess not but doesn't hurt to ask..)? Does anyone at least work on it? I would love to have access to native 64-bit numbers.

On other note, how big difference is between armv7 and armv8? Gentoo offers stage 3 tarballs for armv7. Will that work on Pi 3 which is armv8?

techraf
  • 4,319
  • 10
  • 31
  • 42
graywolf
  • 265
  • 1
  • 2
  • 8
  • "Gentoo offers stage 3 tarballs for armv7. Will that work on Pi 3 which is armv8?" Again, nope, not without a lot of hacking, but because the pi kernel is not stock, not because ARMv7 doesn't work on ARMv8 (currently the Pi 2 and 3 use the same kernel). – goldilocks Jun 07 '16 at 14:58
  • 1
    The gentoo guide goes on with compiling Pi kernel source code from github, so I would assume they account for this. I was just interested if I can use the ARMv7 version on ARMv8 board, seems that yes – graywolf Jun 07 '16 at 15:06

7 Answers7

11

The general conensus is that a 64bit kernel will not increase performance on the Pi, since the only 2 real benefits of a 64bit kernel are:

  1. larger int values, which you can specify manually in a 32bit kernel anyways
  2. the possibility of having more than 4 Gb of RAM, which is useless on the Pi as the RAM is built-in and non-expandable.

In addition, 64bit vs 32bit on ARM chips isn't the big performance leap that it was on x86 chips, because the x86 chips had significant architecture upgrades when they went to 64bit, whereas the ARM chips were already pretty solid in 32bit versions.

Feel free to experiment though! :)

tlhIngan
  • 3,372
  • 5
  • 19
  • 33
9

One benefit of 64 bit everyone appears to forget is ARMv8 has a significantly more registers than ARMv7 It has much better floating point performance too.

It's not just an add-on to ARMv7, it's a whole new architecture.

Chris
  • 101
  • 1
  • 3
8

From what little I have found there is nothing stable and official. Some have gotten one to compile, but then there is issues with drivers/modules.

These links may interest you regarding this topic.

Entering aarch64 execution state

Raspbian Jessie (64bit) for RPi3?

techraf
  • 4,319
  • 10
  • 31
  • 42
Dan V
  • 428
  • 2
  • 8
  • +1. Would really love to experiment with a 64-bit OS. I might try to patch up and compile a very lightweight OS for the Pi (lightweight to make things easier) – Aloha Jun 09 '16 at 16:08
  • @PandaLion98 I would be very interested in this – Dan V Jun 09 '16 at 19:40
6

OpenSUSE released its 64-bit Raspberry Pi image.

https://en.opensuse.org/HCL:Raspberry_Pi3

zhiyisun
  • 71
  • 1
  • 1
5

I have found some significant performance gains of 64 bit compilations vs 32 bit on running my Android benchmarks on a tablet using a 1.3 GHz ARM Cortex-A53. The latest are compiled via Eclipse and, at run time, detect whether the CPU is ARM, Intel or MIPS, then 32 bit or 64 bit architecture.

On previous Windows compilations for Intel CPUs, 64 bit working could be much faster than 32 bit due to using SSE type SIMD instructions. However, the later 32 bit compiler, with backward incompatibility, produces virtually the same code and similar speed.

Details of the Android benchmarks are in the following, showing 32 bit and 64 bit results from the A53 and via a 1.2 GHz Cortex-A9. At the end are some assembly code listings that identify different instructions being used. Below is a summary of results.

http://www.roylongbottom.org.uk/android%2064%20bit%20benchmarks.htm#anchorStart

Whetstone Benchmark - (tiny loops) similar performance, with overall rating influenced by compilation of test using EXP functions.

Dhrystone Benchmark - latest MIPS/MHz 1.09 32 bit, 1.96 64 bit, 1.10 A9 - maybe 64 bit over optimised.

Linpack Benchmark - (N=100) 64 bit DP 1.97 x faster, SP 2.67 x - see assembly code.

Livermore Loops - (24 kernels) average 1.5 times faster, range 0.8 to 7.9 times

L1/L2 Cache and RAM Tests

MemSpeed - float and integer calculations - gains caches 2.2 x, RAM 1.5 x.

BusSpeed - integer data streaming and burst reading - streaming 2.0 x L1, 1.5 x L2, 1.25 x RAM - bursts 2.6 x L1, similar L2 and RAM.

RandMem - serial and random read and read/write from same complex indexing structure - generally a little faster on reading but similar/slower read/write.

Then there are MP versions of the above and attempts to measure maximum SP MFLOPS (MP-MFLOPS) with 4 core maximum of 2.7 GFLOPS 32 bit and 5.5 GFLOPS 64 bit. There is also a version using NEON intrinsics where the 64 bit compiler generates alternative instructions at up to 10.8 GFLOPS vs 5.7 at 32 bits - see assembly listing. I also have versions of these benchmarks for Windows 10 and Android Intel Atom based tablets - 64 bit and 32 bit Windows, 32 bit Android - full 64 bit not fully implemented - 64 bit Linux kernel but 32 bit Android.

http://www.roylongbottom.org.uk/android%20benchmarks.htm

Plus, I have 32 bit and 64 bit Linux/Intel versions.

Roy Longbottom

4

Here is how I compile RPI3 Aarch64 kernel:

First, you'll need Linaro aarch64: https://releases.linaro.org/components/toolchain/binaries/latest/aarch64-linux-gnu/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu.tar.xz

Decompress, put it somewhere, example: /opt/toolchains/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu

Here is my script to download firmware, VC, kernel source and compile kernel with modules, I use this script for my Jenkins server so picks what you need:

git clone https://github.com/raspberrypi/linux.git -b rpi-4.8.y --depth=1
cd linux
export CROSS_COMPILE=/opt/toolchains/gcc-linaro-6.2.1-2016.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export ARCH=arm64
export INSTALL_MOD_PATH=MODULES/
export KERNEL=kernel8

rm -rf BOOT
rm -rf MODULES
rm -rf rpi-proprietary/

mkdir -p BOOT/overlays
mkdir MODULES

git clone https://github.com/Hexxeh/rpi-firmware.git --depth=1 rpi-proprietary/

cp ./rpi-proprietary/COPYING.linux ./BOOT/
cp ./rpi-proprietary/LICENCE.broadcom ./BOOT/
cp ./rpi-proprietary/bootcode.bin ./BOOT/
cp ./rpi-proprietary/fixup.dat ./BOOT/
cp ./rpi-proprietary/fixup_cd.dat ./BOOT/
cp ./rpi-proprietary/fixup_db.dat ./BOOT/
cp ./rpi-proprietary/fixup_x.dat ./BOOT/
cp ./rpi-proprietary/start.elf ./BOOT/
cp ./rpi-proprietary/start_cd.elf ./BOOT/
cp ./rpi-proprietary/start_db.elf ./BOOT/
cp ./rpi-proprietary/start_x.elf ./BOOT/

cd ./rpi-proprietary/vc/hardfp/opt/

tar -cvzf VC.tar.gz vc/

cd ../../../../
mv ./rpi-proprietary/vc/hardfp/opt/VC.tar.gz ./
rm -rf rpi-proprietary/

make bcmrpi3_defconfig
make modules
make module_install
make -j10

rm -rf MODULES/lib/modules/*v8*/build MODULES/lib/modules/*v8*/source

cp ./arch/arm64/boot/Image ./BOOT/kernel8.img
cp ./arch/arm64/boot/dts/broadcom/*.dtb ./BOOT/
cp ./arch/arm64/boot/dts/overlays/*.dtbo ./BOOT/overlays/
cp ./arch/arm64/boot/dts/overlays/README ./BOOT/overlays/

tar -cvzf MODULES.tar.gz MODULES/
tar -cvzf BOOT.tar.gz BOOT/

make mrproper

Now just untar the BOOT.tar.gz and put it to your sdcard.

IMPORTANT: You must put arm_control=0x200 to config.txt for it to boot AARCH64 kernel

minhng99
  • 310
  • 1
  • 9
4

As of today, it seems Fedora and Archlinux are well supported.

If you go the Arch way, this will help you build the image (for me on linux / rpi3 it was make linux) and this will help you start wifi.

In case you need to be sure which raspberry you have, use this guide.

Also arm_control=0x200 is deprecated and arm_64bit should be used instead in /boot/config.txt.