转帖:https://github.com/BVLC/caffe/wiki/Ubuntu-15.10-Installation-Guide

Ubuntu 15.10 have been released for a couple of days. It is a bleeding-edge system coming with Linux kernel 4.2 and GCC 5. However, compiling and running Caffe on this new system is no longer as smooth as on earlier versions. I have done some research related to this issue and finally find a way out. I summarize it here in this short tutorial and I hope more people and enjoy this new system without breaking their works.

Install NVIDIA Driver

The latest NVIDIA driver is officially included in Ubuntu 15.10 repositories. One can install it directly via apt-get.

sudo apt-get install nvidia-352-updates nvidia-modprobe

The nvidia-modprobe utility is used to load NVIDIA kernel modules and create NVIDIA character device files automatically everytime your machine boots up.

Reboot your machine and verify everything works by issuing nvidia-smi or running deviceQuery in CUDA samples.

References
  1. How to do it manually
  2. Understanding character special file

Install CUDA 7.5

CUDA 7.5 is provided by neither Ubuntu official nor CUDA repositories for Ubuntu 15.10. But we can still install it using .run file.

cd ~
wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda_7.5.18_linux.run
chmod +x cuda_7.5.18_linux.run
./cuda_7.5.18_linux.run --extract=/home/$USER
sudo ./cuda-linux64-rel-7.5.18-19867135.run

Follow the instructions there and configure runtime library after the installation finishes.

sudo bash -c "echo /usr/local/cuda/lib64/ > /etc/ld.so.conf.d/cuda.conf"
sudo ldconfig

Install all other dependencies

Follow instructions here

Download Caffe

cd ~
git clone https://github.com/BVLC/caffe.git

By now you should be unable to compile it due to serveral incompatibility problems. Let’s fix them one by one.

Hack CUDA to support GCC 5

By default, CUDA 7.5 does not support compling with GCC 4.10 or later versions. It will report the following errors when compiling Caffe.

In file included from /usr/local/cuda/include/cuda_runtime.h:76:0,
from <command-line>:0:
/usr/local/cuda/include/host_config.h:115:2: error: #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
^

You can try install gcc-4.9 and g++-4.9 to solve this problem temporarily. But the linker will report undefined references errors later because all other libraries (protobuf,leveldb,opencv) in Ubuntu 15.10 are compiled with GCC version 5.2. They are not compatible.

To solve this problem we have to “hack” the CUDA toolkit by editing /usr/local/cuda/include/host_config.h. Comment line 115.

--- #error -- unsupported GNU version! gcc versions later than 4.9 are not supported!
+++ //#error -- unsupported GNU version! gcc versions later than 4.9 are not supported!

Fix hdf5 naming problem

Your machine may report the following error when compiling Caffe even though libhdf5-serial-dev package has been already installed in it.

./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory

This is because of change of default path and name of hdf5 head files and libraries in Ubuntu 15.10. To solve this problem, we can simply modify Makefile files.

Append /usr/include/hdf5/serial/ to INCLUDE_DIRS at line 85 in Makefile.config.

--- INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
+++ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

Modify hdf5_hl and hdf5 to hdf5_serial_hl and hdf5_serial at line 173 in Makefile

--- LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
+++ LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

Compile and Test Caffe

By now, all incompatibility issues should have been solved. We can start to compile and test Caffe.

cd ~/caffe
make -j8
make test -j8
make runtest -j8

Hopefully all tests pass.

Notes

  1. Running sudo make runtest once may help you fix a lot of runtime errors until next reboot, although it is not a recommended way.
  2. You might need to append LC_ALL="en_US.UTF-8" to /etc/environment and reboot your machine if there are runtime errors related to locale::facet::_S_create_c_locale name not valid.

UBUNTU 15.10 CAFFE安装教程(测试可用)的更多相关文章

  1. Ubuntu 15.10 x64 安装 Android SDK

    操作系统:Ubuntu 15.10 x64 目标:安装 Android SDK 本文最后更新时间:2015-11-3 安装32位库文件 2013年9月的iPhone 5s是第一款64位手机,而Andr ...

  2. Ubuntu 15.10 x64 安装 Android SDK(转)

    操作系统:Ubuntu 15.10 x64 目标:安装 Android SDK 本文最后更新时间:2015-11-3 安装32位库文件 2013年9月的iPhone 5s是第一款64位手机,而Andr ...

  3. Ubuntu 15.10 下Tachyon安装

    1 系统环境 Ubuntu 15.10, Java 1.7, Hadoop 2.6.0 HA, Spark-1.4.0 三台机器 spark-1423-0001: Master, Worker spa ...

  4. Ubuntu 15.10 安装推荐链接

    整理一些Ubuntu 15.10系统安装使用的链接. Ubuntu官网下载:http://www.ubuntu.com/download/desktop,目前最新的版本是Ubuntu 15.10. 网 ...

  5. Ubuntu 15.10安装elementary desktop

    elementaryOS的风格类似于macos,基于Ubuntu改造,个人比较喜欢其界面理念,简单清晰.因此下载了elementaryOS Freya使用,使用过程中,各个软件版本的升级比较落后,比如 ...

  6. 安装Ubuntu 15.10后要做的事

    Ubuntu 15.10发布了,带来了很多新特性,同样也依然带着很多不习惯的东西,所以装完系统后还要进行一系列的优化. 1.删除libreoffice libreoffice虽然是开源的,但是Java ...

  7. 【转】安装Ubuntu 15.10后要做的事

    Ubuntu 15.10发布了,带来了很多新特性,同样也依然带着很多不习惯的东西,所以装完系统后还要进行一系列的优化. 1.删除libreoffice libreoffice虽然是开源的,但是Java ...

  8. ubuntu 15.10安装搜狗输入法不能打开

    安装Linux是为了更好的做开发,而开发其实不需要输入中文的,然而 在大中国的环境下,电脑没有中文输入法是不行的... 这次装ubuntu 坚持了4天没有中文输入法,我能说,其实没有中文输入法貌似也没 ...

  9. 黑苹果macOS Sierra 10.12 安装教程(venue11 pro测试)

    黑苹果macOS Sierra 10.12 安装教程(venue11 pro测试) 2017-03-12 03:46:24 by SemiconductorKING PS:刚刚装好黑苹果,来记录一篇折 ...

随机推荐

  1. 02docker核心概念

    1:docker三大核心概念 核心概念 描述 镜像 Docker镜像类似于虚拟机镜像,可以将它理解为一个只读的模板. 容器 Docker容器类似于一个轻量级的沙箱,Docker利用容器来运行和隔离应用 ...

  2. CAS实现逻辑(JWT)

    由于没有获取正规做CAS的流程,这里根据网上的资料,写了一个自己觉得还可以的方案流程,留着备用 名称介绍: token:用于验证请求是否合法 refreshToken:当token失效后,客户端发送t ...

  3. work mark

    <detection name="tracking" open="1" shape="rect" rect="(608,16 ...

  4. css基础(代码)

    display: block; /*元素分为三大类,设置元素的显示方式}                                         行内 inlineli{            ...

  5. Go语言并发机制

    Go语言中的并发 使用goroutine编程 使用 go 关键字用来创建 goroutine .将go声明放到一个需调用的函数之前,在相同地址空间调用运行这个函数,这样该函数执行时便会作为一个独立的并 ...

  6. tensorflow-解决3个问题

    问题一:对特征归一化 Min-Max Scaling: X′=a+(X−Xmin)(b−a)/(Xmax−Xmin) # Problem 1 - Implement Min-Max scaling f ...

  7. Spring整合Hessian的使用

    该文章转赞自  https://www.cnblogs.com/ontheroad_lee/p/3797239.htm 个人感觉写的非常好,刚学习,先记录下来 1.1     Hessian简介 He ...

  8. webpack升级4出现的问题

    webpack3升级到4出现了很多问题,经过验证报错信息如下 1 Module parse failed: Unexpected token (:) You may need an appropria ...

  9. Django框架——forms.ModelForm使用

    使用模型创建表单 django提供了这种简便的方式,使用方法如下: 1.在项目的一个app目录中,创建forms.py文件 2.导入模块: from django import forms from ...

  10. 常见排序&查询算法Java代码实现

    1. 排序算法代码实现 /** * ascending sort * 外层循环边界条件:总共需要冒泡的轮数--每一轮都将最大或最小的数冒泡到最后 * 内层循环边界条件:冒泡数字移动的边界--最终数字需 ...