# Lc0: building the Leela Chess Zero engine and running a first search

> Lc0 is a UCI chess engine that plays through LeelaChessZero neural networks rather than hand-tuned evaluation. Here is how the build works, how to run it, and where it stops being the right choice.

**LeelaChessZero/lc0** — Open source neural network chess engine with GPU acceleration and broad hardware support.

- Repository: https://github.com/LeelaChessZero/lc0
- Website: https://lczero.org/
- Stars: 3,233 · Forks: 610
- Language: C++
- License: GPL-3.0
- Published: 2026-09-10 · Updated: 2026-09-10 · Language: en
- Canonical page: https://hysenlabs.com/projects/leelachesszero-lc0

## What Lc0 is, and the problem it actually solves

Most classical engines evaluate a position with a function a human wrote: material, pawn structure, king safety, each term weighted by hand. Lc0 takes the opposite route. The README describes it as a UCI-compliant chess engine designed to play chess via neural network, specifically those of the LeelaChessZero project. The evaluation lives in the network, and the engine is the machinery that feeds positions to it and searches the results.

That split is the whole point. The engine binary and the network file are separate artifacts with separate lifecycles. You build or download Lc0 once, then swap networks underneath it without recompiling anything. The training server enforces game quality using the versions output by the client and engine, so the version string is not decorative; it is part of the protocol between a running engine and the training pipeline.

The audience follows from that. If you are generating selfplay games, running matches, or wiring an engine into a training loop, Lc0 is built for you. If you want a chess program to click on and play, the UCI interface is a feature, not a product, and you will be handing it to a GUI.

## Backends, networks and the data flow through a search

Lc0 is a client of a neural network, and the README lists what it can talk to. On CPU, any CBLAS-compatible library works in theory, with OpenBLAS or Intel's DNNL as the main ones. On GPU, the supported paths are CUDA (with optional cuDNN), HIP/ROCm for AMD cards, various flavors of onnxruntime, and Apple's Metal Performance Shaders. SYCL support for AMD and Intel GPUs is described as experimental.

Those are not interchangeable switches. Each backend is a different build configuration, and the ONNX family is itself split into onnx-cpu, onnx-cuda, onnx-trt, onnx-rocm and, on Windows, onnx-dml, each using an execution provider from onnxruntime. Choosing between them is a hardware decision made before the first compile, not a runtime flag.

The network is a separate download. The Linux instructions tell you to download a neural network in the same directory as the binary, with no need to unpack it. So the data flow is: your GUI or match manager sends UCI commands, the engine searches, and every leaf evaluation is a forward pass through the network file sitting next to the executable, executed on whichever backend you compiled in. A missing or mismatched network is the most common reason a fresh build appears to do nothing useful.

## Installing Lc0 on Linux and running a first search

The README recommends the latest release branch rather than master, for essentially all purposes including selfplay game generation and match play. Start by cloning that branch.

```bash
git clone -b release/0.32 https://github.com/LeelaChessZero/lc0.git
```

If you already have an older clone, the README gives the fetch and checkout sequence instead of a fresh clone.

```bash
git fetch --all
git branch --all
git checkout -t remotes/origin/release/0.32
```

Building needs Meson, Ninja and Python, plus at least one backend library. If a library is missing, Meson generates its own copy as a subproject, which requires git to be installed separately from the clone you just made. On Linux the generic path is to install your backend, then ninja-build, meson and optionally libgtest-dev, then run the build script from inside the lc0 directory.

```bash
./build.sh
```

The binary lands in lc0/build/release/. Download a network from the bestnets page into that same directory, without unpacking it. Then the engine is ready to answer UCI commands from any compatible GUI or match manager. On Ubuntu 20.04 the README gives a fuller sequence with gcc-10 and an install prefix, and notes that ~/.local/bin must be on your PATH before lc0 --help works. macOS uses ./build.sh -Dgtest=false, and since v0.32.0 a pre-compiled build is also published on the release page.

## Where the build breaks, and when Lc0 is the wrong tool

The build is the friction point, and the README is unusually candid about one failure mode. CUDA uses the system compiler and stops if it does not recognize the version, even if that version is newer. On a recent Linux distribution this can halt a build on a machine where every dependency is present. The documented workaround is the nvcc_ccbin build option, for example adding -Dnvcc_ccbin=g++-11 to the build command line so CUDA uses g++-11 instead of the system compiler. That is a real constraint, not a footnote: your CUDA build depends on a compiler you may not have chosen.

There are others. A C++20 compiler is required, with g++ v10.0, clang v12.0 and Visual Studio 2019 version 16.11 as the minimal tested versions. ONNX backends may need onnx_libdir and onnx_include set by hand when the system does not ship onnxruntime packages. On Windows, if CUDA_PATH is not set, you edit build.cmd; cuDNN needs CUDNN_PATH unless it matches CUDA_PATH. None of this is hidden, but all of it is work.

Where Lc0 is the wrong tool is a narrower question than it looks. If you need an engine that runs from a single file with no backend selection, no compiler version negotiation and no network download, this is not that engine. If you need to embed a chess evaluator in a permissively licensed product, GPL-3.0 is a boundary you should read before writing code, not after. And if your hardware falls outside CUDA, ROCm, ONNX and Metal, you are on the experimental SYCL path or on CPU with OpenBLAS or DNNL, which is a different performance class entirely.

## Lc0 against a classical alpha-beta engine

The natural comparison is Stockfish, and the difference is architectural rather than a matter of tuning. A classical engine carries its knowledge inside the binary and searches with alpha-beta pruning over a hand-written evaluation. Lc0 carries its knowledge in an external network and evaluates positions with forward passes, which is why the backend list matters so much: the search is only as fast as the hardware can push tensors.

That changes the practical trade-offs. A classical engine is self-contained, so deploying it is copying a binary. Lc0 is a binary plus a network plus a backend, and the three have to agree. In exchange, the network is replaceable. You can point the same binary at a different network and get different play without touching the build, which is exactly what a training pipeline needs and exactly what a casual user does not.

There is a licensing difference too. Lc0 is GPL-3.0. If you intend to ship it inside another product, that is the first thing to check, not the last.

## Python bindings, licensing and what upgrades cost

The repository ships a pyproject.toml for a package named lczero_bindings, described as Leela Chess Zero Python bindings, version 0.1.0, requiring Python 3.7 or later. It builds through meson-python and passes -Dpython_bindings=true to the Meson setup step. For anyone scripting selfplay or analysis from Python, that is the intended entry point; the README itself does not walk through the bindings, so the pyproject.toml is the more reliable source for how they are built.

Upgrade cost is tied to the release branch model. The README recommends tracking release/0.32-style branches rather than master, and versioning follows Semantic Versioning with major, minor and patch sections. Moving between releases means pulling the branch and rebuilding against your backend, since the backend is compiled in. The recent release history shows v0.32.1 in November 2025 and v0.33.0-rc0 in September 2026, with the last push to the repository on 2026-09-10.

On licensing: Lc0 is GPL-3.0, and the COPYING file is the authoritative text. Whether that fits your distribution model is a question for your own legal review; the repository states the licence, it does not tell you what you may ship.

## Conclusion

Lc0 suits engine developers, selfplay and training pipelines, and anyone who wants a neural-network opponent that speaks UCI to their existing GUI. It is the wrong pick if you want a single binary with no backend setup, no separate network file and no GPL-3.0 obligations. Before adopting it, confirm which backend your hardware can build against, that your toolchain reaches C++20 (g++ v10.0, clang v12.0 or Visual Studio 2019 16.11), and which network file you intend to pair with the binary, because the engine without one does not play.

## FAQ

### Is Leela Chess Zero better than Stockfish?

The README does not make a strength comparison. The architectural difference is that Lc0 evaluates positions through an external LeelaChessZero neural network, while a classical engine such as Stockfish carries a hand-written evaluation inside the binary. Which one plays better depends on the network, the backend and the hardware, none of which the README compares against another engine.

### What does Lc0 mean in chess?

Lc0 is the name of the engine, and the README describes it as a UCI-compliant chess engine designed to play chess via neural network, specifically those of the LeelaChessZero project. The engine and the networks are separate: the binary searches, the network evaluates.

### What is the Elo of Leela Chess Zero?

The README does not state an Elo rating for Lc0. It only notes that the training server enforces game quality using the versions output by the client and engine, so the version string participates in the training protocol rather than encoding a rating.

### Is Leela stronger than AlphaZero?

The README does not claim a strength comparison against AlphaZero. It describes Lc0 as a UCI-compliant chess engine designed to play chess via neural network, specifically those of the LeelaChessZero project, and the repository topics include alphazero and alphazero-inspired, which describes the approach rather than a measured result.

## Sources

- [LeelaChessZero/lc0 on GitHub](https://github.com/LeelaChessZero/lc0)
- [License: GPL-3.0](https://github.com/LeelaChessZero/lc0/blob/master/LICENSE)
- [Project website](https://lczero.org/)
- [README](https://github.com/LeelaChessZero/lc0/blob/master/README.md)
- [Releases](https://github.com/LeelaChessZero/lc0/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/leelachesszero-lc0
