Step 2: Compiling the Stockfish Chess Engine
The Best Chess Engine In The World Is Free
- It has a well defined, public development process with a large community of people who contribute improvements and/or testing capacity. Anyone can submit code changes to be tested to see if they improve performance. Testing is done on one platform that is open to all and is clearly visible to all participants, with well defined criteria for accepting/rejecting contributions. We'll talk about this more in another post, but Lc0's development process is much more opaque and segmented.
- Ideas that improve performance are quickly incorporated in the "official" development version of Stockfish which is easily obtainable from one source. Again, not so with Lc0.
- Stockfish is a CPU based engine and strong CPUs have been cheaper/easier to obtain than Graphical Processor Units that Lc0 relies on. A strong 32-thread CPU like the AMD 7950x is only $600 MSRP compared to a Nvidia 3090 GPU which is difficult to find for less than $1,000 at the present time.
Set Up The Fastest Stockfish For Your Computer Architecture
git clone https://github.com/official-stockfish/Stockfish.git
and then run the bash script below (i.e., chmod +x makeFish.sh && ./makeFish.sh)
Your executable with be in the /Stockfish/src directory.
There are two common compilers used to compile Stockfish: gcc and clang. In the makeFish.sh script, we default to the gcc version. But on some computers the clang version will run more quickly. To test this for your computer, you can 1) copy your stockfish executable to "stockfishGCC" and re-run makeFish.sh after commenting out line 131 to make stockfish with gcc and uncomment line 132 to make it with clang. Then to see which version runs faster on your machine, you cd into the /Stockfish/src directory and run bench_parallel.sh using the command:
./bench_parallel.sh ./stockfish ./stockfishGCC 20 10
The bench_parllel.sh script will put both versions through 10 iterations of some position analyses to depth 20 and compare their relative speed. For some architectures, one version will be superior to the other. But, as the example below illustrates, you may also find large error bars and inconsistent results suggesting the two versions are pretty similar.
Comments
Post a Comment