-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.md.bak
133 lines (100 loc) · 3.37 KB
/
README.md.bak
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
123
124
125
126
127
128
129
130
131
132
133
Setting up a Deep Learning Station from Scratch
================================================
### (For Ubuntu 16.04.1 LTS freshly installed)
Versions To be installed: (Latest as of Jan 12, 2017)
-----------------------------------------------------
- Python 2.7.12
- Python 3.5.2
- Nvidia 367 Driver
- CUDA 8
- cuDNN 5.1
- Theano 0.8.2
- TensorFlow 0.12.1
- Keras 1.2.0
- and the latest version of common "build-essential" dev tools in ubuntu
(git, cmake, python2, python3, gcc, g++, gfortran etc...)
*Note*:
1) Assumes Ubuntu is fresh out of the oven, but shouldn't matter, apt-get will ignore already installed packages
2) Installs everything both for python2 and python3
3) There are couple of neural net code examples that should successfully run at the end if everything works!
Step by Step Installation:
-------------------------
Basically all you need to do is to run the shell scripts `.sh` in order
#### 0) `0_basic_nvidia_drivers.sh`: Installs the basic tools (python2, python3 etc...) and the nvidia driver
Equivalent to:
```shell
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install vim -y
sudo apt-get install build-essential -y
sudo apt-get install python -y
sudo apt-get install python-pip -y
sudo apt-get install python3 -y
sudo apt-get install python3-pip -y
sudo apt-get install git -y
sudo apt-get install cmake -y
sudo apt-get install pkg-config -y
sudo apt-get autoremove -y
sudo apt-get install linux-headers-$(uname -r) -y
sudo apt-get install nvidia-367 -y
```
*Check GPU is properly detected and driver is installed by running:* `nvidia-smi`
#### 1) `1_nvidia_cuda8.0.sh`: Downloads and installs CUDA 8
Equivalent to:
```shell
sudo apt-get install wget -y
wget -O /tmp/cuda.deb 'http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.44-1_amd64.deb'
sudo dpkg -i /tmp/cuda.deb
sudo apt-get update
sudo apt-get install cuda -y
```
Adds CUDA library directory to the PATH:
```shell
echo 'export PATH=/usr/local/cuda-8.0/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
```
*Check CUDA compiler wrapper is working by running:* : `nvcc --version`
At this point you need to manually register and download the cuDNN (Optional, but faster performance!)
#### 2) `2_nvidia_cuDNN5.1.sh`: Installs the cuDNN5.1 (Optional)
*First [register] and download cuDNN5.1 from nvidia:* <https://developer.nvidia.com/cudnn> th
Equivalent to:
```shell
cd ~/Downloads
tar -xvf cudnn-8.0*.tgz
cd cuda
sudo cp */*.h /usr/local/cuda/include/
sudo cp */libcudnn* /usr/local/cuda/lib64/
sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
```
#### 3) `3_dl_TF_theano_keras.sh`: Installs Theano, Tensorflow and Keras
Equivalent to:
```shell
pip --version || exit 1
pip3 --version || exit 1
pip install tensorflow-gpu
pip3 install tensorflow-gpu
sudo apt-get install libopenblas-dev -y
pip install Theano
pip3 install Theano
```
Sets up `.theanorc` for GPU device:
```bash
echo "[cuda]" > ~/.theanorc
echo "root = /usr/local/cuda-8.0/lib64" >> ~/.theanorc
echo "" >> ~/.theanorc
echo "[global]" >> ~/.theanorc
echo "device = gpu" >> ~/.theanorc
echo "floatX = float32" >> ~/.theanorc
```
And last one:
```shell
pip install keras
pip3 install keras
```
#### 4) Test everything working: (all python script should run)
```shell
python mnist.py
python theano_check.py
python cifar10_cnn.py
```