Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM support #2546

Closed
penta314 opened this issue May 9, 2019 · 34 comments
Closed

Add ARM support #2546

penta314 opened this issue May 9, 2019 · 34 comments
Labels
CI Continuous integration related items Enhancement New feature or request Help Wanted Extra attention is needed

Comments

@penta314
Copy link

penta314 commented May 9, 2019

It has been found that the binaries are not built for ARM, hence people trying to run a node in for example Rasberry Pi 3 are getting crashes.

@prestonvanloon prestonvanloon added CI Continuous integration related items Enhancement New feature or request labels May 10, 2019
@prestonvanloon
Copy link
Member

This requires build docker images/binaries with --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64.

The validator client builds for ARM, but not the beacon-chain due to some cgo dependencies in go-ethereum.

@prestonvanloon
Copy link
Member

I made a brief attempt at trying to cross compile for ARM, but running into weird issues with cgo.
Commit ea790c5

@diglos
Copy link

diglos commented May 13, 2019

Hi,
It fails compiling directly on ARM64 as well, see attached log.
beacon-chain-build-arm64.txt

@prestonvanloon
Copy link
Member

The binaries should build on ARM as of e71e91c, but we don't officially support ARM binaries at this time.

@diglos
Copy link

diglos commented Jun 4, 2019

Hi,
yes, it compiles fine on ARM64, thanks for noticing. I will be doing some testing with this.
Regards!

@SoySauceFor3
Copy link

@diglos Hi,
I am trying to use this on raspberry pi, and on the way figuring out how to compile this repo from the source. Can you give me some guidance? thanks!

@diglos
Copy link

diglos commented Jun 18, 2019

Hi Xinya,
the tricky part is compile bazel for ARM. This is possible on a ARM64 board with 4GB RAM but I don't know if the Raspberry pi can do this. You may try this guide (section 3):
https://github.com/samjabrahams/tensorflow-on-raspberry-pi/blob/master/GUIDE.md
and, once you have the bazel binary, follow this page instructions to build the prysm validator and beacon chain.

@SoySauceFor3
Copy link

I will try this, thanks!

@prestonvanloon
Copy link
Member

prestonvanloon commented Jun 19, 2019

@jbriquet
Copy link

Here are the notes I have taken when compiling bazel for an ARM64 (4 cores A53, 2GB RAM).

Add repository to find openjdk-8 source
sudo add-apt-repository ppa:webupd8team/java

Install JDK8 and dependencies
sudo apt-get install build-essential openjdk-8-jdk python zip unzip

Download Bazel

wget https://github.com/bazelbuild/bazel/releases/download/0.25.3/bazel-0.25.3-dist.zip
unzip bazel-0.25.3-dist.zip -d bazel-0.25.3-dist

Install Bazel on targeted device
cd bazel-0.25.3-dist
export BAZEL_JAVAC_OPTS="-J-Xmx1g -J-Xms200m" \
export EXTRA_BAZEL_ARGS="--host_javabase=@local_jdk//:jdk"  \
./compile.sh


# Successful compilation on ARM64 - 2cores, 4GB

INFO: Elapsed time: 1449.174s, Critical Path: 139.99s
INFO: 1777 processes: 1538 local, 239 worker.
INFO: Build completed successfully, 1824 total actions

@prestonvanloon
Copy link
Member

Thanks @jbriquet! My last comment is referring to cross complation. We’d love to build ARM64 binaries for you without unreasonable build environment, but I am glad to see that you were able to build one after 1450s(!!!).

ARM builds will soon be a priority for us and we’ll be providing regular ARM binaries for tagged releases soon :)

@diglos
Copy link

diglos commented Jun 19, 2019

Great news!
I'm releasing beacon-chain and validator binaries in the next Ethereum on ARM release for NanoPC-T4 and RockPro64. So far, they work quite well :-)

@rauljordan
Copy link
Contributor

This is resolved by #2970

@prestonvanloon
Copy link
Member

prestonvanloon commented Jul 24, 2019

Verifying that building on linux amd64 for arm64 works!

bazel build //beacon-chain //validator --platforms=@io_bazel_rules_go//go/toolchain:linux_arm64

@prestonvanloon prestonvanloon reopened this Oct 3, 2019
@prestonvanloon
Copy link
Member

Recent BLS PR has broken ARM builds #3670. Reopening this issue for tracking.

@diglos
Copy link

diglos commented Nov 19, 2019

Hi,
I just ran into this issue trying to compile Prysm for the Raspberry Pi 4. Thanks for reopening this.

@diglos
Copy link

diglos commented Nov 29, 2019

Hi,
Any ETA to fix this?
Thanks!

@nisdas
Copy link
Member

nisdas commented Dec 5, 2019

hey @diglos, with #4181 merged in, we have ARM support added in

@diglos
Copy link

diglos commented Dec 5, 2019

Hi,
Thanks @nisdas.
It compiles on ARM64 (NanoPC-T4) but fails on ARM32 (Raspberry Pi 4) for both, beacon chain and validator. Please check attached log.

prysm-arm7-error.txt

@nisdas
Copy link
Member

nisdas commented Dec 6, 2019

hey @diglos , thanks for testing this out. It seems like we might not be giving the correct archive for bls, I will try and see where it fails

@wikidemic
Copy link

There’s an army of RPi4 standing by to join test network.
Any progress towards successful compile yet?

@nisdas
Copy link
Member

nisdas commented Dec 19, 2019

Hey sorry currently we haven't been able to get it to work on arm32 yet, only arm64 is currently supported. I havent been able to dedicate the time to resolving this, I hope this can be done soon

@mangoleap
Copy link

I'm trying to get it to run on a NanoPC T4 (ARM 64). Installed docker and pulled the images.

When I run

docker run -v $HOME/prysm-data:/data -p 4000:4000 --name beacon-node gcr.io/prysmaticlabs/prysm/beacon-chain:latest --no-genesis-delay --datadir=/data

I get the error

standard_init_linux.go:211: exec user process caused "exec format error"

That's all, nothing else. Any idea how to proceed?

@wikidemic
Copy link

I

I'm trying to get it to run on a NanoPC T4 (ARM 64). Installed docker and pulled the images.

When I run

docker run -v $HOME/prysm-data:/data -p 4000:4000 --name beacon-node gcr.io/prysmaticlabs/prysm/beacon-chain:latest --no-genesis-delay --datadir=/data

I get the error

standard_init_linux.go:211: exec user process caused "exec format error"

That's all, nothing else. Any idea how to proceed?

@diglos seems to be on the ball here. If you don’t answer for your docker image question, suggest you look up diglox image here on github - diglos/userpatches.

I’m considering NanoPC T4 purchase from Friendly Arm this week. So I’m tracking developer responsiveness here before I pull trigger. Let us know if you make progress!

@prestonvanloon
Copy link
Member

prestonvanloon commented Dec 20, 2019

The current docker image is compiled for AMD64 so it will not work on ARM64. It's not compiled for ARM and I am not sure about any workaround.

To give you guys a sense of timeline, we most likely won't get to this until after the holiday.

We'd welcome anyone to attempt a resolution here. I have a few ideas if someone wants to attempt resolving builds for ARM64.

@prestonvanloon prestonvanloon added the Help Wanted Extra attention is needed label Dec 20, 2019
@diglos
Copy link

diglos commented Dec 20, 2019

Hi @mangoleap.

Are you running a Ethereum on ARM image?. If so, you can install it by typing (last version):

sudo apt-get update && sudo apt-get install prysm-beacon prysm-validator

@prestonvanloon, @wikidemic, it compiles fine on ARM64 (NanoPC-T4 and RockPro64) after #4181 merged. ARM7 (Raspberry Pi 4), doesn't work at the moment.

@mangoleap
Copy link

@diglos That worked, thank you!

If anyone wants to try it:

Config files are at

/etc/ethereum/prysm-beacon.conf
/etc/ethereum/prysm-validator.conf

Chain and validator can be started with

sudo systemctl start prysm-beacon
sudo systemctl start prysm-validator

Auto start up on boot can be enabled with

sudo systemctl enable prysm-beacon.service
sudo systemctl enable prysm-validator.service

Real time output from both services can be watched with

sudo journalctl -u prysm-beacon -f
sudo journalctl -u prysm-validator -f

@rauljordan
Copy link
Contributor

Done by @SuburbanDad and included in our https://docs.prylabs.network

@jgresham
Copy link

jgresham commented Mar 6, 2020

Link to install docs: https://docs.prylabs.network/docs/install/arm/

@wikidemic
Copy link

wikidemic commented Mar 8, 2020 via email

@SuburbanDad
Copy link
Contributor

SuburbanDad commented Mar 8, 2020

@wikidemic prysm has pinned to bazel 2.1.1 for now. I added an arm64 build of 2.1.1:
https://github.com/SuburbanDad/bazel/releases/tag/2.1.1-arm64

give it a whirl

@jgresham
Copy link

jgresham commented Mar 15, 2020

Edit: It appears that although the raspi4 comes with a 64 bit cpu, then default OS (Raspbian Buster) on raspi4 is 32 bit. Is there any particular 64 bit OS that you all would recommend for the raspi4?

@SuburbanDad Should the bazel binaries on your releases work on a raspi4? I having issues after running step 3 from here https://docs.prylabs.network/docs/install/arm/ so I am trying to build prysm from source.

Here is the result from trying to use your bazel binaries on raspi4:

pi@raspberrypi:~/prysm $ ./bazel --version
-bash: ./bazel: cannot execute binary file: Exec format error
pi@raspberrypi:~/prysm $ file bazel
bazel: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=09b54219645538b60aaaf5829af803cf3fad9fd4, not stripped

Here is result from trying to run prysm on a raspi4:

pi@raspberrypi:~/prysm $ ./prysm.sh --clear-db --datadir=$HOME/prysm
pi@raspberrypi:~/prysm $ ls dist/
beacon-chain-v0.3.4-linux-armv7l  validator-v0.3.4-linux-armv7l
pi@raspberrypi:~/prysm $ ./prysm.sh beacon-chain
Latest Prysm version is v0.3.4.
Beacon chain is up to date.
Validator is up to date.
Starting Prysm beacon-chain
/home/pi/prysm/dist/beacon-chain-v0.3.4-linux-armv7l: line 1: Not: command not found

In the meantime, I am trying to build bazel 2.1.1 on a raspi4.

@SuburbanDad
Copy link
Contributor

SuburbanDad commented Mar 15, 2020 via email

@amaurer
Copy link

amaurer commented Mar 28, 2020

I found that the prysm.sh attempted download of the binaries failed from https://api.github.com/repos/prysmaticlabs/prysm/releases/latest

Line one of the binary file was "Not Found" which resulted in an error - line 1: Not: command not found

Turns out I was hitting the rate-limit imposed by github for unauthenticated requests.

{"message":"API rate limit exceeded for x.x.x.x . (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.)","documentation_url":"https://developer.github.com/v3/#rate-limiting"}

I authenticated using curl -u "username" https://api.github.com/repos/prysmaticlabs/prysm/releases/latest -o ./releases.json and edited the curl line in prysm.sh to use the json file instead. Beacon node is up and running now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous integration related items Enhancement New feature or request Help Wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests