-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_instance.sh
More file actions
122 lines (91 loc) · 3.47 KB
/
install_instance.sh
File metadata and controls
122 lines (91 loc) · 3.47 KB
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#!/bin/bash
########################
#Ding Shuya, Sept 2018
########################
########################
# Configure the VM machine with Ubuntu 16.04 LTS, Tesla K80 GPU
########################
# Command line
# source ./install_instance.sh
##################
# Install CUDA 9.0 https://medium.com/@zhanwenchen/install-cuda-and-cudnn-for-tensorflow-gpu-on-ubuntu-79306e4ac04e
##################
cd
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run
chmod +x cuda_9.0.176_384.81_linux-run
./cuda_9.0.176_384.81_linux-run --extract=$HOME
sudo ./cuda-linux.9.0.176-22781540.run
sudo ./cuda-samples.9.0.176-22781540-linux.run
export PATH=/usr/local/cuda-9.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf"
sudo ldconfig
# sudo vim /etc/environment
# add :/usr/local/cuda/bin (including the ":") at the end of the PATH="/blah:/blah/blah" string (inside the quotes).
cd /usr/local/cuda-9.0/samples
sudo make
cd /usr/local/cuda/samples/bin/x86_64/linux/release
##################
# Install CUDNN 9.0 Download cudnn runtime, deb, doc
##################
sudo dpkg -i libcudnn7_7.3.1.20-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.3.1.20-1+cuda9.0_amd64.deb
sudo dpkg -i libcudnn7-doc_7.3.1.20-1+cuda9.0_amd64.deb
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/extras/CUPTI/lib64' >> ~/.bashrc
########################
# Install miniconda
########################
sudo apt-get update
sudo apt-get -y upgrade
curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x ~/miniconda.sh
./miniconda.sh -b
echo "PATH=~/miniconda3/bin:$PATH" >> ~/.bashrc
source ~/.bashrc
########################
# Install python libraries
########################
conda install -y python=3.6 numpy scipy ipython mkl seaborn pandas matplotlib scikit-learn networkx
conda install -y pytorch=0.4.1 torchvision cuda92 -c pytorch
########################
# Download project from github
########################
conda install -y git
git clone https://github.com/di0002ya/ADM
########################
# Install torch
########################
curl -s https://raw.githubusercontent.com/torch/ezinstall/master/install-deps | bash
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
source ~/.bashrc
########################
# Install Jupyter
########################
sudo apt-get install build-essential python3-dev
sudo apt-get install python3-pip
pip3 install jupyter -i http://pypi.douban.com/simple
########################
# Install iTorch
########################
sudo apt-get install libzmq3-dev
git clone https://github.com/facebook/iTorch.git
cd iTorch
luarocks make
########################
# Jupyter Configuration
########################
jupyter notebook --generate-config
echo "c = get_config()" >> .jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.ip = '*'" >> .jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.open_browser = False" >> .jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.port = 8888" >> .jupyter/jupyter_notebook_config.py
echo "c.NotebookApp.token='deeplearning'" >> .jupyter/jupyter_notebook_config.py
########################
# Run notebooks remotely
########################
# tmux
#tmux new -s deeplearning -d
#tmux send-keys "jupyter notebook" C-m
# use any web browser : http://xx.xx.xx.xx:8888