Yasuhiko Koumoto
Posts: 2
Joined: Tue Mar 01, 2016 11:32 pm

AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 12:29 am

Hello everybody,
does everyone know whether Raspberry Pi3 can execute 64bit applications?
Even reading some articles, I am uncertain the following things.
Please let me know the answers.
1. Is Raspbian for Raspberry Pi3 compiled by AArch64 architecture?
2. Does the compiler of Raspbian for Raspberry Pi3 generate AArch64 codes?
3. Otherwise, can only AArch32 codes be executable on Raspbian for Raspberry Pi3?
Thank you in advance and best regards,
Yasuhiko Koumoto.

Heater
Posts: 9707
Joined: Tue Jul 17, 2012 3:02 pm

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 4:00 am

The Raspbian OS is 32 bit. It has been said here that a 64 bit version may be provided in the future if it proves to be worthwhile.

Your question reminds me though that a Debian OS can support more than one architecture at a time. Google "multiarch". For example one can install and run Intel 32 bit packages on a an Intel 64 bit OS.

So, why not 64 bit ARM packages of a 32 bit ARM OS installation ?

Yasuhiko Koumoto
Posts: 2
Joined: Tue Mar 01, 2016 11:32 pm

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 4:19 am

Hi Heater,
Thank you for the reply.
Then, I would like to know whether we can install 64 bit OS on Raspberry Pi3?
What are candidates of such OSes?

Heater
Posts: 9707
Joined: Tue Jul 17, 2012 3:02 pm

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 4:37 am

I don't think their are any 64 bit candidates at the moment. As I said the Raspbian guys have said they will investigate it.

Is there any particular urgency for this? As far as I can tell any speed gains of moving to 64 bits are not spectacular. We do only have 1GB RAM. 64 bit code will be bigger.

I'm hoping for a 64 bit OS too, just because its a 64 bit machine and it's natural, but I don't see any huge performance gains coming like we saw when moving from 16 bit Intel 286 to the 32 bit 386.

User avatar
jbeale
Posts: 3360
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 4:48 am

If you want to do image processing, can gain advantage by doing some byte or short word operations in parallel packed as 64 bit word ? This is a question, I don't know.

Heater
Posts: 9707
Joined: Tue Jul 17, 2012 3:02 pm

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 4:56 am

The ARM has the NEON 128 bit SIMD engine for signal processing and multimedia work: http://www.arm.com/products/processors/ ... s/neon.php

Of course your code, codecs etc, has to be written specially to use NEON.

User avatar
bitbank
Posts: 248
Joined: Sat Nov 07, 2015 8:01 am
Location: Sarasota, Florida
Contact: Website

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 6:46 am

I too would like to see Aarch64 running on the Pi3, but after reading what the Pi organization said, the chances seem slim.

One reasonably priced alternative is the Dragonboard 410c from Arrow Electronics. I got one for $75 and it runs Linaro's 64-bit Linux. It's not quite as functional as advertised (e.g. it says it includes GPS, but doesn't have a dedicated chip and it doesn't work in Linux). It's the same basic specs as the Pi3, but with slightly different I/O pins/ports.
The fastest code is none at all :)

java
Posts: 226
Joined: Mon Jul 21, 2014 9:41 am

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 8:12 am

The only place you would have an advantage from 64 bit code, would be in video procesesing, but only if you had 4 or more gigabytes of RAM, so best option would be to utilise the NEON extension that is available and as far as I can tell under utilised.

Heater
Posts: 9707
Joined: Tue Jul 17, 2012 3:02 pm

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 9:15 am

I would be very sad not to see a 64 bit OS for the Pi 3. The thought of all those bits going to waste is just awful.

Might be time to be come reacquainted with Linux From Scratch:
http://www.linuxfromscratch.org/lfs/
http://www.intestinate.com/pilfs/

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2810
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 9:30 am

Here's the official word on 64 bit from Eben on launch day...

https://youtu.be/Mh4rg_Opqpk?t=34m28s
Alex Eames RasPi.TV, RasP.iO

ghans
Posts: 7785
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 12:31 pm

I don't see the problem. If i needed to run a 64bit ARM
distro , i know where to get them. Getting it to
run on the Pi would up to me. Why do i need to wait
for official foundation-approved Raspbian images to come
out ? Even raspbian.org used to supply their own images.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

lb
Posts: 232
Joined: Sat Jan 28, 2012 8:07 pm

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 12:36 pm

ghans wrote:I don't see the problem. If i needed to run an 64bit ARM
distro , i know where to get them. Getting it to
run on the Pi would up to me. Why do i need to wait
for official Raspbian images to come out ?
It's unfortunately not that easy. The kernel needs some work to be able to boot in AArch64 mode on the Pi 3, the firmware may need some changes, and some APIs to communicate between firmware and Linux are tailored for 32 bit, too.
After these things have been addressed, you can use whatever AArch64 userland that you want, but it's not possible right now.

dickon
Posts: 229
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: AArch64 code execution on Raspberry Pi3.

Wed Mar 02, 2016 6:12 pm

Yes, as I've noticed, simply compiling the Foundation's kernel with an aarch64 compiler doesn't work.

Pity, if not unexpected.

fsck
Posts: 26
Joined: Mon Feb 23, 2015 4:49 pm

Re: AArch64 code execution on Raspberry Pi3.

Fri Mar 04, 2016 1:07 am

lb wrote:It's unfortunately not that easy. The kernel needs some work to be able to boot in AArch64 mode on the Pi 3, the firmware may need some changes, and some APIs to communicate between firmware and Linux are tailored for 32 bit, too.
After these things have been addressed, you can use whatever AArch64 userland that you want, but it's not possible right now.
Is anyone working on it? There's tons of people who would love to use the system to the full extent, like advertised. Not everyone uses Raspbian...
I take it this is something you need the non-public sources for to implement, correct?

fanoush
Posts: 336
Joined: Mon Feb 27, 2012 2:37 pm

Re: AArch64 code execution on Raspberry Pi3.

Fri Mar 04, 2016 6:57 am

fsck wrote: I take it this is something you need the non-public sources for to implement, correct?
Most probably no. The linux kernel sources are at https://github.com/raspberrypi/linux/ anyone can port it to 64bit. As far as the communication with the firmware is done in same way (which should be possible) there is no need to change the firmware. Or if some slight changes are needed then it is like 0.1% of the work.

ghans
Posts: 7785
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: AArch64 code execution on Raspberry Pi3.

Fri Mar 04, 2016 9:38 am

Is this of any use ?

viewtopic.php?f=72&t=137963#p915771

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20269
Joined: Sat Jul 30, 2011 7:41 pm

Re: AArch64 code execution on Raspberry Pi3.

Fri Mar 04, 2016 9:56 am

fsck wrote:
lb wrote:It's unfortunately not that easy. The kernel needs some work to be able to boot in AArch64 mode on the Pi 3, the firmware may need some changes, and some APIs to communicate between firmware and Linux are tailored for 32 bit, too.
After these things have been addressed, you can use whatever AArch64 userland that you want, but it's not possible right now.
Is anyone working on it? There's tons of people who would love to use the system to the full extent, like advertised. Not everyone uses Raspbian...
I take it this is something you need the non-public sources for to implement, correct?
I'm pretty sure, as advertised, the Pi3 does actually have a 64 bit SoC.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

fsck
Posts: 26
Joined: Mon Feb 23, 2015 4:49 pm

Re: AArch64 code execution on Raspberry Pi3.

Fri Mar 04, 2016 12:38 pm

jamesh wrote:I'm pretty sure, as advertised, the Pi3 does actually have a 64 bit SoC.
Would be nice to have the means to use it as such, too.

GregAC
Posts: 10
Joined: Sun Aug 17, 2014 9:48 pm

Re: AArch64 code execution on Raspberry Pi3.

Fri Mar 04, 2016 1:48 pm

Some relevent discussion here: https://github.com/raspberrypi/firmware/issues/550

Major problem stems from the fact that the VideoCore side of things is still firmly 32-bit. Not an insurmountable obstacle but (from skimming the thread) will need some cunning tricks to make certain 64-bit kernel pointer looks like 32-bit points. Probably easier to deal with if you can redo the blob as well (i.e. RPF would have an easier time of it than the community alone).

It's important to realise that the A53 is a upgraded in capability/speed even without AArch64. There are plenty of reasons to want the A53 over the A7. Benefits for choosing AArch64 over AArch32 are less obvious.

User avatar
bitbank
Posts: 248
Joined: Sat Nov 07, 2015 8:01 am
Location: Sarasota, Florida
Contact: Website

Re: AArch64 code execution on Raspberry Pi3.

Mon Mar 14, 2016 6:53 am

java wrote:The only place you would have an advantage from 64 bit code, would be in video procesesing, but only if you had 4 or more gigabytes of RAM, so best option would be to utilise the NEON extension that is available and as far as I can tell under utilised.
Please stop repeating this incorrect information about 4GB of RAM. The ability to access 64-bit addresses is actually one of the less interesting parts of going 64-bit and not a requirement of accessing the benefits. The real benefits of Aarch64 code are: an improved instruction set, twice as many general purpose (and NEON 128-bit) registers, improved pipelining due to removal of conditional execution and a few others I'm probably forgetting.

The single most interesting benefit of going 64-bit for the Raspberry Pi community is the dramatically improved C/C++ compiler output. I finally got my hands on a Raspberry Pi3 and tested it against a DragonBoard410c running 64-bit Linux. They both have the same 1.2Ghz ARM Cortex-A53 processors. I did some testing of floating point code (25 different functions) that fits in the cache (to rule out differences in memory sub-systems). For my optimized NEON code (intrinsics for portability), running in 64-bit mode gained 0-25% depending on the complexity of the code. They should all have been close to 0%, but the 32-bit version GCC 4.9 doesn't always turn NEON intrinsics into good code; it didn't always do well with instruction scheduling. The real mind blowing part was the straight C code performance. In some cases, the 64-bit version performed 3x faster than the 32-bit version. The compiler has more registers to work with and does a better job keeping all local variables in registers. I assume most people are not like me (I always write ASM/intrinsic code for time-critical functions) and would benefit greatly from the C/C++ compiler generating dramatically faster code. This would speed up the Linux kernel, all apps and interpreted languages (e.g. Python) as well since they depend on compiled code somewhere underneath.
The fastest code is none at all :)

dickon
Posts: 229
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: AArch64 code execution on Raspberry Pi3.

Mon Mar 14, 2016 9:01 am

bitbank wrote:The ability to access 64-bit addresses is actually one of the less interesting parts of going 64-bit
Well, from my point of view, the 64-bit address space is one of the more useful features a 64-bit processor delivers over 32-bit CPUs for normal users writing normal code: you can deal with multi-GB files via mmap(2), rather than the traditional read(2) / write(2) calls with all the buffer management that implies. Spot on with the rest of your comments, though.

madscientist42
Posts: 3
Joined: Tue Mar 15, 2016 7:54 pm

Re: AArch64 code execution on Raspberry Pi3.

Tue Mar 15, 2016 8:02 pm

I'd think a 30->300% boost of execution speed over the already impressive performance in the domains we're seeing with just ARMv7 execution would be compelling over the RAM capacity. Contrary to most's impressions, 64-bits only typically burns 10% or less extra footprint on store and in execution, but offers in many of the cases a decent to massive jump in speed. It's not all about address space, after all.

Heater
Posts: 9707
Joined: Tue Jul 17, 2012 3:02 pm

Re: AArch64 code execution on Raspberry Pi3.

Tue Mar 15, 2016 8:31 pm

madscientist42,

...offers in many of the cases a decent to massive jump in speed.

Do you have any evidence to back that up ?

For example moving from a 32 bit Debian installation to a 64 bit on my four core Intel PC makes no appreciable difference in performance.

I could imagine that a 64 bit build of Raspbian on the Pi has a similar unoticable effect.

Who knows till it's done?

Some software though expects a 64 bit address space. Databases for example. Or the Go language, whose garbage collector had difficulty on 32 bit machines, not sure if they ever fixed that.

User avatar
_emanuel_
Posts: 17
Joined: Wed Apr 01, 2015 9:47 pm
Location: bavaria
Contact: Website

Re: AArch64 code execution on Raspberry Pi3.

Tue Mar 15, 2016 9:00 pm


clivem
Posts: 79
Joined: Sun Aug 03, 2014 11:18 am

Re: AArch64 code execution on Raspberry Pi3.

Tue Mar 15, 2016 9:08 pm

bitbank wrote: I finally got my hands on a Raspberry Pi3 and tested it against a DragonBoard410c running 64-bit Linux. .....
For my optimized NEON code (intrinsics for portability), running in 64-bit mode gained 0-25% depending on the complexity of the code.
Yep, I did some very similar testing with Dragonboard vs Pi3B. I'm seeing 25-40% boost on my "transcoding" NEON code, with 64 bit NEON optimisation.

(The only downside from my point of view, is the increased size of the 64bit binaries.)

Return to “General discussion”

Who is online

Users browsing this forum: Baidu [Spider] and 36 guests