Sélectionner une page

This article will go through how to install KataGo (Go Artificial Intelligence) and the Lizzie software for game review and analysis. As shown below for a game between Shusaku and Shuwa (1846)

What we need

A decent GPU (Graphics Processing Unit). The more powerful the better the analysis, CPU (Central Processing Unit) analysis is possible as well but slower.

First we’ll need the graphical software Lizzie from https://github.com/featurecat/lizzie and then the artificial intelligence KataGo from https://katagotraining.org/

Start by downloading the Lizzie software. It can be found here https://github.com/featurecat/lizzie/releases At the time of this writing the latest version is 0.7.4 and that’s the one we’ll download. There is a Mac OS X / Linux version as well as two Windows versions. We’ll get the Windows GPU version.

Once downloaded extract the zip archive and double click on the Lizzie program

As can be seen in the files, it comes with a version of KataGo and Leela Zero (another Go AI) https://github.com/leela-zero/leela-zero

This allows to directly start analyzing games as can be seen below

It is possible to choose the engine under the « Engine » menu. It comes with Leela Zero 0.17 (which came out in 2019 and still seems to be the newest version as of 2022) and KataGo 1.6.1 which is from 2020. This is fine if you don’t want to put more effort in installing a newer engine.

Note that the first time an engine is loaded it will take some time to start, it will detect the best settings for your computer by running some benchmarks which take a bit of time. This is normal and only occurs the first time you launch the engine.

Installing a newer version of KataGo and a newer network (AI)

For this we will need to get the newest version of KataGo. We can download it from here : https://github.com/lightvector/KataGo/releases at the time of this writing (2022) the newest version of the software is 1.11.0

There are many different versions. We have the choice of a Windows and a Linux version. We’ll choose Windows in this example. If we choose to show all 22 assets we see :

Don’be afraid I’ll help you choose :

First we can read the documentation here https://github.com/lightvector/KataGo#opencl-vs-cuda-vs-tensorrt-vs-eigen which helps us chose. I’ll summarize

  • First, you’ll want a « Windows » version if you’re on Windows (and Linux if you are on Linux)
  • Second, don’t chose the « bs29 » version. This allows KataGo to play up to 29×29 boards. If you are interested in « normal » go, 19×19, 13×13, 9×9, don’t take the « bs29 » version. It will be much slower with no benefits at all.
  • Third, now we’ll need to chose a version according to our GPU (if we have one).
    • (Not recommended) If you don’t have a GPU (unlikely) or very weak GPU you can try the « eigen » version, it should work with almost any CPU.
    • (Not recommended) If you don’t have a GPU but your CPU support AVX2 (Intel core i 4th generation and beyond) you can try the « eigenavx2 » version, it will be a bit faster.
    • If you have a GPU (AMD or NVIDIA) you can use the « OpenCL » version, this will work with most GPUs and will be the easiest to setup.
    • If you have a NVIDIA GPU you can use the « CUDA » version, this will require the NVIDIA CUDA drivers installed. It may be faster than the OpenCL version.
    • If you have a recent NVIDIA GPU (RTX 2000, 3000, 4000 series) you should use the « trt » (TensorRT) version, it is almost twice as fast as the other versions.

Well now you know what to choose hopefully. I will be using the « OpenCL » version because I am running an AMD R9 290 GPU from 2013 (Almost 10 years old !) which is not an NVIDIA so I cannot use the CUDA or TensorRT versions. However I can still use my GPU through the OpenCL version.

If you are interested in benchmarks of KataGo running on different GPUs see https://github.com/inisis/katago-benchmark one thing to note is that the TensorRT version is almost twice as fast than CUDA version on newer NVIDIA GPUs. So if you are lucky enough to own a modern NVIDIA GPU you’ll have a very fast version running !

Unzip the downloaded archive in a folder on your computer, I chose to put it in my C:\ drive under a folder name « Go ».

There a several files and the katago program. This is only the engine now we will need to download the KataGo network weights (the « Intelligence »).

The network weights can be downloaded from https://katagotraining.org/networks/ and there are many to chose from. Usually I pick the « Strongest confidently-rated network » available.

 

Once downloaded move the file to the KataGo directory. It can be anywhere but it is easier to keep all files together.

 Configuring Lizzie for the new Engine

This is a bit more technical. Launch Lizzie if not already open. Choose « Engine » in the « Settings » menu. This will open the following window :

Here we’ll add a third engine. To add an engine we first need to specify the path of the engine. I installed (decompressed the KataGo archive) in C:\Go\ therefore the path to the KataGo engine is C:\Go\katago-v1.11.0-opencl-windows-x64\katago.exe. Then we need to specify « gtp » (Go Text Protocol) this is the method used to communicate between Lizzie and KataGo. And finally, we need to specify the weights we downloaded above with the « -model » option and location of the weights. In my case the engine line looks like this :

C:\Go\katago-v1.11.0-opencl-windows-x64\katago.exe gtp -model C:\Go\katago-v1.11.0-opencl-windows-x64\kata1-b40c256-s11840935168-d2898845681.bin.gz

Add the line and click « OK »

Now you’ll be able to choose it from the menu :

Now you have the strongest version of the KataGO AI with the newest engine and can analyze you games ! Enjoy !