-
Notifications
You must be signed in to change notification settings - Fork 11
How to install
SAI is a Go engine based on Leela Zero, so everything about installation should be really similar to the father project and you can always have a look there to get a better understanding.
We provide Windows executables at the releases page. Please note that if you want the very last version of SAI you need to compile it.
Ignore the source code files and download either the GPU or the CPU version according to your hardware. The GPU version requires a graphic card and working openCL drivers. If you have a NVIDIA or AMD graphic card with recent drivers installed, you should be ok. If you have an integrated graphics chipset, such as Intel HD Graphics, you may try the GPU version, but it may happen that the CPU version is faster.
We tested SAI on Windows 7, Windows 8.1 and Windows 10 without problems.
The executables are inside zip files, together with: the required libraries; a strong network for 9x9 SAI; some small scripts for your ease.
You should decompress the zip file you downloaded in a dedicated directory and take note of its path. If are not an expert user, maybe the easiest way is to decompress the contents of the zip file in a directory C:\sai
. After doing that, you will find four useful executables in C:\sai
:
-
sai.exe
: the main program with SAI engine for 19x19 games; -
sai9x9.exe
: the main program with SAI engine for 9x9 games; -
autogtp.exe
: the client used for contributing to the distributed effort; -
sai.hta
: a GUI to launch autogtp.exe.
The following is step-by-step guide for compiling SAI, tested on Windows 10.
-
Download the installer for Visual Studio 2019 Community Edition.
-
Using the Visual Studio Installer select "Desktop development with C++" from the Workloads tab and "Windows Universal CRT SDK" and "Windows 10 SDK" from Individual Components (taken from https://lifein19x19.com/viewtopic.php?f=18&t=16582).
-
Install Qt from https://www.qt.io/: use "Downloads for open source users" and choose the Qt online installer.
-
From the Qt online installer you can create a Qt account. Do it, and confirm your email.
-
Log in with your brand new Qt credentials and accept the GPL license.
-
From the window "Select Components" select at least one of the Qt versions: at the time of writing (April 2020), I have chosen the last version 5.14.2 - around 36GB disk space required!
-
Install "Git for Windows" from https://gitforwindows.org/, and run the Git bash shell.
-
Clone github SAI repository and its submodules with:
git clone https://github.com/sai-dev/sai.git cd sai git submodule update --init --recursive
-
From the zip file in the releases, copy
msys-gcc_s-1.dll
,msys-2.0.dll
,curl.exe
andgzip.exe
intosai/msvc
folder. -
Double-click the
leela-zero2019.sln
file, and open it with Microsoft Visual Studio 2019. -
In the main VS2019 window, change from "Debug" to "Release" and from "Win32" to "x64".
-
From the tab "Extensions" choose "Qt VS Tools"->"Qt Options".
-
In the tab "Qt Versions" you should have at least one path. If not, use the "Add" button and select the path
C:\Qt\5.14.2\msvc2017_64
for a default Qt 5.14.2 installation. Please notice that 2017 instead of 2019 is correct. -
From the window on the right, right-click on "Solution 'leela-zero2019' and choose "Build Solution".
-
Change the cmd prompt path to include the folder
sai\msvc\VS2019\x64\Release
, where the .exe have been built.
We do not provide Linux binaries; instead you will have to compile them on your own. In the following, a step-by-step guide for Ubuntu-like distributions.
-
Update and upgrade your installation
sudo apt update sudo apt upgrade
-
Test for OpenCL support and compatibility
sudo apt install clinfo && clinfo
If the output gives no OpenCL platform then either you don't have a GPU or you graphic card drivers are not properly installed. Correct the issue or compile the CPU version, below.
-
From a shell clone SAI git
sudo apt install git cmake git clone https://github.com/sai-dev/sai.git cd sai git submodule update --init --recursive
-
Install build dependencies. The second line only if you have OpenCL working
sudo apt install libboost-dev libboost-program-options-dev libboost-filesystem-dev zlib1g-dev libqt5opengl5-dev sudo apt install opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev
-
Prepare compiling directory and makefile
mkdir build cd build cmake ..
If you may want to compile for CPU only, replace the last command with
cmake .. -DUSE_CPU_ONLY=1
You can also try the parameter -DBOARD_SIZE to compile with a different board size, such as
cmake .. -DBOARD_SIZE=9
-
Start the compiling process
cmake --build .
Finally, you will find sai
executable in sai/build
and autogtp
executable in sai/build/autogtp
The tests are also compiled, but they should not work for SAI.
We lack macOS expertise, but Leela-Zero instructions should work equally well for SAI. We report them here for completeness:
# Clone github repo
git clone https://github.com/leela-zero/leela-zero
cd leela-zero
git submodule update --init --recursive
# Install build dependencies
brew install boost cmake zlib
# Use a stand alone build directory to keep source dir clean
mkdir build && cd build
# Compile sai and autogtp in build subdirectory with cmake
cmake ..
cmake --build .
Please have a look to the Linux instructions above for changing board size and on how to test. The test program should not work for SAI.