Skip to content

Instantly share code, notes, and snippets.

@danmaas
Last active December 26, 2018 22:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danmaas/7c959f98ba64c593f111cf23c1e123a8 to your computer and use it in GitHub Desktop.
Save danmaas/7c959f98ba64c593f111cf23c1e123a8 to your computer and use it in GitHub Desktop.
Leela Zero remote wrapper script
#!/bin/sh
# this is a wrapper script that runs leelaz via SSH on a fast cloud instance
# suitable as a drop-in replacement for the leelaz command used by the Lizzie GUI
# see general instructions at https://docs.google.com/document/d/1P_c-RbeLKjv1umc4rMEgvIVrUUZSeY0WAtYHjaxjD64/edit
# use p3.2xlarge instance, "Deep Learning Base AMI (Ubuntu) Version 14.0+" (ami-012b19f1736b6aae8)
# login:
# - nvidia-smi (verify GPU exists)
# - sudo apt-get install libboost-dev libboost-program-options-dev libboost-filesystem-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev zlib1g-dev clinfo cmake curl git zip
# - git clone https://github.com/gcp/leela-zero -b next
# - cd leela-zero && git submodule update --init --recursive && mkdir build && cd build && cmake .. && cmake --build .
# get network file: (see https://zero.sjeng.org for latest)
# - curl -O http://zero.sjeng.org/networks/939ebbcc73423bba129656a68d9c0f9e0db88596619487dee7b4abd159e781fa.gz
# - ln -s 939ebbcc73423bba129656a68d9c0f9e0db88596619487dee7b4abd159e781fa.gz network.gz
# test:
# - ./leelaz -w network.gz
ARGS="${*}"
exec ssh -t -i ~/.ssh/mykey.pem ubuntu@myinstance.compute-1.amazonaws.com "cd ~/leela-zero/build && ./leelaz ${ARGS}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment