lichess-bot-devs / lichess-bot

A bridge between Lichess bots and chess engines
GNU Affero General Public License v3.0
778 stars 450 forks source link

lc0 bot not playing #297

Closed SmileB4Deathz closed 3 years ago

SmileB4Deathz commented 3 years ago

Having problems with setting up an lc0 bot. It just won't play no matter what I do. Stockfish seems to work fine but leela just doesn't play. Here's my config:

token: "xxx"    # lichess OAuth2 Token
url: "https://lichess.org/"  # lichess base URL

engine:                      # engine settings
  dir: "./engines/"          # dir containing engines, relative to this project
  name: "lc0.exe"        # binary name of the engine to use
  protocol: "uci"            # "uci" or "xboard"
  uci_ponder: false           # think on opponent time; only works if "protocol" is "uci"
  polyglot:
    enabled: false           # activate polyglot book
    book:
      standard: # list of book file paths for variant standard
        - engines/book1.bin
        - engines/book2.bin
#      atomic: # list of book file paths for variant atomic
#        - engines/atomicbook1.bin
#        - engines/atomicbook2.bin
#      etc.
#      use the same pattern for giveaway, crazyhouse, horde, kingofthehill, racingkings, 3check as well
    min_weight: 1            # does not select moves with weight below min_weight (min 0, max: 65535)
    selection: "weighted_random" # move selection is one of "weighted_random", "uniform_random" or "best_move" (but not below the min_weight in 2. and 3. case)
    max_depth: 8             # half move max depth
#    engine_options: "go nodes 1"          # any custom command line params to pass to the engine
#   cpuct: 3.1
  uci_options:               # arbitrary UCI options passed to the engine
    Move Overhead: 100       # increase if your bot flags games too often
    Ponder: false
    Threads: 2               # max CPU threads the engine can use
    Hash: 216                # max memory (in megabytes) the engine can allocate
#    Log: "log.txt"
#    go_commands:             # additional options to pass to the UCI go command
#      nodes: 1               # Search so many nodes only.
#     depth: 5               # Search depth ply only.
#     movetime: 1000         # Integer. Search exactly movetime milliseconds.
# xboard_options:            # arbitrary xboard options passed to the engine
#   cores: "4"
#   memory: "4096"
#   egtpath:                 # dir containing egtb, relative to this project
#     gaviota: "Gaviota path"
#     nalimov: "Nalimov Path"
#     scorpio: "Scorpio Path"
#     syzygy: "Syzygy Path"
  silence_stderr: false      # some engines (yes you, leela) are very noisy

abort_time: 20               # time to abort a game in seconds when there is no activity
fake_think_time: false       # artificially slow down the bot to pretend like it's thinking
move_overhead: 1000          # increase if your bot flags games too often

challenge:                   # incoming challenges
  concurrency: 1             # number of games to play simultaneously
  sort_by: "best"            # possible values: "best", "first"
  accept_bot: true          # accepts challenges coming from other bots
  only_bot: false            # accept challenges by bots only
  max_increment: 180         # maximum amount of increment to accept a challenge. the max is 180. set to 0 for no increment
  min_increment: 0           # minimum amount of increment to accept a challenge
  max_base: 315360000        # maximum amount of base time to accept a challenge. the max is 315360000 (10 years)
  min_base: 0                # minimum amount of base time to accept a challenge
  variants:                  # chess variants to accept (http://lichess.org/variant)
    - standard
    - fromPosition
#   - antichess
#   - atomic
#   - chess960
#   - crazyhouse
#   - horde
#   - kingOfTheHill
#   - racingKings
#   - threeCheck
  time_controls:             # time controls to accept
    - bullet
    - blitz
    - rapid
    - classical
#   - correspondence
  modes:                     # game modes to accept
    - casual                 # unrated games
    - rated                  # rated games - must comment if the engine doesn't try to win
TheYoBots commented 3 years ago

Have you followed these steps to set up Lc0 https://github.com/ShailChoksi/lichess-bot#leelachesszero and this for docker https://github.com/ShailChoksi/lichess-bot#for-docker ?

Also make sure of the uci options. You shouldn’t use something invalid. https://github.com/LeelaChessZero/lc0/wiki/Lc0-options

Also could you please send your error logs.

SmileB4Deathz commented 3 years ago

@TheYoBots Thanks, turns out the "Hash" parameter is "NNCasheSize" for lc0. It's working now