-
Notifications
You must be signed in to change notification settings - Fork 535
Running lc0 on Android with a chess GUI
Since version 0.24, Leela Chess Zero has official support for Android. Get the APK from here:
https://github.com/LeelaChessZero/lc0/releases/latest
After installing the APK you will need a chess app that supports the Open Exchange protocol, like the following:
- https://play.google.com/store/apps/details?id=org.petero.droidfish
- https://play.google.com/store/apps/details?id=com.google.android.chess
- https://play.google.com/store/apps/details?id=jwtc.android.chess
- https://play.google.com/store/apps/details?id=com.kalab.pgnviewer
Once you are in the chess app you can choose the Leela Chess Zero engine. This should be enough as the engine is ready to use with a built-in weights file. For those willing to use the plain engine binaries, get them here:
Architecture | OpenBLAS/Eigen | OpenCL |
---|---|---|
armv7-a | link | - |
aarch64 | link | - |
More back-ends will be added as soon as they are available.
These add support to Asus ZenPad tablets and other Android devices with Intel processor.
Architecture | OpenBLAS | Eigen |
---|---|---|
x86 | link | link |
Now that the Android builds are official there is no need to use other ones. The following builds are left here just for reference.
Architecture | Eigen | OpenBLAS | OpenCL |
---|---|---|---|
armv7-a | link | link | link |
aarch64 | link | link | link |
Architecture | Eigen | OpenBLAS | OpenCL |
---|---|---|---|
armv7-a | link | link | |
aarch64 | link | link | link |
These are special builds for those who couldn't or wouldn't fiddle with UCI Options and full paths, or maybe those using an App without that capability. These builds contain a small weights file embedded into the engine itself. You'll still be able to use other weights with them, but the embedded weights will load when you didn't specify one.
Architecture | Eigen | OpenBLAS | OpenCL |
---|---|---|---|
armv7-a LD2 | link | link | |
aarch64 LD2 | link | link | link |
armv7-a 48x5 | link | ||
aarch64 48x5 | link |
- LD2: Little Demon 2 is a strong 128x10 network from aart (https://lc0.org/ld2).
- The 48x5 network is a distilled network from dkappe (https://github.com/dkappe/leela-chess-weights/wiki/Distilled-Networks).
Note: The following steps are no longer needed but are left here for reference.
Follow these simple steps and you'll be running lc0 on your Android device. No root needed. Just the right engine, a weights file and a supported Chess App.
Here's a small video showing the steps described below, just in case you need to see it in action:
To watch the video, click here
There are currently two architectures supported: armv7-a and aarch64. In general older devices are 32-bit in which case you must download the armv7-a builds. The more recent devices are 64-bit so if you have one you should get the aarch64 builds that are much faster. If you are not sure which architecture to choose, use this app to lookup the architecture of your Android device.
All the 64-bit builds on this page are compiled targeting the API Level 21 (equivalent to Android 5.0 Lollipop). The 32-bit ones target the API Level 24 (Android 7.0 Nougat). Older Android versions may not work.
It's better to try either Eigen or OpenBLAS links first as they're easier to use and they should be faster too. As for the OpenCL ones, they are heavier and have some extra requirements:
- Device with OpenCL support (builds are linked to OpenCL version 2.0)
- Expect a very long delay on the first start of the engine and when a different network size is tried. This happens because the OpenCL tuner needs to optimize its parameters to your device.
The regular nets will work just fine. Get one from the usual place:
http://lczero.org/play/bestnets/
Any Chess App that supports external engines and setting the UCI Options should do. DroidFish and Chess for Android work quite well. Here you are the links:
https://play.google.com/store/apps/details?id=org.petero.droidfish
https://play.google.com/store/apps/details?id=com.google.android.chess
You'll need to install DroidFish and give it access to the storage. Then unzip the lc0 engine downloaded in the first step and copy it to the DroidFish/uci folder on your Android device. After that, just open DroidFish and select the engine lc0. But don't start analysis/play yet as you'll have to configure it first.
The auto-discover feature for the weights file won't work on Android, since some Chess Apps import the engine to a private directory. That's why you need to provide the engine with the full path to the weights file. You could use a file manager app that allows copying the full path of a file. Like this one:
https://play.google.com/store/apps/details?id=com.mi.android.globalFileexplorer
Navigate to the weights file you downloaded and copy its full path. Then paste it to the engine options, it's the first one.
If you followed until now then you should have an engine working. Start analysis and watch.