Ubuntu Linux 15.04 Configuration Installation Caffe

Source: Internet
Author: User
Tags git clone cuda toolkit intel mkl

Recently began to try deep learning things, brother recommended Caffe, began to try how to configure the Caffe to run the required environment.

OK, get started.

Find the Installation guide for Caffe official website: http://caffe.berkeleyvision.org/ Installation.html, really be installed in the pre-conditions scared a bit, a good lump, no way, installation needs, bite the bullet also on Ah, a start to walk ~ (in addition, this article http://blog.csdn.net/yuxiangyunei/ article/details/50165519 blog post also gives some installation steps, I am basically here is my own compiled package, not with the blog in the use of Ubuntu Software Library installation configuration, you can refer to this Daniel's steps. )

1. Cuda and Blas Installation

Cuda installation package and driver download go to NVIDIA website, Caffe official recommended is the latest Cuda 7.0 and above version, so, chasing a trend, Came a 7.5 version of the drive to a Linux environment of the closed-source driver, if you have installed Linux under the additional driver recommended driver, you need to uninstall the reinstallation, This driver installed through the System tool is not able to install the Cuda Toolkit downloaded from the official website (remember this before), there is no option to install the Cuda version through Apt-get, step by step, feel better understanding the entire installation process, and, Also know the directory where you install the things.

A) CUDA 7.0 installation

First, install the corresponding dependency package:

sudo apt-get install Freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev LIBGL1-MESA-GLX Libglu1-mesa Libglu1-mesa-dev

-------Deb Installation Method (reference from: http://www.linuxidc.com/Linux/2014-10/107501.htm):

$ sudo dpkg-i cuda-repo-<distro>_<version>_<architecture>.deb
$ sudo apt-get update
$ sudo apt-get install Cuda

After the installation is complete, you need to configure the CUDA environment variables:

Last added in ~/.BASHRC:

$ export Path=/usr/local/cuda-6.5/bin: $PATH
$ export ld_library_path=/usr/local/cuda-6.5/lib64: $LD _library_path

-------Run File Installation method

First of all, install the video card of the closed source driver, here need to delete the corresponding Ubuntu system under the default video driver:

sudo apt-get--purge Remove Xserver-xorg-video-nouveau

Disable the Nouveau driver:

Add (or create a separate file) behind the/etc/modprobe.d/blacklist.conf configuration file:

Blacklist nouveau

Options Nouveau modeset=0

Regenerate Kernel's INITRAMFS:

sudo update-initramfs-u

Reboot the system.

Login Interface Press CTRL+ALT+F1, enter the character interface, log into the system, close the LIGHTDM manager:

sudo service LIGHTDM stop

Enter the directory where the Nvidia closed source driver is located and execute:

sudo./<nvidia driver file >.run

Then execute the corresponding Cuda installation file:

sudo./<cuda installation files >.run

    Note: These two files do not have Execute permissions by default and need to be manually added to execute permissions: chmod +x < filename >.run

b) Openblas Installation

There is an optional Atlas (default option for Caffe), Intel Mkl and Openblas, and since Atlas needs to turn off the CPU throttling, there is no corresponding shutdown method, and many methods are now invalid, so Here is the Openblas library file, which downloads openblas from GitHub:

git clone Https://github.com/xianyi/OpenBLAS

Installation is relatively simple, enter the Openblas download directory

Make && make install target directory for prefix=< installation >

2. Boost installation

To download the corresponding boost installation package, this article uses the Boost installation package version boost_1_59_0.tar.bz2, unzip it:

Tar--bzip2-xf < destination folder >

To access the Boost decompression directory, you can view the installation help by following these commands:

./bootstrap.sh--help

installation command:

./bootstrap.sh--prefix=< Installation directory >//default installation directory is/usr/local, I use the default installation directory, because I do not understand the corresponding environment variable settings ...

For additional detailed installation options see: http://www.boost.org/doc/libs/1_59_0/more/getting_started/unix-variants.html

3, PROTOBUF installation

Here Caffe need Protobuf (Google developed a set of protocol framework, feel very sharp appearance, there is a blog about protobuf: http://blog.csdn.net/caisini_vc/article/details/ 5599468), but before installing PROTOBUF, you need to pre-compile and install Googlemock and googletest, here to GitHub to download the corresponding googletest,:https://github.com/google/ Googletest, because Googlemock relies on googletest, and the latest version of the Googlemock has been put into the Googletest project, you only need to download googletest.

git clone https://github.com/google/googletest

Enter the Googletest directory and execute the command to compile the installation googletest:

./travse.sh

Or:

mkdir Build && CD Build

CMake.

sudo make && make install

or enter the Googletest and Googlemock folder separately, compile the installation separately, but should be careful to compile the installation googletest, followed by Googlemock.

OK, get ready to finish the work.

Compile and install Protobuf:

git clone https://github.com/google/protobuf//Download Protobuf

First, we need to generate the Configure file, go to the Protobuf folder and execute:

./autogen.sh

installation command:

./configure--prefix=< Installation directory >

Make

Make check

sudo make instal

4, Glog Installation

Google's log module, download:

git clone https://github.com/google/glog

Installation:

./configure && make && make install

5, GFlags Installation

Download:

git clone https://github.com/gflags/gflags

installation command, installation parameters in detail see install.md:

mkdir Build && CD Build

Ccmake. Press ' C ' to configure build system parameters, ' e ' ignore warning, set generate parameter information, ' C ' until ' G ' is available, press ' G ' to generate configuration file

Make

Make Test

Make install

  

6. Hdf5 Compile and install

Hdf5:http://www.hdfgroup.org/hdf5/release/obtainsrc.html, this article uses the hdf5-1.8.16.

Extract:

Tar xvf Hdf5-1.8.16.tar

Simple installation method, enter the extracted source directory, execute

./configure--prefix=< Installation directory >

Make

Make check//execute test Routine

Make install

Make Check-install//verify the installation.

Co-worker, HDF5 installation also supports CMake tools, for CMake to compile the installation methods or complete installation method see: http://www.hdfgroup.org/HDF5/release/obtainsrc.html the installation documentation given.

At this point, Caffe mandatory dependency packages are already installed, optional dependencies such as LMDB,LEVELDB,CUDNN and OPENCV are no longer introduced here, note that if you install Python caffe you also need NumPy (>= 1.7) package and boost Python support.

    

    

Ubuntu Linux 15.04 Configuration Installation Caffe

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.