您的位置:首页 > Web前端

install caffe

2015-07-04 08:57 281 查看
1)  download Universal-USB-Installer-1.9.6.0.exe, ubuntu-14.04.2-desktop-amd64.iso

mount usb flash to be an install device.

2) first time, using the usb, select UEFI. and then select the general settings.

3) when say install, select others to partition: select free space, '+' 

 20000 primary begining of the space , use as Ext4 mount point /

4000 logical beginning..as above use as swap area

500 as above use as Ext4 /boot

the rest as above /home

done ubuntu install

install cuda

1)verify if you have requirements

$ lspci | grep -i nvidia 

check if the type support cuda 

https://developer.nvidia.com/cuda-gpus

$ uname -m && cat /etc/*release

check if it is x86_64

$ gcc --version Verify the System Has gcc Installed

2) CTRL+ALT+F1

$ sudo stop lightdm

disable nouveau

$ cd /home/username
$ touch nvdia-graphics-drivers.conf 
$ sudo vi nvdia-graphics-drivers.conf
write in:blacklist nouveau

$ sudo cp nvdia-graphics-drivers.conf /etc/modprobe.d 

vi /etc/default/grub,add 

rdblacklist=nouveau nouveau.modeset=0 

reboot

$ sudo sh cuda_6.5.11_rc_linux_64.run

$ sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

$ sudo start lightdm
 

 Environment Setup

$ export PATH=/usr/local/cuda-6.5/bin:$PATH

$ export LD_LIBRARY_PATH=/usr/local/cuda-6.5/lib64:$LD_LIBRARY_PATH

Verify the I
15d76
nstallation
a. 验证驱动的版本,其实主要是保证驱动程序已经安装正常了
$ cat /proc/driver/nvidia/version
b. Compiling the Examples
$ nvcc -V

$ cd /home/username/NVIDIA_CUDA-6.5_Samples
$ make

$ cd /bin/x86_64/linux/release

$ ./deviceQuery
$ ./bandwidthTest

cuda done installation

caffe
1) blas
 i used openblas easy fast need sudo apt-get install gFortran 

$ cd /etc/ld.so.conf.d
$ sudo touch openblas.conf
$ sudo vi openblas.conf

/opt/OpenBLASH/lib

$ sudo touch cuda.conf
$ sudo vi cuda.conf
/usr/local/cuda/lib64
/lib

 $ sudo ldconfig -v

2) opencv
some problems here with cuda

sudo
 
apt-get 
install
 
build-essential
libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen3-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev
libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev default-jdk ant libvtk5-qt4-dev
cd
 
~
2
wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv-2.4.9.zip
3
unzip
opencv-2.4.9.zip
4
cd
 
opencv-2.4.9
 

1
mkdir
 
build
2
cd
 
build
3
cmake
-D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D WITH_VTK=ON ..
the cmake has some problem with cuda.

try 

cmake command: cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_CUBLAS=ON -D WITH_CUFFT=ON -D WITH_EIGEN=ON
-D BUILD_EXAMPLES=OFF -D BUILD_TESTS=OFF -D CUDA_ARCH_BIN="3.0" ..

or combine the cudapart with the first cmake option

replace http://code.opencv.org/projects/opencv/repository/revisions/feb74b125d7923c0bc11054b66863e1e9f753141/raw/modules/gpu/src/nvidia/core/NCVPixelOperations.hpp 

with  the original hpp

make

make install

sudo
 
gedit
/etc/ld.so.conf.d/opencv.conf
/usr/
local
/lib


sudo
 
ldconfig


sudo
 
gedit
/etc/
bash
.bashrc
1
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/
local
/lib/pkgconfig
2
export
 
PKG_CONFIG_PATH
3) Other library

$ tar zxvf glog-0.3.3.tar.gz
$ ./ configure
$ make

$ sudo make install

$
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev
  $
sudo apt-get install protobuf-c-compiler
protobuf-compiler

3)

$ cp Makefile.config.example Makefile.config
“BLAS := open”,
change the blas lib and include /opt/openblas/lib include
$ make all

$ make test

$ make runtest 

4)

test
http://caffe.berkeleyvision.org/gathered/examples/mnist.html
cd $CAFFE_ROOT
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh

cd $CAFFE_ROOT
./examples/mnist/train_lenet.sh


install matlab

matalb2014a part1 part2 crack in D 

mount -o loop,iocharset=gb2312 /tmp/download/Matlab_R14_Mac.Linux.Unix_CD1.iso /tmp/setup

unrar x -e file.part1.rar (will unrar 2 parts automatically if put in same folder)
sudo apt-get install rar unrar

sudo ./install

make matcaffe -j8

thanks to:
http://blog.csdn.net/u013476464/article/details/38071075 https://gist.github.com/bearpaw/c38ef18ec45ba6548ec0 http://www.samontab.com/web/2014/06/installing-opencv-2-4-9-in-ubuntu-14-04-lts/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: