-
Notifications
You must be signed in to change notification settings - Fork 0
/
installer
executable file
·93 lines (71 loc) · 2.17 KB
/
installer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
# Partially from http://lczero.org/dev/wiki/google-cloud-guide-lc0/
TOP=$(cd ${0%/*}; pwd)
export PATH="$PATH:/usr/local/cuda/bin"
install_cuda()
{
echo "Installing CUDA"
wget -nc https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.2.89-1_amd64.deb
sudo apt-get install -y --fix-missing --no-install-recommends dirmngr
sudo dpkg -i cuda-repo-ubuntu1804_10.2.89-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install -y cuda-10.2
rm -rf cuda cuda-repo-ubuntu1804_10.2.89-1_amd64.deb
}
install_cudnn()
{
echo "Installing CUDNN"
wget -nc http://developer.download.nvidia.com/compute/redist/cudnn/v7.6.5/cudnn-10.2-linux-x64-v7.6.5.32.tgz
tar -xzvf cudnn-10.2-linux-x64-v7.6.5.32.tgz
sudo cp -P cuda/include/cudnn.h /usr/local/cuda/include/cudnn.h
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
rm -rf cuda cudnn-10.2-linux-x64-v7.6.5.32.tgz
sudo nvidia-smi -pm 1
}
install_other()
{
echo "Installing other"
sudo apt-get install -y libopenblas-dev
sudo apt-get install -y ninja-build libprotobuf-dev protobuf-compiler python3-pip
sudo pip3 install meson
sudo apt-get install gcc-6 g++-6 -y
sudo apt-get install clang-6.0 -y
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60 --slave /usr/bin/g++ g++ /usr/bin/g++-6
}
install_lc0()
{
echo "Installing lc0"
rm -rf lc0
git clone --recurse-submodules https://github.com/LeelaChessZero/lc0.git
cd lc0 && git checkout $(git tag --list |grep -v rc |tail -1)
CC=clang-6.0 CXX=clang++-6.0 ./build.sh
mv ./build/release/lc0 lc0
}
install_weights()
{
WEIGHTS="https://www.comp.nus.edu.sg/~sergio-v/t40/256x20/256x20-t40-1541.pb.gz"
mkdir -p weights
cd weights
wget -nc $WEIGHTS
ln -sf 256x20-t40-1541.pb.gz default
}
install_engine()
{
cp $TOP/engine ~
}
LIST=$*
[ "$LIST" ] || LIST="cuda cudnn other lc0 weights engine"
for i in $LIST
do
case $i in
cuda|cudnn|other|lc0|weights|engine)
cd ~
install_$i
;;
*)
echo "Cannot install $i" >&2
;;
esac
done