Nibbler - Leela Chess Zero (Lc0) interface

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by Max »

Iconic Mephisto III-S Glasgow searches only a few nodes per second. Lc0 is limited to search 2 nodes.

Can the TCEC 15 winner compete without search against the champion from 1984 at level 2?
[pgn][Event "Nibbler 0.5.8 test"] [Site "MacBook Air"] [Date "2019.06.23"] [Round "?"] [White "Lc0 0.21.2 netT40.T8.610 (node limit 2)"] [Black "Mephisto III-S Glasgow (M.E.S.S. 0.205)"] [Result "1-0"] [ECO "C42"] [TimeControl "Level 2"] 1.e4 e5 2.Nf3 Nf6 { Mephisto III likes this opening } 3.Nxe5 d6 4.Nf3 Nxe4 5.d4 d5 6.Bd3 Be7 7.O-O Nc6 { last book move for Mephisto III } 8.Re1 f5 9.c4 O-O 10.cxd5 Qxd5 11.Nc3 Nxc3 12.bxc3 Bd7 13.Rb1 Qxa2 14.Rb2 Qd5 15.Rxb7 Bd8 16.Ba3 Nxd4 17.Nxd4 Qxb7 18.Bc4+ Rf7 19.Nxf5 Qc6 20.Bd5 Qxc3 21.Bxf7+ Kxf7 22.Qxd7+ Kg6 23.Qe8+ Kf6 24.Qe6+ Kg5 25.h4+ Kh5 26.Ng3+ ( 26.Qe8+ g6 27.Qe2+ Qf3 28.Qxf3# ) 26...Qxg3 27.fxg3 Bf6 28.g4+ Kxh4 29.g5 Bd4+ 30.Kh2 Bc3 31.g3+ Kh5 32.g4+ Kh4 33.Kg2 Bxe1 34.Qxe1+ Kxg4 35.Qd1+ Kh4 36.Qd4+ ( 36.Bc1 h6 37.Qh1+ Kg4 38.Qh3# ) 36...Kh5 37.Kg3 Re8 38.Qh4+ Kg6 39.Qa4 Re3+ 40.Kf2 Rh3 41.Qe8+ Kxg5 42.Qd8+ Kg6 43.Be7 Rh2+ 44.Kg3 Rb2 45.Qe8+ Kf5 46.Qf7+ Ke4 47.Qe6+ Kd3 48.Qd7+ Ke4 49.Qc6+ Kd3 50.Qd5+ Kc2 51.Qc4+ Kb1 52.Qf1+ Kc2 53.Qe2+ Kb3 54.Qd3+ Ka2 55.Qa3+ Kb1 56.Qxa7 Kc2 57.Qxc7+ Kd3 58.Qd8+ Ke4 59.Qc8 h6 60.Qc4+ Ke3 61.Bc5+ Kd2 62.Qd4+ Kc2 63.Qe4+ Kd2 64.Bb4+ Rxb4 65.Qxb4+ Kd3 66.Qg4 h5 67.Qxh5 Kc4 68.Qg6 Kd4 69.Qxg7+ Kd5 70.Kf4 Kc4 71.Ke4 Kb5 72.Kd5 Kb6 73.Qh7 Kb5 74.Qb7+ Ka4 75.Kc4 Ka5 76.Qb5#[/pgn]
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
User avatar
pohl4711
Posts: 2433
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by pohl4711 »

This tool is absolutely awesome !!!
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by Max »

pohl4711 wrote: Sun Jun 23, 2019 2:24 pm This tool is absolutely awesome !!!
I totally agree with you Stefan!

And it runs (with a little help) perfect on a mac too.
  • Download and install Node.js from https://nodejs.org/en/ . Now install electron: type in a terminal session "npm install -g electron".
  • Download source code of Nibbler and unpack it to a directory of your choice. Create there your config.json file. Then type in a terminal "electron ."
  • To make life easier, create a shell script for starting Nibbler. With a text editor create a new document; name it nibbler.sh. It could look like:

Code: Select all

#!/bin/bash
export PATH="/usr/local/bin:$PATH"

cd <Ablolute path to your Nibbler directory>
#e.g. cd /Users/max/chess/Lc0/Nibbler
electron .
  • When your script works as expected - don't forget to make it executable 8-) (chmod u+x nibbler.sh) - build a macOS application. It's easy: open the Applescript editor and create a new document. Type this line only:

Code: Select all

do shell script "<Absolute path to your Nibbler start script>"
#e.g. do shell script "/Users/max/chess/Lc0/nibbler.sh"
  • In Applescript editor File -> Save As (CMD-S) and choose File Format as Application. Done, you created your Nibbler app :!:
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
Steppenwolf
Posts: 75
Joined: Thu Jan 31, 2019 4:54 pm
Full name: Sven Steppenwolf

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by Steppenwolf »

This is a really Great tool!!! :D
Thanks also for the description to build Nibbler for the Mac.
Nevertheless, I am not that expert, please can you post a macOS binary available for the community?

How you handle this with the lc0 engine under macOS? There is no actual CUDA Driver under Mojave?

The best thing TMO would be to provide a bundled ready app, where all the things (GUI, engine and Network file) are inside.

Your help will be appreciated. Thanks!
User avatar
pohl4711
Posts: 2433
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by pohl4711 »

Guenther wrote: Fri Jun 21, 2019 8:43 pm
Norbert Raimund Leisner wrote: Fri Jun 21, 2019 7:43 pm Has anybody tried out Nibbler GUI with other UCI-compatible engines e.g SF, Fire? cf. https://github.com/fohristiwhirl/nibbler/issues/25
Why should we? It is designed for Leela and he already answered you at github...
But the cool thing is, Nibbler works with LeelaFish, too.

Here my config.json-file for Nibbler (Stockfish in the same folder as LeelaFish):

{
"path": "C:\\LeelaFish\\lc0.exe",

"options": {
"Backend": "cudnn-fp16",
"AuxEngineFile": "C:\\LeelaFish\\stockfish_190622_bmi2.exe",
"AuxEngineOptions": "Hash=1024;Threads=4",
"AuxEngineDepth": 30
},

"args": [],

"width": 1280,
"height": 835,
"board_size": 640,
"movelist_height": 110,
"board_font": "18px Arial",
"light_square": "#dadada",
"dark_square": "#b4b4b4",
"active_square": "#66aaaa",
"best_colour": "#66aaaa",
"good_colour": "#66aa66",
"bad_colour": "#cccc66",
"terrible_colour": "#cc6666",
"bad_move_threshold": 0.02,
"terrible_move_threshold": 0.04,
"uncertainty_cutoff": 0.1,
"arrowhead_type": 0,
"show_n": true,
"show_p": true,
"show_u": false,
"max_info_lines": 10,
"update_delay": 170,
"search_nodes": "infinite",
"save_enabled": false,
"logfile": null,
"log_info_lines": false
}
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by Max »

Steppenwolf wrote: Tue Jun 25, 2019 11:57 am This is a really Great tool!!! :D
Thanks also for the description to build Nibbler for the Mac.
Nevertheless, I am not that expert, please can you post a macOS binary available for the community
Sorry Sven, but I used only the build script provided by the Leela developers. And the created binary depends on libraries you have to have installed on your mac. Don't know how to create it as a standalone mac executable.

Yes it's painfull, but atm you have to follow the guide "Building Leela" at https://github.com/LeelaChessZero/lc0 . It's not (very) difficult to create an openCL/blas binary yourself with these steps. And a slow Lc0 - combined with Nibbler - makes fun too :D .

Leela runs here on my Air only at the slow blas backend, openCL is even worse (slower and producing much more heat).
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by Max »

Max wrote: Tue Jun 25, 2019 4:24 pm Yes it's painfull, but atm you have to follow the guide "Building Leela" at https://github.com/LeelaChessZero/lc0 .
Maybe not?!

I uploaded an archive Lc0-mac.7z with my 4 versions to https://1drv.ms/u/s!AgnMt2KeIBxsgow97q8L8kEU10R1sQ

- lc0-0.21.2-BLAS(Apple-vecLib)
- lc0-0.21.2-BLAS(Intel-MKL)
- lc0-0.21.2-BLAS(openBLAS)
- lc0-0.21.2-openCL

The openCL and Apple vecLib binaries might run on your mac. Your cpu has to support AVX2.

For the other two, at least Intel MKL or openBLAS has to be installed on your system.

:arrow: Good luck (don't forget to make the lc0-files executable).
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
Norbert Raimund Leisner
Posts: 1643
Joined: Tue May 20, 2008 4:57 pm
Location: Augsburg - Germany

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by Norbert Raimund Leisner »

Nibbler 0.78 GUI https://github.com/fohristiwhirl/nibble ... indows.zip works now without a valid configuration file !

evoke nibbler.exe > Engine: find engine > Engine: switch weights file (you can ignore the error message after the choice of the engine) cf. https://github.com/fohristiwhirl/nibbler/issues/50 (error flag: --backend must be one of the following values.....)

I use for my Intel i5 Quad, 4 GB RAM, standard-graphic card these components:
https://github.com/LeelaChessZero/lc0/r ... s-blas.zip (Windows Blas)
https://lc0.org/ld2 (Weights File)

then you can select > engine plays only white (or black)

Norbert
Max
Posts: 247
Joined: Tue Apr 13, 2010 10:41 am

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by Max »

Nibbler version 1.01 was just released at https://github.com/fohristiwhirl/nibbler/releases

No need for manual settings any more. Just download, unzip to a folder of your choice and start the Nibbler binary.

If this is your first start, Nibbler will probably not find the Lc0 engine and your weights file.
  • In this case, you notice a blue message "Engine not found...". Just open the menu entry Engine and click "Choose weights file..." and/or "Choose engine...".
Board and font size can now be changed with the menu entry Sizes. Your changes get saved.
Engine.png
Hope we're not just the biological boot loader for digital super intelligence. Unfortunately, that is increasingly probable - Elon Musk
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Nibbler - Leela Chess Zero (Lc0) interface

Post by zullil »

Max wrote: Sun Aug 04, 2019 6:47 pm Nibbler version 1.01 was just released at https://github.com/fohristiwhirl/nibbler/releases

No need for manual settings any more. Just download, unzip to a folder of your choice and start the Nibbler binary.

If this is your first start, Nibbler will probably not find the Lc0 engine and your weights file.
  • In this case, you notice a blue message "Engine not found...". Just open the menu entry Engine and click "Choose weights file..." and/or "Choose engine...".
Board and font size can now be changed with the menu entry Sizes. Your changes get saved.

Engine.png
Some further info:

Nibbler will now create config.json for you, and (under Linux) it will be saved in ~/.config/Nibbler. From Nibbler you can set some of the preferences in config.json. It does not appear that you can set many of Lc0's parameters, so these need to be added manually to config.json or placed in your lc0.config file.