ubuntu16.04+cuda8.0+caffe

http://blog.csdn.net/xuzhongxiong/article/details/52717285

http://blog.csdn.net/xierhacker/article/details/53035989

(1)ubuntu16.04安装

(2)换阿里

cd /etc/apt/

备份sources.list

sudo cp sources.list sources.list.bak

替换

# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http: //archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http: //mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http: //mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http: //mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http: //mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http: //mirrors.aliyun.com/ubuntu/ xenial universe
deb http: //mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http: //mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http: //mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http: //mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http: //mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http: //archive.canonical.com/ubuntu xenial partner
deb-src http: //archive.canonical.com/ubuntu xenial partner
deb http: //mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http: //mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http: //mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http: //mirrors.aliyun.com/ubuntu/ xenial-security multiverse
更新源:sudo apt-get update

更新软件:sudo apt-get upgrade

(3)nvidia显卡驱动安装

3.1 仅仅拉黑neoveau:http://blog.csdn.net/u012581999/article/details/52433609

删除旧的驱动:sudo apt-get purge nvidia*

禁用nouveau:

sudo gedit /etc/modprobe.d/blacklist-nouveau.conf

添加内容:

blacklist nouveau
options nouveau modeset=0

更新:

sudo update-initramfs -u


sudo gedit /etc/modprobe.d/blacklist.conf添加以下部分并保存:blacklist vga16fbblacklist nouveaublacklist rivafbblacklist nvidiafbblacklist rivatv

(4)cuda8.0:http://blog.csdn.net/autocyz/article/details/52299889

下载run文件后,sudo sh cuda_8.0.61_375.26_linux.run

注意事项:不要更新显卡驱动:

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 。。。。 选择no
环境变量设置:

sudo gedit ~/.bashrc ,尾部写入:

export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
设置环境变量和动态链接库:

sudo gedit /etc/profile
文件尾部加入
export PATH = /usr/local/cuda/bin:$PATH
保存后,创建链接文件:

sudo gedit /etc/ld.so.conf.d/cuda.conf
加入:
/usr/local/cuda/lib64
然后执行
sudo ldconfig

(5)cudnn

(6)opencv 3.1

安装opencv 3.1 后 循环登录界面:http://www.linuxidc.com/Linux/2017-03/141512.htm

参考链接:http://blog.csdn.net/jhszh418762259/article/details/52957495

http://www.linuxdiyf.com/linux/24659.html

依赖项:

sudo apt-get install build-essential

sudo apt-get install cmake Git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev

sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

sudo apt-get install –assume-yes libopencv-dev libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev libtbb-dev libqt4-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils unzip

sudo apt-get install ffmpeg libopencv-dev libgtk-3-dev python-numpy python3-numpy libdc1394-22 libdc1394-22-dev libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev libavcodec-dev libavformat-dev libswscale-dev libxine2-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libv4l-dev libtbb-dev qtbase5-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev

依赖项最好都装,不知道会缺哪个导致问题。

使用CMAKE GUI界面 make,注意将跟cuda有关的选项全部都不要选,装过几次 都因为装了跟cuda关联的内容导致重启后在登录界面重复登录。

成功安装的opencv3.1 使用的是github上的opencv代码,然后CMAKE-gui make. 同时ippicv_linux_20141027.tgz 用的14年的版本,失败的几次都是用的15年的ippicv_linux_20151201.tgz 。

因此,不知道是ippicv用的版本问题 还是cuda问题导致的重启后循环登录。

在网上看到也有人说安装cuda时候不加--no-opengl-libs 会循环登录,:sudo sh cuda_8.0.27_linux.run --no-opengl-libs 不加这个选项会进入循环登陆

http://blog.csdn.net/sinat_31802439/article/details/52958791

(7)caffe

参考http://blog.csdn.net/xierhacker/article/details/53035989

(8)caffe python 接口编译

出现问题:libstdc++.so.6: version `GLIBCXX_3.4.20' not found问题

解决方案:http://stackoverflow.com/questions/39912634/how-to-install-configure-caffe-python-anaconda-links-to-gomp-4-0-and-throws-er/41362203#41362203

It's just caused of Anaconda's gcc libs was compiled by gcc4.xx. by the system owned gcc version is gcc5.xx...

I've hacked this problem with copy

libgomp.so.1.0.0, libquadmath.so.0.0.0, libstdc++.so.6.0.21 these files from :

/usr/lib/x86_64-linux-gnu/

to :

/yourAnacondaPath/anaconda2/pkgs/libgcc-4.8.5-2/lib

/yourAnacondaPath/anaconda2/lib

and then create the links;it works for me


 
   

你可能感兴趣的:(ubuntu16.04+cuda8.0+caffe)