-
Notifications
You must be signed in to change notification settings - Fork 1
/
installation notes
172 lines (132 loc) · 5.6 KB
/
installation notes
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
I used rufus to install linux 16.04 from usb iso
i found the following to be extremely useful since nvidia drivers tend to create errors especially after kernel updates:
echo $(dpkg -l "*$(uname -r)*" | grep image | awk '{print $2}') hold | dpkg --set-selections
After instalation Instalation i followed these instructions to install the relevant nvidia driver:
http://yangcha.github.io/GTX-1080/
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-375
sudo apt-get install mesa-common-dev
sudo apt-get install freeglut3-dev
restart your system to allow changes to take effect
Install CUDA 8.0RC. Download runfile(local). from https://developer.nvidia.com/cuda-release-candidate-download then:
hit ctrl+alt+f3 to enter tty3
sudo sh ~/Downloads/cuda_8.0.27_linux.run --override
When install CUDA 8, make sure that when asked if you would like to install the old drivers - you refuse
you will get a message that installation is not complete since you did not install the old driver - that's fine!
sudo sh ~/Downloads/cuda_8.0.27.1_linux.run
I ran the following two lines and added them to the end of the .bashrc file
(which is located in the home directory - if you can't see it press ctrl+H when inside the folder)
an alternative to manual editing of the file could be:
echo "export CUDA_HOME=/usr/local/cuda" >> ~/.bashrc
echo "export PATH=/usr/local/cuda/bin:$PATH" >> ~/.bashrc
echo "export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}" >> ~/.bashrc
echo "export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}" >> ~/.bashrc
restart your system
once gpu+cuda+path were taken care of we can now check the installation is correct by:
nvidia-smi
next I added software and libraries according to the list on: https://www.douban.com/note/568373446/
dowload cudnn file from nvidia
https://developer.nvidia.com/rdp/cudnn-download #I used v5.1 linux
after dowloading cudnn file from nvidia:
sudo apt-get install build-essential wget
sudo apt-get install gcc-4.8 gcc-4.8-multilib g++-4.8 g++-4.8-multilib
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 60
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
sudo update-alternatives --config gcc
select 4.8
sudo update-alternatives --config g++
select 4.8
# sudo update-alternatives --remove gcc /usr/bin/gcc-4.8
# sudo update-alternatives --remove g++ /usr/bin/g++-4.8
cd Downloads
tar -xf cudnn-8.0-linux-x64-v5.1.tgz
sudo cp -f cuda/lib64/*.* /usr/local/cuda/lib64/
sudo cp -f cuda/include/*.* /usr/local/cuda/include/
this extracts & copies the relevant files to the desired location
perform deviceQuery to make sure everything went well:
cd /usr/local/cuda/samples/1_Utilities/deviceQuery
sudo make
./deviceQuery
install python-numpy,scipy,dev,pip, nose...
sudo apt-get install python-numpy python-scipy python-dev python-pip python-nose libopenblas-dev python-pandas
#install theano & keras
sudo pip install Theano
sudo pip install keras
echo "[global]" > ~/.theanorc
echo "floatX = float32" >> ~/.theanorc
echo "device = gpu0" >> ~/.theanorc
echo "[nvcc]" >> ~/.theanorc
echo "fastmath = True" >> ~/.theanorc
sudo apt-get update
sudo pip install matplotlib
sudo pip install bokeh
sudo pip install seaborn
sudo pip install lasagne
sudo apt-get install libhdf5-dev
sudo apt-get install cython
sudo pip install h5py
sudo pip install nolearn
sudo pip install jupyter
#install opencv - by tutorial from http://www.pyimagesearch.com/2015/06/22/install-opencv-3-0-and-python-2-7-on-ubuntu/
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential cmake git pkg-config
sudo apt-get install libjpeg8-dev libtiff5-dev libjasper-dev libpng12-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libavcodec-dev libavformat-dev libswscale-dev libv4l-dev
sudo apt-get install libatlas-base-dev gfortran
# the following part is not mandatory but is recommended:
sudo pip install virtualenv virtualenvwrapper
sudo rm -rf ~/.cache/pip
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
source ~/.bashrc
mkvirtualenv cv
#going back to the installation process:
cd ~
git clone https://github.com/Itseez/opencv.git
cd opencv
git checkout 3.1.0
cd ~
git clone https://github.com/Itseez/opencv_contrib.git
cd opencv_contrib
git checkout 3.1.0
cd ~/opencv
mkdir build
cd build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_C_EXAMPLES=OFF \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \
-D BUILD_EXAMPLES=ON ..
# as to the time of writing this set of commands there are still some bugs within the files
#so the following fixes should be made:
in the file modules/cudalegacy/src/graphcuts.cpp - change line 45 from:
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
to:
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000)
in the file /opencv_contrib-3.1.0/modules/hdf/include/opencv2/hdf/hdf5.hpp - change line 40 from:
#include <hdf5.h>
to:
#include "/usr/include/hdf5/serial/hdf5.h"
make -j4
sudo make install
sudo ldconfig
#if installed through the virtual environment
cd ~/.virtualenvs/cv/lib/python2.7/site-packages/
ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so
workon cv
#verify the installation:
python
import cv2
cv2.__version__
# should get '3.1.0'
# install xgboost
sudo pip install xgboost
sudo add-apt-repository ppa:mystic-mirage/pycharm
sudo apt update
sudo apt install pycharm-community