note from Jesse: this page is still being written. I'll remove this note when it's fit for public consumption.

last edit: june 4 2014 16:36

What's this page about, who's it for, and the disclaimer

This page is a how-to guide for fusing a chess gui, such as chessbase, on a windows computer to a chess engine living on a linux server. The guide is intended for anyone who wants to do that. It's assumed the machines can ping eachother.

Now, the disclaimer:
if the tides of oceans rise, the polarity of the earth changes, if you realize Jupiter is not 6AU from the earth but 6AU from the sun, if reading this guide causes you to daydream about the many meanings of the phrase 'quarter horse', if your dog passes through a puddle and sneezes and this causes the ctrl+alt key combinations to stop working on your laptop IF day of the week is <= 2 && week number is odd, if everything turns out bad and even this does not change that then all i can say is, 'Dear reader may life be as kind to you as it has been to me,' and at once vanish while thinking, you've been warned.

Fundamental nuts and bolts: engines talk

Engines and gui's talk in plain text. The language they use is defined and explained here by its author, UCI by Stefan Meyer-Kahlen.

Ok, let's talk to a chess engine

# grab an engine
~$ wget http://u.komodochess.com/stockfish

# give it permission to execute
~$ chmod +x stockfish

# start the engine
~$ ./stockfish

# type 'uci'. hit return. engine should kick out its configuration
# type 'go depth 1 [return]' to calculate one ply. 'go ponder [return]' to calculate.
# note "nps" is nodes per second.
# stop [return]' to stop calculating.
# type 'setoption name Threads value 16 [return]' and engine will use 16 cores, default is 1 core.
# 'quit [return]' to exit

Connecting machines

OPTION 1:
Use RTHomeServer.exe (download) on the linux box and RTUciClient.exe (download) on the windows box and explained by ChessOK. Basically just update port number, engine name, engine path, and ip of the server and open port on the router if accessing from outside the lan. 

OPTION 2:
use netChess and Linux and remote engine instructions by Felix King

OPTION 3:
SSH seems simplest but getting the windows side to cooperate is a hassle. It requires windows to run a combination of putty/plink/pageant/InBetween.exe. Here is a how-to Remote_Engines: Secure_shell_and_Putty.

InBetween.exe - for use with Chessbase GUI. Link includes description and download of InBetween.exe

usage example of InBetween.exe - immortalchess.net forum post

Running *.exe engines on Linux: ~$ wine engine.exe

Install wine from the distribution's repositories and try running ~$ wine engine.exe. Hopefully that starts the engine. Some engines don't behave so well from the command line, notably Houdini 1.5, but so long as they start up, you're in business.

Performance optimization

- there are two benchmarks you can use: 1) nodes per second 2) time to solve a tricky position.
Engines cache information so, in general, it's one test per login (reboot), or one test, clear the cache (untested, clear cache with ~$ sudo sh -c "sync; echo 3 > /proc/sys/vm/drop_caches").
For nps tests, use stockfish's built-in benchmark tool which works as follows:
~$ ./stockfish bench [hash] [cores] [depth] default depth ...
so something like:
~$ ./stockfish bench 128 8 18 default depth

- change the kernel.

I've measured performance gains with with "low latency" kernels such as Zen kernel. Could compile your own kernel! the engines stockfish, komodo and houdini all have command line tests which benchmark engine speed. one can use these to measure performance of various kernels, aiming to get the highest nps.

- enable large pages? am not sure if these are already part of the mainline kernel

- look around for Oracle and IBM documentation about improve, for example, db performance

- hash size

- stop programs / daemons wasting cpu cycles

- stockfish has compilation settings for various cpus.


Best regards,

Jesse Gersenson jesse in/on/at jesseo.com

Powered by storesprite © 2024 Lamp Design Limited