pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
506 stars 117 forks source link

how can i run pachi on raspberry pi 3 B? #79

Open enricoT opened 6 years ago

enricoT commented 6 years ago

Is there a tutorial for newbie or some tip specific to run pachi dcnn ? Im using archlinux armv7h

lemonsqueeze commented 6 years ago

Hi, yes, there are lots of tips on running pachi =) Are you looking for raspberry pi specific stuff or general Pachi building/running tips ? I have some notes for raspberry pi 3 somewhere which haven't been published, could dig that up.

enricoT commented 6 years ago

i have rpi 3 b it would be nice to be able to run it on archlinuxarm for me. I would like to build and run the program. So, any tip about build first, in addiction later, some tip on how to run it.... if built succeed ^^

lemonsqueeze commented 6 years ago

Here's my notes: in my case it's raspian with a Pi 3B, but should be pretty similar.

Getting started is pretty easy, just follow build instructions from readme:

Raspberry Pi specific:

Compiler You're probably better off with arch, but with raspian bundled gcc is quite old (4.x). gcc for arm got a lot better in later versions, so if you feel brave enough (and have time to spare) you might want to get a more recent version. I ended up compiling gcc 6.4 from source (mix of these two iirc), optimizes a lot better. Took ~7h !

With gcc 6.4, had to add -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++98 to CXXFLAGS.

Overheating issues Pi 3B+'s are probably fine but Pi 3B's can be unstable under heavy load at the standard cpu clock (1.2GHz). When temperature reaches 80 degrees throttling kicks in and reduces speed, but not fast enough to prevent overheating and undefined behavior. Pachi would randomly crash / assert out without reason. A good way to test this is to run dcnn code non-stop (t-predict/predict -e dcnn on a bunch of sgfs) and watch random stuff happen as the temperatures go up the roof !

So either you live with the once_in_a_while random crash, do whatever it takes to make sure the Pi never reaches 80 degrees (pound coin heatsink, anyone ?) or underclock it a little bit and it'll never freak out. I found mine is rock stable at 1150MHz.

SD card get a good one, it makes a difference.

Swap enabled some zram swap, swapping to sdcard is horrible. If you run it headless you can get some memory back by disabling X and lowering gpu mem in raspi-config.

I think that's about it, good luck !