Ubuntu14.04 Installing CUDA7.5 + Caffe + CuDNN

Source: Internet
Author: User


This series of articles by the @yhl_leo produced, reproduced please indicate the source.
Article Link: http://blog.csdn.net/yhl_leo/article/details/50961542

Spent a day, installed on the computer configuration of the Caffe deep learning framework, many of the online tutorials and guidance have expired, the middle of the time spent a bit, here the personal thought the simplest way to organize the following.

version 1
    • Notebook: ThinkPad W541
    • Ubuntu 14.04 (64-bit)
    • Dual Graphics:
      • Intel (R) HD Graphics Family
      • NVIDIA Quadro k2100m
    • CUDA 7.5
    • CuDNN
2 Preparatory work

The system originally wanted to install version wily, has been in use, but helpless, the computer can not install the version, the choice of 14.04.

Install some basic dependencies:

$ sudo apt-get  Install Libprotobuf-dev  libleveldb-dev  libsnappy -dev  libopencv-dev  libhdf5-serial  -dev  protobuf- Compiler  $ sudo apt-get  install -- no< Span class= "Hljs-attribute" >-install  -recommends  libboost-all  -dev  $ sudo apt-get  install Libopenblas-dev  liblapack-dev  libatlas-base  -dev   

To install the NVIDIA graphics driver, I am uninstalling the existing version before installing and uninstalling the method:

sudo apt-get--purdg nvidia*

After restarting the login, you may be looping to fill in the password, can not enter the system, press Ctrl+Alt+F1 , login, install video driver:

$ sudo apt-get install nvidia-current  

Or specify a version:

$ sudo add-apt-repository ppa:xorg-edgers/ppa$ sudo apt-get update$ sudo apt-get install nvidia-346

Computer is a dual graphics card, users recommend to install before the installation of some services to ensure success. When I installed it, I only banned one item:

sudo service lightdm stop

(After the system starts, do not log into the desktop, directly press Ctrl+Alt+F1 , if you play the cloud server, should be very familiar with, then enter the system user name and login password, enter the above instructions, back to the graphical interface method is to press Ctrl+Alt+F7 , remember this operation, 14.04 version of the appearance of the password can not enter the desktop is more common, I installed Sogou pinyin have appeared ... )

3 CUDA

Many of the online installation of 6.x,7.0 version of the method is very cumbersome, personal selection of a relatively simple installation method.

First download the installation files on the official website (the link has been provided earlier):

I downloaded the deb local installation file, and after the download is complete, follow the instructions in the documentation to install:

-i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb$ sudo apt-get update$ sudo apt-get install cuda

Download the below Installation Guide for Linux , which has a set of environment variables:

$ PATH=/usr/local/cuda-7.5/bin:$PATH$ LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH

The configuration of other installation files is also available in the documentation.

4 Caffe

Download Caffe:

$ https://github.com/BVLC/caffe.git

If you don't have Git installed, read the blog: Ubuntu git installs and uses.

Then compile the Caffe:

cp Makefile.config.example Makefile.config$ make all

Some tutorials also configure OPENCV, which can be read in the blog: Ubuntu configuration OpenCV.

5 CuDNN

The CUDNN is a library of GPU-accelerated compute deep neural networks (download link, provided previously).

My download file is:cudnn-7.0-linux-x64-v4.0-prod.tgz

In the terminal, switch to the folder where the file is located, enter the following command:

$ sudo tar xvf cudnn-7.0-linux-x64-v4.0-prod.tgz$ CD cuda/include$ sudo cp *.h/usr/local/include/$ Cd.. /lib64$ sudo cp lib*/usr/local/lib/$ Cd/usr/local/lib$ sudo chmod +r libcudnn.so.4.0.4$ sudo ln-sf libcudnn.so.4.0.4Libcudnn.so.4$ sudo ln-sf libcudnn.so.4Libcudnn.so$ sudo ldconfig

Then switch to the Caffe root directory and Makefile.config remove the USE_CUDNN before the line # :

cdsudo vi Makefile.config

To recompile after saving:

sudosudosudo make test  sudo

I compile the last step of the time, there are such errors:

libcudart.so.7.5openfilefileordirectory

There's a bunch of introductions on the web, how to set the environment variables (we've already set them up), so we can check if we've added environment variables:

echo$PATHecho$LD_LIBRARY_PATH

As you can see, the environment variables have been added well.

The workaround is to copy some files to the /usr/local/lib folder:

$ sudoCP/usr/local/cuda-7.5/lib64/libcudart. so. 7. 5/usr/local/lib/libcudart. so. 7. 5&& sudo ldconfig$ sudoCP/usr/local/cuda-7.5/lib64/libcublas. so. 7. 5/usr/local/lib/libcublas. so. 7. 5&& sudo ldconfig$ sudoCP/usr/local/cuda-7.5/lib64/libcurand. so. 7. 5/usr/local/lib/libcurand. so. 7. 5&& sudo ldconfig

Again, try the sudo make runtest command that appears as follows:

At this point, the Caffe installation is complete.

from : Personal blog site: Yhl ' s blog

Ubuntu14.04 Installing CUDA7.5 + Caffe + CuDNN

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.