Caffe Installation on Ubuntu 14.04 log
Log
Caffe Installation
------------------
Versions
Cuda 6.5
Cudnn V1 for Cuda 6.5
Boost 1.55
OpenBLAS libopenblas-dev (0.2.8-6ubuntu1)
opencv-2.4.10
----------------------------
OpenBLAS
sudo apt-get install libopenblas-dev
----------------------------
Boost 1.55
Download and
sudo apt-get update
sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev
./bootstrap.sh --prefix=/usr/local
sudo ./b2 --with=all -j 8 install
----------------------------
Cuda 6.5
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler libhdf5-serial-dev
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev
Download run file from cuda site
press ctrl-alt-F1
(become terminal tt1)
>> sudo /usr/bin/nvidia-uninstall
>> sudo service mdm stop
>> ./cuda_6.5.14_linux_64.run
-- follow instruction until installed complete
>> sudo service mdm start
restart computer
>> sudo service mdm stop
>> ./cuda_6.5.14_linux_64.run
-- If you see "driver installed", then installation is complete
Open terminal
click on the middle of the terminal
goto profile>profile preference
choose title and command tab
select run command as login shell
vi ~/.profile
add to PATH /usr/local/cuda-6.5/bin
add to LD_LIBRARY_PATH /usr/local/cuda-6.5/lib64
----------------------------
cudnn V1.
Download, extract the tar file
sudo cp -r cudnn-6.5-linux-R1 /usr/local
add to PATH /usr/local/cudnn-6.5-linux-R1
add to LD_LIBRARY_PATH /usr/local/cudnn-6.5-linux-R1
----------------------INSTALL CAFFE-------------------
cp Makefile.config.example Makefile.config
make -j5 all
make -j5 test
make runtest
make pycaffe
make mat
----------------------INSTALL PYTHON PREREQUESITE----
sudo apt-get install numpy
sudo pip install matplotlib
sudo pip install numexpr
sudo pip install tables
sudo apt-get install scipy
=========END =========
--------------------------- End Note ----------------------------------
Sometime, Cuda 6.5 may conflict with Neuveau
1. create file blacklist
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
MATLAB_DIR := /usr/local/MATLAB/R2012b
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# PYTHON_INCLUDE := $(HOME)/anaconda/include \
# $(HOME)/anaconda/include/python2.7 \
# $(HOME)/anaconda/lib/python2.7/site-packages/numpy/core/include
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(HOME)/anaconda/lib
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/cuda-6.5/include /usr/local/cudnn-6.5-linux-R1
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/cuda-6.5/lib64 /usr/local/cudnn-6.5-linux-R1
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
Caffe Installation
------------------
Versions
Cuda 6.5
Cudnn V1 for Cuda 6.5
Boost 1.55
OpenBLAS libopenblas-dev (0.2.8-6ubuntu1)
opencv-2.4.10
----------------------------
OpenBLAS
sudo apt-get install libopenblas-dev
----------------------------
Boost 1.55
Download and
sudo apt-get update
sudo apt-get install build-essential g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev
./bootstrap.sh --prefix=/usr/local
sudo ./b2 --with=all -j 8 install
----------------------------
Cuda 6.5
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler libhdf5-serial-dev
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev
Download run file from cuda site
press ctrl-alt-F1
(become terminal tt1)
>> sudo /usr/bin/nvidia-uninstall
>> sudo service mdm stop
>> ./cuda_6.5.14_linux_64.run
-- follow instruction until installed complete
>> sudo service mdm start
restart computer
>> sudo service mdm stop
>> ./cuda_6.5.14_linux_64.run
-- If you see "driver installed", then installation is complete
Open terminal
click on the middle of the terminal
goto profile>profile preference
choose title and command tab
select run command as login shell
vi ~/.profile
add to PATH /usr/local/cuda-6.5/bin
add to LD_LIBRARY_PATH /usr/local/cuda-6.5/lib64
----------------------------
cudnn V1.
Download, extract the tar file
sudo cp -r cudnn-6.5-linux-R1 /usr/local
add to PATH /usr/local/cudnn-6.5-linux-R1
add to LD_LIBRARY_PATH /usr/local/cudnn-6.5-linux-R1
----------------------INSTALL CAFFE-------------------
cp Makefile.config.example Makefile.config
make -j5 all
make -j5 test
make runtest
make pycaffe
make mat
----------------------INSTALL PYTHON PREREQUESITE----
sudo apt-get install numpy
sudo pip install matplotlib
sudo pip install numexpr
sudo pip install tables
sudo apt-get install scipy
=========END =========
--------------------------- End Note ----------------------------------
Sometime, Cuda 6.5 may conflict with Neuveau
1. create file blacklist
$ vi /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau blacklist lbm-nouveau options nouveau modeset=0 alias nouveau off alias lbm-nouveau off
Then save
2. do this command
echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
3. reboot
$ update-initramfs -u $ reboot
4. Then Try to install Cuda 6.5 using above instruction again
---------------- Makefile.config ---------------------## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# To customize your choice of compiler, uncomment and set the following.
# N.B. the default for Linux is g++ and the default for OSX is clang++
# CUSTOM_CXX := g++
# CUDA directory contains bin/ and lib/ directories that we need.
CUDA_DIR := /usr/local/cuda
# On Ubuntu 14.04, if cuda tools are installed via
# "sudo apt-get install nvidia-cuda-toolkit" then use this instead:
# CUDA_DIR := /usr
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50
# BLAS choice:
# atlas for ATLAS (default)
# mkl for MKL
# open for OpenBlas
BLAS := open
# Custom (MKL/ATLAS/OpenBLAS) include and lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# BLAS_INCLUDE := /path/to/your/blas
# BLAS_LIB := /path/to/your/blas
# This is required only if you will compile the matlab interface.
# MATLAB directory should contain the mex binary in /bin.
MATLAB_DIR := /usr/local/MATLAB/R2012b
# MATLAB_DIR := /Applications/MATLAB_R2012b.app
# NOTE: this is required only if you will compile the python interface.
# We need to be able to find Python.h and numpy/arrayobject.h.
PYTHON_INCLUDE := /usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include path:
# PYTHON_INCLUDE := $(HOME)/anaconda/include \
# $(HOME)/anaconda/include/python2.7 \
# $(HOME)/anaconda/lib/python2.7/site-packages/numpy/core/include
# We need to be able to find libpythonX.X.so or .dylib.
PYTHON_LIB := /usr/lib
# PYTHON_LIB := $(HOME)/anaconda/lib
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/local/cuda-6.5/include /usr/local/cudnn-6.5-linux-R1
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/local/cuda-6.5/lib64 /usr/local/cudnn-6.5-linux-R1
BUILD_DIR := build
DISTRIBUTE_DIR := distribute
# Uncomment for debugging. Does not work on OSX due to https://github.com/BVLC/caffe/issues/171
# DEBUG := 1
# The ID of the GPU that 'make runtest' will use to run unit tests.
TEST_GPUID := 0
4.3. Disabling Nouveau
ตอบลบTo install the Display Driver, the Nouveau drivers must first be disabled. Each distribution of Linux has a different method for disabling Nouveau.
The Nouveau drivers are loaded if the following command prints anything:
$ lsmod | grep nouveau
4.3.1. Fedora
Create a file at /usr/lib/modprobe.d/blacklist-nouveau.conf with the following contents:
blacklist nouveau
options nouveau modeset=0
Regenerate the kernel initramfs:
$ sudo dracut --force
4.3.2. RHEL/CentOS
Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
blacklist nouveau
options nouveau modeset=0
Regenerate the kernel initramfs:
$ sudo dracut --force
4.3.3. OpenSUSE
Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
blacklist nouveau
options nouveau modeset=0
Regenerate the kernel initrd:
$ sudo /sbin/mkinitrd
4.3.4. SLES
No actions to disable Nouveau are required as Nouveau is not installed on SLES.
4.3.5. Ubuntu
Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:
blacklist nouveau
options nouveau modeset=0
Regenerate the kernel initramfs:
$ sudo update-initramfs -u
Read more at: http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#ixzz3Y7DBguTS
Follow us: @GPUComputing on Twitter | NVIDIA on Facebook
For today's version of Caffe, use cudnn v.2, namely
ตอบลบcudnn-6.5-linux-x64-v2,
instead.
Install Python libs
ตอบลบsudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose cython
sudo pip install scipy numpy ipython pymatbridge scikit-image h5py
DIGITS python libs
ตอบลบsudo pip install flask-ext werkzeug wtforms gevent flask-wtf lmdb pydot
sudo apt-get install python-dev python-pip graphviz python-pil python-numpy python-scipy python-protobuf python-gevent python-Flask python-flaskext.wtf gunicorn python-h5py
ลบsudo pip install -r requirements.txt
cuda_7.5.18_linux.run with cudnn-7.0-linux-x64-v4.0 also works
ตอบลบความคิดเห็นนี้ถูกผู้เขียนลบ
ตอบลบInstall Python
ตอบลบsudo apt-get install python-pip python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
cd python
for req in $(cat requirements.txt); do pip install $req; done
sudo pip install runipy