Is memory size critically importan for PicoChess?

165 views
Skip to first unread message

Andrea Gatti

unread,
Dec 13, 2022, 4:31:47 AM12/13/22
to PicoChess
Hi all,

I was reflecting on the importance of the memory size, and what could be the impact of a smaller RAM size on the speed of the whole PicoChess.

I don't think there is any benchmark around, showing performance data vs RAM size, but I would ask to the experts here, if the RAM size is one of the critical factors driving the preference for an RPi 4B, compared to an RPi 3B+.

I recently found an interesting article that speaks about ZRam, a Linux kernel module for RPI 3 and 4, that seems capable of increasing the available memory by as much as 50%, by means of a compression algorithm.

Here's a link to that article, showing how to use it: How to Squeeze 50% More Memory Out of Your Raspberry Pi with zram (ikarus.sg)

I was therefore curious to know if any of you had this Kernel module installed on their PicoChess machines, and if this module, installed on an RPI 3B+ would be a good alternative (cheaper!) choice to an RPi 4B.

Thanks!

Andrea.

Scally

unread,
Dec 13, 2022, 5:06:02 AM12/13/22
to PicoChess
Hi Andrea,

An interesting point…

I don’t use zRAM in my DGT Pi as it has a 4gb RAM RPi 4 inside. I would be interested to see how fast the MAME engines run in a 3b+ with zRAM as it’s not powerful enough to run all emulations at 100% on its own.

I do however use zRAM in my development RPi 4 which has 8gb RAM. This is advantageous to me when compiling MAME.
(See attached photo)

Cheers,

Al.

0F61816E-D599-4755-8ED9-F2E49527854E.jpeg

gkalab

unread,
Dec 13, 2022, 3:58:28 PM12/13/22
to PicoChess
Hi,

I don't believe the RAM size has an influence on the speed of PicoChess because there should be enough memory available.
Here is the used memory on my Raspberry Pi 3b with three different engines, running on the latest PicochessWeb 3.1 from Dirk:

Stockfish 15, no NNUE:
               total        used        free      shared  buff/cache   available
Mem:           922Mi       514Mi        63Mi        13Mi       344Mi       342Mi
Swap:           99Mi        45Mi        54Mi

Maia:
               total        used        free      shared  buff/cache   available
Mem:           922Mi       291Mi       273Mi        14Mi       357Mi       564Mi
Swap:           99Mi        78Mi        21Mi


TascKing2.5:
               total        used        free      shared  buff/cache   available
Mem:           922Mi       366Mi       179Mi        14Mi       377Mi       489Mi
Swap:           99Mi        56Mi        43Mi


Stockfish 15, no NNUE with additional analysis engine (Javascript Stockfish 14):
               total        used        free      shared  buff/cache   available
Mem:           922Mi       522Mi        64Mi        15Mi       335Mi       332Mi
Swap:           99Mi        99Mi          0B

Gerhard

Andrea Gatti

unread,
Dec 14, 2022, 3:46:54 AM12/14/22
to pico...@googlegroups.com

Hi Gerhard, than-you for your comments.

 

Based on the below:

 

Stockfish 15, no NNUE with additional analysis engine (Javascript Stockfish 14):

               total        used        free      shared  buff/cache   available
Mem:           922Mi       522Mi        64Mi        15Mi       335Mi       332Mi
Swap:           99Mi        99Mi          0B

 

I see that your Swap file is fully used, so I assume that the RPI could be busy swapping part of the RAM to the swap file and vice-versa. This swapping activities are potentially keeping the CPU busy for some time, subtracting CPU power to the engine.

 

It would be interesting to see what result is given by Stockfish’s “bench” UCI command with zRAM installed and without zRAM installed, in your specific example (“Stockfish 15, no NNUE with additional analysis engine (Javascript Stockfish 14”).

 

Andrea.

 

Gerhard

On Tuesday, December 13, 2022 at 11:06:02 AM UTC+1 Scally wrote:

Hi Andrea,

 

An interesting point…

 

I don’t use zRAM in my DGT Pi as it has a 4gb RAM RPi 4 inside. I would be interested to see how fast the MAME engines run in a 3b+ with zRAM as it’s not powerful enough to run all emulations at 100% on its own.

 

I do however use zRAM in my development RPi 4 which has 8gb RAM. This is advantageous to me when compiling MAME.

(See attached photo)

 

Cheers,

 

Al.

On Tuesday, December 13, 2022 at 9:31:47 AM UTC Andrea Gatti wrote:

Hi all,

 

I was reflecting on the importance of the memory size, and what could be the impact of a smaller RAM size on the speed of the whole PicoChess.

 

I don't think there is any benchmark around, showing performance data vs RAM size, but I would ask to the experts here, if the RAM size is one of the critical factors driving the preference for an RPi 4B, compared to an RPi 3B+.

 

I recently found an interesting article that speaks about ZRam, a Linux kernel module for RPI 3 and 4, that seems capable of increasing the available memory by as much as 50%, by means of a compression algorithm.

 

Here's a link to that article, showing how to use it: How to Squeeze 50% More Memory Out of Your Raspberry Pi with zram (ikarus.sg)

 

I was therefore curious to know if any of you had this Kernel module installed on their PicoChess machines, and if this module, installed on an RPI 3B+ would be a good alternative (cheaper!) choice to an RPi 4B.

 

Thanks!

 

Andrea.

--
You received this message because you are subscribed to a topic in the Google Groups "PicoChess" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/picochess/XdKyehgRrE8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/82b5ef1a-adf0-4cfc-a973-1514986a2a41n%40googlegroups.com.

 

Message has been deleted

Andrea Gatti

unread,
Oct 6, 2023, 8:49:05 AM10/6/23
to PicoChess
Hi Scally (and all),

as I just received my Rpi-4B, as you can imagine I'm experimenting and tweaking it to find the best setup (and because I enjoy!).

A question for you: in this thread you posted a picture where I see you used the command "tools" that outputs a number of useful data, like temperature, swap size, diskinfo, etc etc.

I was wondering if you built such "tools" command, or is it found anywhere? I don't have access now to my Rpi so I wanted to ask before I get back to it later this evening.

In case you built it, would it be OK for you to share how you did it?

Thanks!

Andrea.

Scally

unread,
Oct 6, 2023, 9:32:35 AM10/6/23
to PicoChess

Hi Andrea,


You can add shortcuts via aliases in file .bashrc. You can edit this file and add aliases as I’ve done via sudo nano .bashrc


Here’s a link to my bashrc: https://www.dropbox.com/scl/fo/j47gsw17y4kj9w5m3f6ee/h?rlkey=zdnm1c2v7ra7g8l828dvl5m78&dl=0


Also there is the file throttled.py which you’ll also need, this will need execution rights with command  chmod a+x throttled.py. 


If you scroll down my bashrc file you’ll see all the aliases I’ve added. The tools alias loads my SSD drive etc, you can delete these bits.


Call any aliases by just typing the name, i.e. tools


You’ll also need to install vcgencmd via pip, google how to do this.


Any more questions please ask.


Cheers,


Al.

Randy Reade

unread,
Oct 6, 2023, 9:45:13 AM10/6/23
to pico...@googlegroups.com
I believe vcgencmd is already included with the RPiOS.

Randy

--
You received this message because you are subscribed to the Google Groups "PicoChess" group.
To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/picochess/602e1e8e-5215-4e15-bb06-90ef1117c26fn%40googlegroups.com.

Randy Reade

unread,
Oct 6, 2023, 9:48:51 AM10/6/23
to pico...@googlegroups.com
Also, for my images you can edit .bashrc using:

nano ~/.bashrc

Randy

On Fri, Oct 6, 2023, 8:32 a.m. Scally <scall...@gmail.com> wrote:
--

Andrea Gatti

unread,
Oct 6, 2023, 9:56:34 AM10/6/23
to PicoChess
Thank-you Al and Thank-you Randy for all of the great suggestions you're providing!

Andrea

Reply all
Reply to author
Forward
0 new messages