UBUNTU 15.10 CAFFE安装教程(测试可用)

转帖: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
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
- Running
sudo make runtestonce may help you fix a lot of runtime errors until next reboot, although it is not a recommended way. - You might need to append
LC_ALL="en_US.UTF-8"to/etc/environmentand reboot your machine if there are runtime errors related tolocale::facet::_S_create_c_locale name not valid.
UBUNTU 15.10 CAFFE安装教程(测试可用)的更多相关文章
- Ubuntu 15.10 x64 安装 Android SDK
操作系统:Ubuntu 15.10 x64 目标:安装 Android SDK 本文最后更新时间:2015-11-3 安装32位库文件 2013年9月的iPhone 5s是第一款64位手机,而Andr ...
- Ubuntu 15.10 x64 安装 Android SDK(转)
操作系统:Ubuntu 15.10 x64 目标:安装 Android SDK 本文最后更新时间:2015-11-3 安装32位库文件 2013年9月的iPhone 5s是第一款64位手机,而Andr ...
- 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 ...
- Ubuntu 15.10 安装推荐链接
整理一些Ubuntu 15.10系统安装使用的链接. Ubuntu官网下载:http://www.ubuntu.com/download/desktop,目前最新的版本是Ubuntu 15.10. 网 ...
- Ubuntu 15.10安装elementary desktop
elementaryOS的风格类似于macos,基于Ubuntu改造,个人比较喜欢其界面理念,简单清晰.因此下载了elementaryOS Freya使用,使用过程中,各个软件版本的升级比较落后,比如 ...
- 安装Ubuntu 15.10后要做的事
Ubuntu 15.10发布了,带来了很多新特性,同样也依然带着很多不习惯的东西,所以装完系统后还要进行一系列的优化. 1.删除libreoffice libreoffice虽然是开源的,但是Java ...
- 【转】安装Ubuntu 15.10后要做的事
Ubuntu 15.10发布了,带来了很多新特性,同样也依然带着很多不习惯的东西,所以装完系统后还要进行一系列的优化. 1.删除libreoffice libreoffice虽然是开源的,但是Java ...
- ubuntu 15.10安装搜狗输入法不能打开
安装Linux是为了更好的做开发,而开发其实不需要输入中文的,然而 在大中国的环境下,电脑没有中文输入法是不行的... 这次装ubuntu 坚持了4天没有中文输入法,我能说,其实没有中文输入法貌似也没 ...
- 黑苹果macOS Sierra 10.12 安装教程(venue11 pro测试)
黑苹果macOS Sierra 10.12 安装教程(venue11 pro测试) 2017-03-12 03:46:24 by SemiconductorKING PS:刚刚装好黑苹果,来记录一篇折 ...
随机推荐
- T100——自动执行设置了但没执行
azzi950设置了背景定时执行,但到底没执行, 重启的命令如下.三个命令都执行一下.指令 1: r.r azzp950 kill 指令 2: r.r azzp951 kill 指令 3: r.r a ...
- Mysterious Crime CodeForces - 1043D (哈希)
大意: 给定m个n排列, 求有多少个公共子串. 枚举每个位置, hash求出最大匹配长度. #include <iostream> #include <sstream> #in ...
- 怎样将当前节点从DOM树中移除
1. 获取到当前节点. 2. 获取到当前节点的父节点. 3. 使用 Node.prototype.removeChild() 移除当前节点. <!DOCTYPE html> <htm ...
- 区间dp 整数划分问题
整数划分(四) 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 暑假来了,hrdv 又要留学校在参加ACM集训了,集训的生活非常Happy(ps:你懂得),可是他最近 ...
- java中的接口和php的接口的区别
php: 规范: 接口是一种特殊的抽象类,这种抽象类中只包含抽象方法和静态常量. 在接口中的抽象方法只能是public的,默认也是public权限. abstract和final修饰符也不能修饰接口中 ...
- 清除vs2005、vs2008起始页最近打开项目
有时候vs2005起始最近打开项目过多很想清除掉,但打遍了也没找到清除选项在哪里,今天找到了方法,发上来和大家共享. 方法一手工操作方法:1)删除最近打开的文件运行regedit,打开HKEY_CUR ...
- iptables防火墙操作-查看、配置、重启、关闭
查看iptables端口配置 iptables -L -n --line-number iptables端口配置(不开通3389无法远程连接,不开通icmp无法ping) iptables -A IN ...
- web端文件上传,预览,下载,删除
//HTML部分 <div class="item attachment attachmentNew"> <span class="name&quo ...
- 读书笔记《Oracle从入门到精通》
目录 一.SQL基础 1.SQL种类 2.常用数据类型 3.DDL 4.约束 5.DML语句 二.SELECT语句 1.结果集'*'与指定列 2.拼接符 || 3.substr函数 4.instr函数 ...
- jsonp的原理介绍及Promise封装
什么叫jsonp? jsonp是json with padding(填充式json或参数式json)的简写,是通过ajax请求跨域接口,获取数据的新实现方式 jsonp的实现原理: 动态创建scrip ...