Raspberry Pi 4 compiled chess engines

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Raspberry Pi 4 compiled chess engines

Post by Pi4Chess »

Hello all, I am new there.

First of all I would like to say i am not a code developper and compiling software is really out of my knowledge. I am just another computer chess user geek ☺️ and i am impressed by the talented chess engine creators and People who compile this engines for many OS and processors architecture.

The raspberry Pi 4 and 8GB ram is a nice chess computer and a stand alone desktop computer also.
I am sure I am not the first to use it for chess playing or think of doing engine vs engine tournaments or even official bot for lichess or fics (with low energy consumption).

So I have installed Ubuntu Mate 20.04, Arena Gui 3.9 beta For Linux aarch64 version, EGTB 6-men all on SSD.
All is working very fine ! Arena comes in this version with 4 engines compiled for the raspberry Pi :

-Arasan 21.4
-K2 v.087
-Stockfish 10
-TogaII 4.0.1

Then I have been looking for more engines of course, but it seems there are not many. I found stockfish 11 in official source for Ubuntu and that's it... Even stockfish 12 has not been compiled for this architecture 😕

For an idea of computer processing power Stockfish 11 is running on an average of 2500 kN/s (1.5 to 1, 850 Ghz overclocking).

So here is my first question :
1) Do you know other engines that have versions that run on Linux 64 (arm64/aarch64) raspberry pi 4 ?

There are lots of Android armv8 versions. Armv8 seems pretty the compiling that is needed for Raspberry Pi 4 but as I have no knowledge on these matters I will only Say what I checked.

So I tried to install in arena many armv8 compiles of chess engines (crafty 25.2, Cfish, Official stockfish, Monolith, Corchess, Cichess, Ethereal etc.) and none worked BUT official Cfish armv8 compile from Github !

So at least I have stockfish 12 power with nnue in rasperry pi 4 Thx to Cfish armv8 compile.

Arena reports average of 1500 kN/s with Cfish.

So I was wondering (and this is my second question)

2) why only Cfish armv8 is working on raspberry Pi 4 platform and on Android with the same compile ? Would it be hard to all engine compilers to do it work or is it just a Library to have and check up or something like that ?

It would be nice if this platform could get some love, since it's very energy efficient, decent computing power and tiny transportable ☺️
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Raspberry Pi 4 compiled chess engines

Post by Ras »

Pi4Chess wrote: Mon Nov 16, 2020 8:09 pm1) Do you know other engines that have versions that run on Linux 64 (arm64/aarch64) raspberry pi 4 ?
Lots of them, but you will have to compile them - this isn't rocket science though: http://talkchess.com/forum3/viewtopic.php?f=2&t=75718
2) why only Cfish armv8 is working on raspberry Pi 4 platform and on Android with the same compile ?
The CPU is compatible, and Android is running an old version of the Linux kernel. However, the standard libraries aren't quite the same.
Rasmus Althoff
https://www.ct800.net
User avatar
Scally
Posts: 232
Joined: Thu Sep 28, 2017 9:34 pm
Location: Bermondsey, London
Full name: Alan Cooper

Re: Raspberry Pi 4 compiled chess engines

Post by Scally »

Hi Manuel,

I compile Chess Engines on the Raspberry Pi for Picochess. we’re still using Raspbian Stretch & Raspbian Buster now known as Raspberry Pi OS, which is still 32 bit. We’re waiting for the official 64 bit release which is currently in beta.

It’s not difficult to compile your own I can help you, you can email me by looking at my profile details on here.

You say that engines on GitHub run for you yet other engines don’t, this could simply be a permissions issue. When you clone a GitHub repository the code within retains it permissions so should run, like you say Cfish does.

Other engine binary’s which you download may just need their permissions set via this command:

sudo chmod a+x engine-name
where engine-name is the name of the binary like ethereal for example.
Then try running the engine.


Cheers,

Al.
Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Re: Raspberry Pi 4 compiled chess engines

Post by Pi4Chess »

Ras wrote: Mon Nov 16, 2020 8:53 pm
Lots of them, but you will have to compile them - this isn't rocket science though: http://talkchess.com/forum3/viewtopic.php?f=2&t=75718
2) why only Cfish armv8 is working on raspberry Pi 4 platform and on Android with the same compile ?
The CPU is compatible, and Android is running an old version of the Linux kernel. However, the standard libraries aren't quite the same.
Thx Ras i will take a look and may be urge some people to do compiles for Raspberry Pi 4 since i don't really know how to do these things. :(

Yeah my intuition is that it can be ported from Android version to Linux Aarch64 version with little effort (for someone who masters those things). Hope i am right ^^
Last edited by Pi4Chess on Mon Nov 16, 2020 10:16 pm, edited 1 time in total.
Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Re: Raspberry Pi 4 compiled chess engines

Post by Pi4Chess »

Scally wrote: Mon Nov 16, 2020 9:06 pm Hi Manuel,

I compile Chess Engines on the Raspberry Pi for Picochess. we’re still using Raspbian Stretch & Raspbian Buster now known as Raspberry Pi OS, which is still 32 bit. We’re waiting for the official 64 bit release which is currently in beta.

It’s not difficult to compile your own I can help you, you can email me by looking at my profile details on here.

You say that engines on GitHub run for you yet other engines don’t, this could simply be a permissions issue. When you clone a GitHub repository the code within retains it permissions so should run, like you say Cfish does.

Other engine binary’s which you download may just need their permissions set via this command:

sudo chmod a+x engine-name
where engine-name is the name of the binary like ethereal for example.
Then try running the engine.


Cheers,

Al.
Hey Scally thanks for your advice for chmod command. I will give it a try and tell you.

I think in my internet searches i have found the Picochess project but with little proof of good results or towards DGT boards mainly (?) (also lack of screens to see the thing working and engines in a github 2 to 3 years old and 32 bits:-/) . Arena GUI is available (in beta) for Ubuntu AARCH64 so since i am used to it in Windows i thought it would be better to be in a known land.

I will follow the project though since if 64 bit Buster is released it could be good for more available engine compiles. With UCI protocol an engine should work in any linux 64 aarch64 distro i think.

As for compiling myself, i don't thing i will give a try. The only coding i did was in Basic with my little Amstrad CPC 464... :D and all those librairies and compiling things are really too much complicated for me ^^

I am even planning to try to do some Autoplay RS 232 games between the Raspberry Pi4 and my i5 desktop computer to have a comparative standard of mesure for ELO so we can compare the scalability/loss of ELO of engines when on Pi4
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Raspberry Pi 4 compiled chess engines

Post by Ras »

Pi4Chess wrote: Mon Nov 16, 2020 10:03 pmdo compiles for Raspberry Pi 4 since i don't really know how to do these things.
Then you just learn it - so that you can get whatever new dev version of whatever new engine is there, whenever you want. That thing with handing out fishes vs. handing out fishing rods.

If you know what a terminal window is, and how to enter a command, then you know already 80% of what you'll need. It's that easy.
Rasmus Althoff
https://www.ct800.net
Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Re: Raspberry Pi 4 compiled chess engines

Post by Pi4Chess »

Ras wrote: Mon Nov 16, 2020 11:14 pm
Pi4Chess wrote: Mon Nov 16, 2020 10:03 pmdo compiles for Raspberry Pi 4 since i don't really know how to do these things.
Then you just learn it - so that you can get whatever new dev version of whatever new engine is there, whenever you want. That thing with handing out fishes vs. handing out fishing rods.

If you know what a terminal window is, and how to enter a command, then you know already 80% of what you'll need. It's that easy.
:D I would like to know but it seems to me that what would take 1 year to me learning without success warranty can be done in 5 minutes by someone who masters those things. Aren't the engines with different languages ? There must be so much toolkits and librairies to do so...
You can't ask a driver to learn to build a car or a smartphone user to learn to build his smartphone.
Last edited by Pi4Chess on Mon Nov 16, 2020 11:31 pm, edited 1 time in total.
Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Re: Raspberry Pi 4 compiled chess engines

Post by Pi4Chess »

Scally wrote: Mon Nov 16, 2020 9:06 pm

Other engine binary’s which you download may just need their permissions set via this command:

sudo chmod a+x engine-name
where engine-name is the name of the binary like ethereal for example.
Then try running the engine.

I just tried this chmod a+x but that did not worked.

The thing is the engines are not recognised as executables by the OS it seems.
Some of them when i tried to install them with arena without success poped up a window saying something like "there is no executable bit"
Ras
Posts: 2488
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: Raspberry Pi 4 compiled chess engines

Post by Ras »

Pi4Chess wrote: Mon Nov 16, 2020 11:24 pm:D I would like to know but it seems to me that what would take 1 year to me learning without success warranty
Linux offers that readily. It's not like Windows where you have to install quite some stuff beforehand. There are some things that are really easy under Linux, and compiling happens to be among them.
Aren't the engines with different languages ?
Most of them are in C or C++, and the compiler GCC is installed by default already. That's why it's so easy.

For example Stockfish 12. You download the source release from Github, the "Source code (tar.gz)":
https://github.com/official-stockfish/S ... h/releases

You extract that in your file manager, on your Raspi-64 (not on a PC). You go into the extracted folder, there in the sub-folder "src". If your file manager is any good, you can right-click and choose "Open in Terminal". That opens a terminal window. Now you just type (the Raspi needs to have an internet connection for downloading the neural network):

Code: Select all

make profile-build ARCH=armv8
After some time, that is done, and a new file "stockfish" is there, a little over 20MB large. That's the compiled program.
Rasmus Althoff
https://www.ct800.net
Pi4Chess
Posts: 253
Joined: Mon Nov 16, 2020 12:13 pm
Full name: Manuel Rivera

Re: Raspberry Pi 4 compiled chess engines

Post by Pi4Chess »

Wow Ras ! If it is that much easy i will give it a try !!

Don't i have to put aarch64 instead of armv8 ? Or the fact i am compiling from Raspberry will automatically do so ?

Thanks. I will try and tell you if it works.