-
Notifications
You must be signed in to change notification settings - Fork 5
/
install
executable file
·50 lines (41 loc) · 1.52 KB
/
install
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
#!/bin/sh
#
# Chainer/CuPy Installer for Google Colaboratory
# https://github.com/chainer/google-colaboratory
#
if ! nvidia-smi > /dev/null; then
cat << '_EOF_'
********************************************************************************
GPU is not enabled!
Open "Runtime" > "Change runtime type" and set "Hardware accelerator" to "GPU".
********************************************************************************
_EOF_
exit 1
fi
if [ -d /usr/local/cuda-10.0 ]; then
# For CUDA 10.0 container
set -ex
apt -y -q install cuda-libraries-dev-10-0
pip install -q "cupy-cuda100 ${CUPY_VERSION}" "chainer ${CHAINER_VERSION}"
elif [ -d /usr/local/cuda-9.2 ]; then
# For CUDA 9.2 container
set -ex
apt -y -q install cuda-libraries-dev-9-2
pip install -q "cupy-cuda92 ${CUPY_VERSION}" "chainer ${CHAINER_VERSION}"
elif [ -e /usr/lib/x86_64-linux-gnu/libcudart.so.8.0 ]; then
# For CUDA 8.0 container
set -ex
apt -y -q install libcusparse8.0 libnvrtc8.0 libnvtoolsext1
ln -snf /usr/lib/x86_64-linux-gnu/libnvrtc-builtins.so.8.0 /usr/lib/x86_64-linux-gnu/libnvrtc-builtins.so
pip install -q "cupy-cuda80 ${CUPY_VERSION}" "chainer ${CHAINER_VERSION}"
else
cat << '_EOF_'
********************************************************************************
CUDA version could not be detected!
Try installing Chainer manually by: pip install chainer
********************************************************************************
_EOF_
exit 2
fi
set +ex
echo "Installation succeeded!"