Skip to content

Rpi4: distributing binaries with no AES for 64-bit OSes#7979

Closed
mj-xmr wants to merge 1 commit into
monero-project:masterfrom
mj-xmr:rpi-distrib-bins
Closed

Rpi4: distributing binaries with no AES for 64-bit OSes#7979
mj-xmr wants to merge 1 commit into
monero-project:masterfrom
mj-xmr:rpi-distrib-bins

Conversation

@mj-xmr

@mj-xmr mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor

Continuing the discussion and performing concrete experiments from #7953

Generating 64-bit binaries for Rpi in both depends and gitian

The gitian part could not be tested, due to miniupnp not being able to be synched. I was testing it on my branch of my project with:

GH_USER=mj-xmr
VERSION=rpi-distrib-bins
./gitian-build.py -p --url https://github.com/mj-xmr/monero-mj --setup --docker $GH_USER $VERSION
./gitian-build.py -p --url https://github.com/mj-xmr/monero-mj -j 2 --memory 10000 --docker --detach-sign --no-commit --build $GH_USER $VERSION

The full error message was:

fatal: remote error: upload-pack: not our ref 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0
fatal: The remote end hung up unexpectedly
Fetched in submodule path 'external/miniupnp', but it did not contain 544e6fcc73c5ad9af48a8985c94f0f1d742ef2e0. Direct fetching of that commit failed.
Traceback (most recent call last):
	3: from bin/gbuild:288:in `<main>'
	2: from bin/gbuild:288:in `each'
	1: from bin/gbuild:304:in `block in <main>'
bin/gbuild:23:in `system!': failed to run cd inputs/monero && git submodule update --init --recursive --force (RuntimeError)

UPDATE:

I was able to go through the above error by issuing:
git submodule sync > /dev/null && git submodule update manually from within inputs/monero

Comment thread .github/workflows/build.yml Outdated

@ArqTras ArqTras left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t that disable aes for all depends builds ?

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

Isn’t that disable aes for all depends builds ?

Yes it is, but it's far from being perfect yet, hence the "draft" status.

@ArqTras

ArqTras commented Sep 28, 2021

Copy link
Copy Markdown
Contributor

Isn’t that disable aes for all depends builds ?

Yes it is, but it's far from being perfect yet, hence the "draft" status.

Isn’t that disable aes for all depends builds ?

Yes it is, but it's far from being perfect yet, hence the "draft" status.

Mayby add something in depends section of Makefile

depends-noaes: cd contrib/depends && $(MAKE) HOST=$(target) && cd ../.. && mkdir -p build/$(target)-noaes/release cd build/$(target)-noaes/release && cmake -DNO_AES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=$(CURDIR)/contrib/depends/$(target)/share/toolchain.cmake ../../.. && $(MAKE)

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

I'll figure it out. I'm just preparing the workplace right now, so to say. But thanks for the active participation.

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

I confirm, that the binary ARM v8 produced with NO_AES=ON works flawlessly under RPi OS 64-bit (Rpi4).

@ArqTras

ArqTras commented Sep 28, 2021

Copy link
Copy Markdown
Contributor

I confirm, that the binary ARM v8 produced with NO_AES=ON works flawlessly under RPi OS 64-bit (Rpi4).

I did test same on Ubuntu 21.04 64 bit rpi 4, works fine

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

@ArqTras : Thanks. Could you also share some expertise, if the ARM v7 Rpi build, that I recently added, also makes sense?

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

BTW, in case you didn't know, you may directly test the built binaries by clicking on Checks, and then "Depends". Then scroll down for the bins.

@ArqTras

ArqTras commented Sep 28, 2021

Copy link
Copy Markdown
Contributor

@ArqTras : Thanks. Could you also share some expertise, if the ARM v7 Rpi build, that I recently added, also makes sense?

I will check as soon as I get my computer on hands ;)

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

I ran tests on RPi 3 and RPi 3B+, both using ARM v7. Both versions: with and without AES were working fine. I'd love to be able to assume here, that all the RPi 3 versions had the AES support. Care to help me research this online maybe @ArqTras ?

@selsta

selsta commented Sep 28, 2021

Copy link
Copy Markdown
Collaborator

No Raspberry has hardware AES support

@hyc

hyc commented Sep 28, 2021

Copy link
Copy Markdown
Collaborator

32bit ARM code for RandomX has never used hardware AES, it is all 100% software. And too slow to be worth using.

The ARMv7 instruction set doesn't include AES instructions. They're only available in ARMv7l, an ARMv8 processor running in 32bit mode.

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

Thanks for the replies.

32bit ARM code for RandomX has never used AES, it is all 100% software. And too slow to be worth using.

This explains, why the switch NO_AES wasn't needed for the ARM v7. Then I'd say that the ARM v7 RPi would be a candidate for removal at the current state.

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

They're [AES instructions] only available in ARMv7l, an ARMv8 processor running in 32bit mode.

This would be quite an interesting use case. Do y'all think we should cover it in the future? However that reply about 32bit ARM code for RX disqualifies this.

@hyc

hyc commented Sep 28, 2021

Copy link
Copy Markdown
Collaborator

I already wrote the code for it. No, I don't think it's useful. tevador/RandomX#148

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

The next step shall be Gitian (A.K.A. "Reproducible Builds")

@hyc

hyc commented Sep 28, 2021

Copy link
Copy Markdown
Collaborator

Overall I think supporting Rpi in any form is a waste of effort since they all lack hardware AES. Alternatives like Odroid, Pine64, etc are all plentiful and easily found, with solid Linux support already.

@mj-xmr

mj-xmr commented Sep 28, 2021

Copy link
Copy Markdown
Contributor Author

A dumb question maybe, but does AES matter so much, if an RPi user wishes just to run a node and use the CLI wallet to perform transactions?

@hyc

hyc commented Sep 28, 2021

Copy link
Copy Markdown
Collaborator

it will probably be too slow to finish intiial block download on its own. Copying a blockchain DB from a PC may be ok to get it started but if it ever spends more than a day offline it will never catch up on its own.

@ArqTras

ArqTras commented Sep 28, 2021

Copy link
Copy Markdown
Contributor

Sync take a day as mentioned early on ssd drive. No issues with create / restore wallet. It’s good to have own trusted node also there is no issue to share blockchain data with others. Not sure about pi3 versions but pi4 is cheap and most popular in EU

@mj-xmr mj-xmr changed the title Rpi: distributing binaries with no AES Rpi4: distributing binaries with no AES for 64-bit OSes Sep 29, 2021
@BigslimVdub

Copy link
Copy Markdown
Contributor

it will probably be too slow to finish intiial block download on its own. Copying a blockchain DB from a PC may be ok to get it started but if it ever spends more than a day offline it will never catch up on its own.

FYI Pi4 4gb and 4gb swap takes over a week straight to sync from 0 using microSD card as storage and no pruning :)

@ArqTras

ArqTras commented Oct 6, 2021

Copy link
Copy Markdown
Contributor

Bez tytułu

2021-10-06 15:46:42.982 I Synced 2252686/2465105 (91%, 212419 left, 0% of total synced, estimated 2.4 days left)

@mj-xmr
mj-xmr marked this pull request as ready for review October 7, 2021 08:03
@hyc

hyc commented Oct 7, 2021

Copy link
Copy Markdown
Collaborator

If you really want to support Rpi, setting up an entire new build seems the wrong way to go. Instead just add dynamic AES detection at runtime, like we do for x86.

One way to get started on that would be to add the output of cat /proc/cpuinfo from rpi3 and rpi4 to one of these tickets so we know what we're dealing with.

Here's output from RK3399 in rockpro64

processor       : 0
BogoMIPS        : 48.00
Features        : fp asimd evtstrm aes pmull sha1 sha2 crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

@mj-xmr

mj-xmr commented Oct 7, 2021

Copy link
Copy Markdown
Contributor Author

Sounds good. Thanks.

@Minthos

Minthos commented Oct 7, 2021

Copy link
Copy Markdown

processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 1
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 2
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

processor : 3
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 4

Hardware : BCM2709
Revision : a02082
Serial : 0000000099e5decc

@hyc

hyc commented Oct 7, 2021

Copy link
Copy Markdown
Collaborator

@Minthos According to other docs, BCM2709 is in the Rpi2, which we don't care about here since it's 32bit only.

Ah, never mind. It's running a 32bit OS. again, we don't care about this, we only need the info for 64bit OS.

But I think it's already cleaar that the Features line will indicate aes when present, and it will be absent on all the Pis.

@endorxmr

endorxmr commented Oct 7, 2021

Copy link
Copy Markdown

Raspberry Pi 3B+

processor       : 0
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 89.60
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 89.60
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 89.60
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 89.60
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2835
Revision        : a020d3
Serial          : 00000000bdfa9dbb
Model           : Raspberry Pi 3 Model B Plus Rev 1.3

Raspberry Pi 4B

processor       : 0
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 1
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 2
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

processor       : 3
model name      : ARMv7 Processor rev 3 (v7l)
BogoMIPS        : 108.00
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd08
CPU revision    : 3

Hardware        : BCM2711
Revision        : c03112
Serial          : 10000000bd63169f
Model           : Raspberry Pi 4 Model B Rev 1.2

@hyc

hyc commented Oct 7, 2021

Copy link
Copy Markdown
Collaborator

@endorxmr looks like both of yours are running 32bit OS too. So again, not what we need.

@ArqTras

ArqTras commented Oct 7, 2021

Copy link
Copy Markdown
Contributor

processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3

Hardware : BCM2835
Revision : d03114
Serial : 1000000077a8f2f5
Model : Raspberry Pi 4 Model B Rev 1.4
Runing on 64 bit version ubuntu budgie 21.04

@mj-xmr

mj-xmr commented Oct 7, 2021

Copy link
Copy Markdown
Contributor Author

2 Rpi4's, running 64-bit Raspbian OS:

(...)
processor	: 3
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

Hardware	: BCM2835
Revision	: c03112
Serial		: 1000000082fb7e09
Model		: Raspberry Pi 4 Model B Rev 1.2
(...)
processor	: 3
BogoMIPS	: 108.00
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd08
CPU revision	: 3

Hardware	: BCM2835
Revision	: c03111
Serial		: 10000000802a740a
Model		: Raspberry Pi 4 Model B Rev 1.1

@SChernykh

Copy link
Copy Markdown
Contributor

RPi3 Model B (64-bit OS)

processor	: 0
BogoMIPS	: 38.40
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

processor	: 1
BogoMIPS	: 38.40
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

processor	: 2
BogoMIPS	: 38.40
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

processor	: 3
BogoMIPS	: 38.40
Features	: fp asimd evtstrm crc32 cpuid
CPU implementer	: 0x41
CPU architecture: 8
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4

@mj-xmr
mj-xmr marked this pull request as draft October 12, 2021 08:25
@selsta

selsta commented Oct 18, 2021

Copy link
Copy Markdown
Collaborator

I assume this is also superseded by #8001?

@mj-xmr

mj-xmr commented Oct 18, 2021

Copy link
Copy Markdown
Contributor Author

Yes

@mj-xmr

mj-xmr commented Oct 18, 2021

Copy link
Copy Markdown
Contributor Author

Closed by #8001

@mj-xmr mj-xmr closed this Oct 18, 2021
@mj-xmr
mj-xmr deleted the rpi-distrib-bins branch October 18, 2021 05:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants