Problems with installing Caffe on Ubuntu 14.04

Source: Internet
Author: User
Tags gtx

The specific installation process can refer to the official website of the installation, as well as some users to share some installation tutorials, tutorial one, tutorial two, tutorial three.

I am here to record some of the problems I encountered during the installation process, as well as the workaround (not mentioned on the web), rather than the entire installation process. Because they are small white Linux, installation of Caffe spent a few days, several times I want to give up, fortunately I insisted on down, write this blog just hope that if the Netizen also encountered such a problem, you can find the answer from me.


First, the test environment

Ubuntu14.04

CUDA6.5
GTX 760


Second, CUDA installation

Cuda installation can refer to the official website of nvidia CUDA Getting Started Guide for Linux

There are two ways to install: The Deb file installation run File installation
I choose to install the Deb file, this method is simple to install, but the Internet is not stable, but I now use the good!
Install Repository Meta-data
Note:when using a proxy server with aptitude, ensure that wget are set up to use the same proxy settings before installing The Cuda-repo package.

$ sudo dpkg-i cuda-repo-<distro>_<version>_<architecture>.debupdate the Apt repository cache$ sudo Apt-get updateinstall cuda$ sudo apt-get install CUDA

Note:
After performing these three steps, in the environment, has been unable to pass the test program, suggesting that there is no matching video card, try a lot of methods are not, and finally see that may be because cuda built-in driver is not too complete, or poor adaptability, then decided to download the GTX 760 driver, reinstall.


Third, the GTX 760 driver installation (refer to the network) installation driver, note that the exit GUI, and then turn off the nouveau open source graphics driver, because it will affect the installation of Nvidia drivers.

First, exit GUI (X-win interface), operation method: Simultaneously press: CTRL+ALT+F1 (F2-F6), switch to tty1-6 command line mode.

Second, close the Nouveau open-source graphics driver, how to:

1. Add Nouveau to the blacklist to prevent it from starting
$ cd/etc/modprobe.d
$ sudo vi nvidia-graphics-drivers.conf
Write: Blacklist nouveau
Save and exit: wq!
Check: $ cat nvidia-graphics-drivers.conf

2. For:/etc/default/grub, add to end.
$ sudo vi/etc/default/grub
End write: Rdblacklist=nouveau nouveau.modeset=0
Save and exit: wq!
Check: $ cat/etc/default/grub

3. The operation provided by the official website:
$ sudo mv/boot/initramfs-$ (uname-r). img/boot/initramfs-$ (uname-r)-nouveau.img
Then regenerate the initrd file
$ sudo dracut/boot/initramfs-$ (uname-r). IMG $ (UNAME-R)
$ sudo update-initramfs-u
The above is the official NVIDIA command, do not know why I would suggest that Dracut is a non-existent command, perhaps the version of the problem, or the lack of any package, but it does not matter, the second command can also be done, should be the same function. (If I understand the mistake, welcome the children to teach, I will correct)

Now in the test (./devicequery), you can output some information of the video card smoothly.


Iv. Dependent Package Installation

I encountered the problem is to install the gflags, and then install Glog when the error, unable to install the success.

Tips for official website:
Note that Glog does isn't compile with the most recent gflags version (2.1), so before that's resolved you'll need to bui LD with Glog first.

Just this hint written in the installation instructions behind, I see the time is late, the reason will be installed gflags, is because glog in wget when the network can not link, seemingly need to turn over the wall, I finally download from the window, and then copy to Linux above, This process is not easy.

How do I uninstall gflags?
Online See said with Apt-get remove gflags, but not on my computer. Since I have played Linux before, I feel that uninstalling the software is not convenient window, finally I entered the root directory of gflags, do clean, and then the entire installation file deleted. At this point, I re-install the Glog when the installation was successful.


V. Root directory of Caffe

This is a comparison of the process of Ken, I now think I think I am so silly.
On the Internet to write "all the environment after the configuration, into the Caffe root directory", but I have been unable to find Caffe root directory where, and finally in the QQ group asked the answer, the answer to my netizen must think I am silly, but still very grateful to him.
The reason is because I do not have to download Caffe package, so no matter how to find is definitely not find the pull,.


Six, remains the gflags

After the environment has been configured, the make is started, and in the execution of making all, there are questions about gflags, hints and ... gflags...o file (the specific name is forgotten, because the blog was written after Ann turned, and there is no period) conflict, Description The uninstallation was not clean before. I will find the location according to the error, forcing him to delete. It would be too violent for me to do this, but fortunately, this makes all pass.


Seven, boost installation

The next smooth implementation of make All,make test, thought made Runtest can also pass, and then can clean up the bedroom home, but, but, it is still wrong.
Error message:

[PASSED] 832 tests. [FAILED] 6 tests, listed below:[FAILED] Powerlayertest/0.testpowergradientshiftzero, where typeparam = Caffe::floatcpu [FAILED] Powerlayertest/1.testpowergradientshiftzero, where Typeparam = Caffe::D oublecpu[FAILED] POWERLAYERTEST/1. Testpowergradient, where Typeparam = Caffe::D oublecpu[FAILED] Powerlayertest/2.testpowergradientshiftzero, where Typeparam = caffe::floatgpu[FAILED] Powerlayertest/3.testpowergradientshiftzero, where Typeparam = Caffe::D oublegpu[ FAILED] powerlayertest/3.testpowergradient, where Typeparam = Caffe::D Oublegpu

I am here to support the GPU, if the CPU is supported, only three errors will be reported.
Fortunately I found a solution on GitHub, but when I saw the reason, I felt this ...
I ' ve faced same problem and I ' ve solved it.
I tried to uninstall boost 1.56 and install boost 1.55, then reinstall Caffe, all tests passed! (with Openblas)

I loaded the latest boost 1.57, and after I uninstalled it, I switched to boost 1.55, and the error was gone (the official online is "Boost (>= 1.55, although only 1.55 and 1.56 is tested)" since 1.56 and 1. 57 incompatible, you can write 1.55, this can save a lot of trouble). At this time, already 12 points more, go back to bed.


Viii. Summary

In fact, as a small white Linux, the whole process encountered more than these problems, there are configuration environment variables and many other problems, but generally can be based on the prompt to solve, I do not write in this. Although, this installation process is very difficult, but I heard that Caffe used very convenient, well, let me feel the charm of Caffe.



Problems with installing Caffe on Ubuntu 14.04

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.