Setup Guide for Katago and Katrain

Posted at # Go (game) # AI

Katago is a Go AI engine, which can be found on GitHub here: https://github.com/lightvector/KataGo

Katrain is a graphical user interface (GUI) that works with Katago, available on GitHub at: https://github.com/sanderland/katrain

In the engine settings of Katrain, you can set up the version of Katago, configure files, and select model files.

My system configuration is as follows:

  • CPU: AMD 5950x
  • GPU: RTX 3090
  • CUDA Version: 11.1
  • OS: Windows 10

I am using the CUDA version (which requires both CUDA and cuDNN to run), available for download at: https://github.com/lightvector/KataGo/releases

Choose katago-v1.9.1-cuda11.2-windows-x64.zip. Files labeled with bs29 are meant for a 29x29 board.

Model files can be downloaded from: https://github.com/lightvector/KataGo/releases/tag/v1.4.5

Select the 40-block neural network suitable for high-end GPUs: g170-b40c256x2-s5095420928-d1229425124.

To download Katrain, visit: https://github.com/sanderland/katrain/releases

Download the zip file and extract its contents.

Next, let’s proceed with fine-tuning Katago.

After extracting katago-v1.9.1-cuda11.2-windows-x64.zip, open the readme file for guidance:

Launch Terminal, and first, use the following command to find the essential fine-tuning parameter numSearchThreads:

katago path benchmark -model neural network path -t time per move -visits max visits -config path to default configuration file default_gtp.cfg

Second, generate a configuration file by running:

katago path genconfig -model neural network path -output gtp_custom.cfg

Answer the series of prompts to create the file (which will be located in your user folder).

By combining the outputs from these commands, you can edit default_gtp.cfg using your favorite text editor to adjust settings like rules and whether to think during the opponent’s turn.

Open Katrain, go to the engine settings, set the engine path to the CUDA version of katago.exe, the configuration file path to the modified cfg file, and the model file path to the downloaded 40-block neural network.

You can now use Katrain and the AI to play Go games. Detailed instructions on gameplay are beyond the scope of this guide. I will provide a separate guide for Katrain gameplay in the future when I have time.