Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Raspberry Pi4 with 64 Bit Gentoo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55043
Location: 56N 3W

PostPosted: Sat Jul 06, 2019 9:34 am    Post subject: Raspberry Pi4 with 64 Bit Gentoo Reply with quote

Team,

Gentoo on Raspberry Pi 4 in 64 bit mode is beginning to work.
Its working better every day.

The Pi 3 64 bit userland works.
The install is putting a Pi 4 /boot under an arm64 userland, such as the arm64 stage 3 and adding the Pi 4 /lib/modules/'uname -r' to the userland.

There is a brief guide on the wiki.
Be warned that it will be a while before everything works with more that a 1G RAM memory space, so users with 2G or 4G devices can only use the bottom 1G.

As the acknowledgements in the link say, its not my work. I've only tried to document it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
crocket
Guru
Guru


Joined: 29 Apr 2017
Posts: 558

PostPosted: Sun Jul 07, 2019 3:24 am    Post subject: Reply with quote

Does raspberry pi kernel have yet to support 4GB RAM?
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Sun Jul 07, 2019 4:53 am    Post subject: Reply with quote

I'm curious how long it takes to compile the kernel, first time (clean) on the pi itself?

Back when I did a pi b+ it was about 10 hours, maybe a little more.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55043
Location: 56N 3W

PostPosted: Sun Jul 07, 2019 9:11 pm    Post subject: Reply with quote

crocket,

Only in 32 bit mode. At least, Raspbian looked like it could use all 4G and the mem_limit option is missing from the Raspbian config.txt.
Raspbian is 32 bit only.

I can confirm that a 64 bit build of the Pi Foundation kernel will not boot without mem_limit=1024.
Well I only tried 1G and 4G. Maybe there is a bug like the x86 himem bug, that allowed intel processors in 16 bit mode to address over 1M of RAM.
The problem is that the PI is a 32 bit VC4 with a 64 bit ARM CPU grafted on the side. All of the IO belongs to the 32 bit VC4.

1clue,
A 32 bit kernel or a 64 bit kernel?
Why would anyone build a kernel on the Pi, as its one of the most cross compile friendly packages out there.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Mon Jul 08, 2019 2:31 am    Post subject: Reply with quote

NeddySeagoon wrote:

1clue,
A 32 bit kernel or a 64 bit kernel?
Why would anyone build a kernel on the Pi, as its one of the most cross compile friendly packages out there.


64-bit.


  1. Because they can.
  2. Because it's the most common package on any Linux system
  3. Because it can be used as a standard benchmark.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55043
Location: 56N 3W

PostPosted: Mon Jul 08, 2019 9:24 am    Post subject: Reply with quote

1clue,

OK ... I'll time it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
erm67
l33t
l33t


Joined: 01 Nov 2005
Posts: 653
Location: EU

PostPosted: Mon Jul 08, 2019 10:59 am    Post subject: Reply with quote

NeddySeagoon wrote:
1clue,

OK ... I'll time it.

possibly on good usb3 disk, otherwise you'll just time the sd card and everybody knows it sucks ...
_________________
Ok boomer
True ignorance is not the absence of knowledge, but the refusal to acquire it.
Ab esse ad posse valet, a posse ad esse non valet consequentia

My fediverse account: @erm67@erm67.dynu.net
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55043
Location: 56N 3W

PostPosted: Mon Jul 08, 2019 11:31 am    Post subject: Reply with quote

Raspberry Pi 4 Kernel Building Time.

The Hardware.
A Raspberry Pi 4 in 64 bit mode. Memory constrained to 1GB meanwhile.
A SATA3 SSD on the end of USB3.
Unfortunately, my USB3 to SATA cable does not support UAS, so there is no trim/discard. UAS is on in the running kernel.
A passive heatsink Its clamped with a cable tie now that the GPIO cable has gone.
The running kernel uses the 'On Demand' CPU governor. The CPU may still go into thermal throttling, the thermal readout doesn't work yet.
There is no GUI running. The tests were done over ssh.

The test process, using the 4.19.y branch
Code:
git clone https://github.com/raspberrypi/linux pi_sources
cd pi_sources
time make mrproper
time make bcm2711_defconfig
time make -j4


The interesting bit
Code:
real   59m13.332s
user   209m8.610s
sys   24m54.524s


I'll do a
Code:
time make mrproper
time make bcm2711_defconfig
time make -j2

was slower
Code:
real   88m52.294s
user   165m11.563s
sys   19m26.114s


Now to try a different USB3 to SATA cable. That didn't help, They are both different chips and both blacklisted by the kernel.
fstrimming all the filesystems on the SSD, then doing
Code:
time make mrproper
time make bcm2711_defconfig
time make -j4
again gives
Code:
real   58m59.455s
user   208m42.014s
sys   24m27.558s
so the drive write speed was never an issue.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.


Last edited by NeddySeagoon on Mon Jul 08, 2019 6:50 pm; edited 2 times in total
Back to top
View user's profile Send private message
crocket
Guru
Guru


Joined: 29 Apr 2017
Posts: 558

PostPosted: Mon Jul 08, 2019 1:13 pm    Post subject: Reply with quote

* vcgencmd cannot be compiled as a 64bit executable. Can anyone compile 32bit executables on ARM64?
* Raspberry pi kernel doesn't support UAS. dwc_otg doesn't support scatter-gather transfers was closed. Scatter-gather is required for UAS. Without UAS, there is no TRIM.
Quote:
UAS is now re-enabled because it adds a bunch of quirks for newer usb-storage devices. The module is loaded but as there's no SG support, UAS devices are accessed as mass-storage class devices.

* I would consider Rock Pi 4 for proper SSD support. You can buy Rock Pi 4 with a large heatsink and an M.2 extension board. Welcome to the future.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55043
Location: 56N 3W

PostPosted: Mon Jul 08, 2019 1:48 pm    Post subject: Reply with quote

crocket,

You should be able to run 32 bit userland on top of a 64 bit bit kernel on the Pi.
dwc_otg is still there in the Pi 4 but its not used for USB3.
The OTG part is provided in the USB-C power port, so if you can power the Pi 4 and get at the USB 2 only OTG, you can play with USB OTH on the Pi 4.

UAS is off in bcm2711_defconfig, There are two different bcm2711_defconfig files in the kernel. One for 64 bit and one for 32 bit.
Take care applying most internet advice to the Pi. Unless it specifically says its for 64 bit mode, its 32 bit.
It may or may not be 32 bit bit only.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Tue Jul 09, 2019 12:42 am    Post subject: Reply with quote

Interesting.

This kind of suggests that a pi4, especially when it gets more stable, is a reasonable Gentoo platform, at least for a minimalist system. If this test alone were enough to form an opinion, then a pi4 is 10x as fast as a B+.

Just for the record, a B+ running Gentoo spends all its time running updates, for a very minimal install. Assuming you want to keep up, it actually takes longer to compile the updates than the time between updates.

Thanks, NeddySeagoon!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55043
Location: 56N 3W

PostPosted: Tue Jul 09, 2019 10:10 am    Post subject: Reply with quote

1clue,

I used a 256MB B+ to host a mirror of kernel-seeds.org. It seemed to do that OK but my uplink would have been the bottleneck.
Since to 2012 launch of the original B+, the kernel has got a lot bigger.

That particular B+ now runs my GPS based ntp server.

I do have a 512MB B+ still, so if it was important, I can run the test.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
1clue
Advocate
Advocate


Joined: 05 Feb 2006
Posts: 2569

PostPosted: Tue Jul 09, 2019 6:03 pm    Post subject: Reply with quote

Neddy,

Not important. I actually didn't expect anyone to do all this to satisfy my curiosity, I only asked in case anyone else was also curious.

I did the compile on my B+ and got 10+ hours for the first compile. So even though the kernel is significantly different now, I know that the pi4 could make a tolerable standalone Gentoo box. It's all I wanted to know.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55043
Location: 56N 3W

PostPosted: Tue Jul 09, 2019 9:13 pm    Post subject: Reply with quote

1clue,

I was curious too. Its the first kernel build I ever did on a Pi.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
crocket
Guru
Guru


Joined: 29 Apr 2017
Posts: 558

PostPosted: Tue Jul 09, 2019 10:55 pm    Post subject: Reply with quote

To use pi 4 as a standalone gentoo machine, you want

  • a large heatsink
  • 4GB RAM
  • a hard disk or an SSD or a network storage
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20590

PostPosted: Wed Jul 10, 2019 4:36 am    Post subject: Reply with quote

Thought I'd pass this along...

Raspberry Pi admits to faulty USB-C design on the Pi 4
"I expect this will be fixed in a future board revision," says co-creator.

_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
EliasJonsson
n00b
n00b


Joined: 18 Oct 2017
Posts: 53

PostPosted: Wed Jul 10, 2019 3:32 pm    Post subject: Re: Raspberry Pi4 with 64 Bit Gentoo Reply with quote

NeddySeagoon wrote:
Team,
Be warned that it will be a while before everything works with more that a 1G RAM memory space, so users with 2G or 4G devices can only use the bottom 1G.

Thanks for sharing this with us. Can't wait untill the full 4G is supported so that I finally can get started using my RPi 4B 4 GB as my main desktop computer.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20590

PostPosted: Wed Jul 10, 2019 7:16 pm    Post subject: Reply with quote

Split off erm67's comment to Off The Wall as it was not appropriate elsewhere.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
ozbird
Apprentice
Apprentice


Joined: 21 Oct 2003
Posts: 187

PostPosted: Fri Jul 12, 2019 7:30 pm    Post subject: Re: Raspberry Pi4 with 64 Bit Gentoo Reply with quote

NeddySeagoon wrote:
Team,

Gentoo on Raspberry Pi 4 in 64 bit mode is beginning to work.
Its working better every day.


Thanks for your work on the 64-bit Pi 4 build, Neddy. *thumbs up*
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum