Ubuntu14.04 Installation Caffe Guide

Source: Internet
Author: User
Tags intel core i7

Operating system: Ubuntu14.04 64bits

Processor: Intel Core i7-4790k 8 core 4GHz

GPU:GTX TITAN X

cuda:cuda7.0

Nvidia Driver: NVIDIA346.72

Blas:mkl

Installation process:

(i) Ubuntu system installation

It is best to install Ubuntu14.04, support the Caffe best, and do not update the system after installing Ubuntu.

(ii) Caffe dependencies

sudo apt-get install Libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf- Compilersudo apt-get install--no-install-recommends libboost-all-devsudo apt-get Install Libgflags-dev Libgoogle-glog-dev Liblmdb-dev

Note that all of the necessary library files are installed here and must be installed.

(iii) NVIDIA driver installation

Download the English version of the driver from the Nvidia official website, with. Run and. Deb two formats, which can be installed with optional components, which is equivalent to one-click installation. Note to choose the driver with their own GPU to match, did not try the Chinese version of the driver, do not know whether it is feasible, but on the official website download Chinese drivers will appear garbled. After downloading the driver (my. run file), follow the installation instructions in the official website, the following general steps:

1, using sudo gedit/etc/modprobe.d/blacklist-nouveau.conf new blacklist-nouveau.conf file, enter the command

blacklist nouveaublacklist lbm-nouveauoptions nouveau modeset=0alias nouveau offalias LBM-nouveau off

Save and exit. This step is to disable Ubuntu with its own open source driver Nouveau. After the sudo reboot reboot the system. Executing commands at the terminal

Lsmod | grep nouveau

You can see if the Nouveau module is loaded. If nothing is output, proceed to the next step.

2. After reboot, the screen resolution becomes lower without tube. Enter the Tty1 file mode, enter the user name password, login, enter the command

SUDO/ETC/INIT.D/LIGHTDM stop

Close the Xserver. Note that installing the Nvidia driver requires logging in as root, so use the command sudo su to enter root. Input command

Bash nvidia-linux-x86_64-346.72. Run--kernel-source-path=/usr/src/linux-headers-3. *. *

For installation. The linux-headers-3.*.* here is the Linux system source file name. There are some tips for you to answer during the installation process, note that when prompted

The distribution-provided pre-install script failed! Is you sure want to continue?

Without the tube, continue to install on the line, this problem I have not understood what causes, but this does not affect the subsequent installation and use. When prompted

Would to register the kernel module sources with DKMS? This would allow DKMS to auomatically build a new module,if you install a different kernel later

, answer No.

3. It is best to execute the order again

sudo apt-get install linux-image-extra-virtual

Otherwise, you may receive the following error message:

Modprobe: ERROR: could not insert' nvidia ':Unknown symbolinmodule ,or unknown parameter(seedmesg)

4. Execute SUDO/ETC/INIT.D/LIGHTDM start and restart the computer. You may have a resolution problem after restarting, just change the/etc/x11/xorg.conf file as follows:

Section'Monitor'****Horizsync31.5-61.0Vertrefresh50.0-75.0**** Section' Screen'Modes"[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]" "[email protected]"endsubsection

(iv) cuda7.0 installation

Note that Caffe recommended to install the latest version of Nvidia driver, so cuda built-in driver we do not need to install, CUDA installation in accordance with the official website of the tutorial, the process is relatively simple, here no longer repeat, if there are questions can leave a message we discuss each other. Note, however, that you need to modify the environment variables after the installation is complete, just create a new cuda.conf file under/etc/ld.so.conf.d/, and then save the Cuda path (the default is/usr/local/cuda-7.0/lib64) after adding it.

(v) Installation of MKL

Caffe Required Blas We install the MKL, although the download of MKL is a little bit cumbersome, but the installation is very fast. Download the time only need to apply for student free version of the website, with your mailbox registration will automatically receive the download guide and a LIC registration file, follow the instructions to download, installation is relatively simple, here only a few notes:

1. A MKL installation file can be used by several users at the same time, so there is no need to repeat the download.

2, installation must be installed in the Ubuntu can recognize the file system, recommended ~/, otherwise unable to execute. sh script file.

3. After installation, the MKL library path (/opt/intel/lib and/opt/intel/mkl/lib/intel64) needs to be added to the environment variables.

(vi) If you want to use the Python interface, you also need to install some Python library files (Ubuntu Python does not meet our needs)

sudo apt-get install python-numpy python-scipy Python-dev

(vii) If you need to use the MATLAB interface, then recommend the new version of Matlab such as r2013a/b,r2014a/b, I installed r2014b, no problem.

(eight) Compile configuration Caffe

To download the Caffe file and extract it to a directory caffe-root, note some of the paths in the makefile file are modified. Execute the command.

CD caffe-root/caffe-MASTERCP Makefile.config.example makefile.configmake allmake testmake runtest

Some problems may occur during make compilation, possibly caused by Caffe's own file compatibility issues, such as:

1, prompt Make:protoc: Command not found, this is because PROTOC not installed, just install on the line.

sudo apt-get install Protobuf-c-compiler Protobuf-compiler

2. Hint "SRC/CAFFE/UTIL/MATH_FUNCTIONS.CU": Errot:calling a host function ("Std::signbit") from a globalfunction (" Caffe::sgnbit kernel ") is not allowed",

Modify./INCLUDE/CAFFE/UTIL/MATH_FUNCTIONS.HPP 224 Lines

Delete (note): Using Std::signbit

Modified: Define_caffe_cpu_unary_func (sgnbit, y[i] = Signbit (X[i]));

For: Define_caffe_cpu_unary_func (sgnbit, y[i] = Std::signbit (X[i]));

This is the solution given by Yangqing Jia, and there is only one way.

When I compile, only for some version of Caffe will encounter situation 2, for the first problem as long as you follow the previous steps should not appear. Although this spent a few days, but finally is their own efforts to return, hope Caffe later can optimize the more perfect, do not in the compile time encounter so much trouble, for beginners is very unfavorable. I hope we all learn together and make progress together!

Ubuntu14.04 Installation Caffe Guide

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.