Difference between revisions of "Building KataHex"
m (Selinger moved page Buillding KataHex to Building KataHex: Fixing a typo in the page name) |
(Some copy-editing. Added an introductory paragraph.) |
||
| Line 1: | Line 1: | ||
| − | There is more than one version of KataHex out there, so | + | This page contains detailed instructions for building the [[KataHex]] software from source code. KataHex is a free and open-source computer Hex program. For general information about KataHex, see [[KataHex|the main KataHex page]]. |
| + | |||
| + | There is more than one version of KataHex out there, so the instructions on this page have variants. | ||
---- | ---- | ||
| Line 12: | Line 14: | ||
You may have to install additional software to work with KataHex, using <code>apt-get</code> or <code>synaptic</code> to install packages. | You may have to install additional software to work with KataHex, using <code>apt-get</code> or <code>synaptic</code> to install packages. | ||
| − | For example, the TCMALLOC option protects from problems related to memory management when you run more than one instance at at time. You may have to install one or more packages | + | For example, the TCMALLOC option protects you from problems related to memory management when you run more than one instance at at time. You may have to install one or more packages. |
* <code>libtcmalloc-minimal4t64</code> | * <code>libtcmalloc-minimal4t64</code> | ||
* <code>librust-tcmalloc-dev</code> | * <code>librust-tcmalloc-dev</code> | ||
* <code>librust-tcmalloc-sys-dev</code> | * <code>librust-tcmalloc-sys-dev</code> | ||
| − | The code works with at least 4 backends (software where the real work is done), EIGEN, OPENCL, CUDA, AND TENSORRT | + | The code works with at least 4 backends (software where the real work is done), EIGEN, OPENCL, CUDA, AND TENSORRT. Which of these backends you should choose depends on what hardware you own. If you do not have a GPU, use the EIGEN backend. |
==== EIGEN (CPU only) ==== | ==== EIGEN (CPU only) ==== | ||
| − | |||
The following BASH commands then may do the trick, but will produce code that may only work on the exact CPU model you use for the build. See comments in the KataHex source code, as well as the KataGo source code (on with KataHex is based, and which contains more details). | The following BASH commands then may do the trick, but will produce code that may only work on the exact CPU model you use for the build. See comments in the KataHex source code, as well as the KataGo source code (on with KataHex is based, and which contains more details). | ||
| Line 30: | Line 31: | ||
==== OPENCL ==== | ==== OPENCL ==== | ||
| − | You may be able to use almost the same commands as for EIGEN, just by changing to -DUSE_BACKEND=OPENCL | + | You may be able to use almost the same commands as for EIGEN, just by changing to -DUSE_BACKEND=OPENCL. |
==== CUDA ==== | ==== CUDA ==== | ||
| − | I have not yet been able to build with the CUDA backend | + | I have not yet been able to build with the CUDA backend. |
==== TENSORRT ==== | ==== TENSORRT ==== | ||
| − | I have not yet been able to build with the TENSORRT backend | + | I have not yet been able to build with the TENSORRT backend. |
Latest revision as of 16:42, 25 January 2026
This page contains detailed instructions for building the KataHex software from source code. KataHex is a free and open-source computer Hex program. For general information about KataHex, see the main KataHex page.
There is more than one version of KataHex out there, so the instructions on this page have variants.
Ubuntu Linux
You can get Selinger's version of KataHex with the following command, which connects you to the Git history, and enables you to contribute edits:
git clone https://github.com/selinger/katahex.git
This creates a katahex directory wherever you execute that command. If you want to build multiple variants, you will have to do a separate load for each one (trying to reuse a build directory creates chaos). Just rename the one you just created to reflect the variant name, and do another git clone.
You may have to install additional software to work with KataHex, using apt-get or synaptic to install packages.
For example, the TCMALLOC option protects you from problems related to memory management when you run more than one instance at at time. You may have to install one or more packages.
-
libtcmalloc-minimal4t64 -
librust-tcmalloc-dev -
librust-tcmalloc-sys-dev
The code works with at least 4 backends (software where the real work is done), EIGEN, OPENCL, CUDA, AND TENSORRT. Which of these backends you should choose depends on what hardware you own. If you do not have a GPU, use the EIGEN backend.
EIGEN (CPU only)
The following BASH commands then may do the trick, but will produce code that may only work on the exact CPU model you use for the build. See comments in the KataHex source code, as well as the KataGo source code (on with KataHex is based, and which contains more details).
cmake . -DUSE_BACKEND=EIGEN -DUSE_AVX2=1 -DUSE_TCMALLOC=1 -DCMAKE_CXX_FLAGS='-march=native' -DMAX_BOARD_LEN=19 make -j 4
OPENCL
You may be able to use almost the same commands as for EIGEN, just by changing to -DUSE_BACKEND=OPENCL.
CUDA
I have not yet been able to build with the CUDA backend.
TENSORRT
I have not yet been able to build with the TENSORRT backend.