求助,GTX1080 linux查看cuda版本8 系统显卡驱动版本的问题win10系统

gtx1080 cuda7.0,gtx1080ti cuda_gtx1080 cuda8.0_cuda8.0 gtx1080ti_gtx1080_gtx1080 cuda 7.5_cuda 8.0 1080ti_gtx1080 cuda计算能力_gtx1080 cuda不支持_cuda7.5支持gtx1080吗 - 一点通Ubuntu 16.04+Nvidia GTX 1080+CUDA8.0 深度学习环境配置_Linux教程_Linux公社-Linux系统门户网站
你好,游客
Ubuntu 16.04+Nvidia GTX 1080+CUDA8.0 深度学习环境配置
来源:52nlp&
作者:52nlp
GTX1080主机准备好之后,就是配置深度学习环境了,这里选择了比较熟悉系统,不过是最新的Ubuntu 16.04版本,另外在Nvidia GTX1080的基础上安装相关GPU驱动,外加CUDA8.0,因为都比较新,所以踩了很多坑。
1. 安装Ubuntu16.04
不考虑双系统,直接安装 Ubuntu16.04,从
下载64位版本: ubuntu-16.04-desktop-amd64.iso 。
在MAC下制作了 Ubuntu USB 安装盘,具体方法可参考:
,之后通过Bios引导U盘启动安装Ubuntu系统:
1)一开始安装就踩了一个坑,选择&Install Ubuntu&回车后过一会儿屏幕显示&输入不支持&,google了好多方案,最终和ubuntu对显卡的支持有关,需要手动添加显卡选项: nomodeset,使其支持Nvidia系列显卡,参考:& or
2) 磁盘分区,全部干掉之前主机自带的Window 10系统,分区为 /boot, /, /home 等几个目录,同时把第二块4T硬盘也挂载了上去,作为数据盘。
3)安装完毕后Ubuntu 16.04的分辨率很低,在显卡驱动未安装之前,可以手动修改一下grub文件:
sudo vim /etc/default/grub
# The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo& #GRUB_GFXMODE=640&480 # 这里分辨率自行设置 GRUB_GFXMODE=
sudo update-grub
4)安装SSH Server,这样可以远程ssh访问这台GTX1080主机:
sudo apt-get install openssh-server
5)更新Ubuntu16.04源,用的是
cd /etc/apt/ sudo cp sources.list sources.list.bak sudo vi sources.list
把下面的这些源添加到source.list文件头部:
deb http://mirrors./ubuntu/ xenial main restricted universe multiverse deb http://mirrors./ubuntu/ xenial-security main restricted universe multiverse deb http://mirrors./ubuntu/ xenial-updates main restricted universe multiverse deb http://mirrors./ubuntu/ xenial-proposed main restricted universe multiverse deb http://mirrors./ubuntu/ xenial-backports main restricted universe multiverse deb-src http://mirrors./ubuntu/ xenial main restricted universe multiverse deb-src http://mirrors./ubuntu/ xenial-security main restricted universe multiverse deb-src http://mirrors./ubuntu/ xenial-updates main restricted universe multiverse deb-src http://mirrors./ubuntu/ xenial-proposed main restricted universe multiverse deb-src http://mirrors./ubuntu/ xenial-backports main restricted universe multiverse
最后更新源和更新已安装的包:
sudo apt-get update sudo apt-get upgrade
2. 安装GTX1080驱动
安装 Nvidia 驱动 367.27
sudo add-apt-repository ppa:graphics-drivers/ppa
第一次运行出现如下的警告:
Fresh drivers from upstream, currently shipping Nvidia.
## Current Status
We currently recommend: nvidia&361 nvidia-361 , Nvidia&s current long lived branch. For GeForce 8 and 9 series GPUs use nvidia&340nvidia-340 For GeForce 6 and 7 series GPUs use nvidia&304nvidia-304
## What we&re working on right now:
& Normal driver updates& Investigating how to bring this goodness to distro on a cadence.
## WARNINGS:
This PPA is currently in testing, you should be experienced with packaging before you dive in here. Give us a few days to sort out the kinks.
Volunteers welcome! See also: /mamarley/nvidia-graphics-drivers/
/download/desktop/contribute 更多信息: https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa 按回车继续或者 Ctrl+c 取消添加
回车后继续:
sudo apt-get update sudo apt-get install nvidia-367 sudo apt-get install mesa-common-dev sudo apt-get install freeglut3-dev
之后重启系统让GTX1080显卡驱动生效。
3. 下载和安装CUDA
之前,google了一下,发现在Ubuntu16.04下安装CUDA7.5问题多多,幸好CUDA8已出,支持GTX1080:
New in CUDA 8
Pascal Architecture Support Out of box performance improvements on Tesla P100, supports GeForce GTX 1080 Simplify programming using Unified memory on Pascal including support for large datasets, concurrent data access and atomics* Optimize Unified Memory performance using new data migration APIs* Faster Deep Learning using optimized cuBLAS routines for native FP16 computation Developer Tools Quickly identify latent system-level bottlenecks using the new critical path analysis feature Improve productivity with up to 2x faster NVCC compilation speed Tune OpenACC applications and overall host code using new profiling extensions Libraries Accelerate graph analytics algorithms with nvGRAPH New cuBLAS matrix multiply optimizations for matrices with sizes smaller than 512 and for batched operation
不过下载CUDA需要注册和登陆NVIDIA开发者账号,
提供了很详细的系统选择和安装说明,
这里选择了Ubuntu16.04系统runfile安装方案,千万不要选择deb方案,前方无数坑:
下载的&cuda_8.0.27_linux.run&有1.4G,按照Nivdia官方给出的方法安装CUDA8:
sudo sh cuda_8.0.27_linux.run --tmpdir=/opt/temp/
这里加了&tmpdir主要是直接运行&sudo sh cuda_8.0.27_linux.run&会提示空间不足的错误,其实是全新的电脑主机,硬盘足够大的,google了以下发现加个tmpdir就可以了:
Not enough space on parition mounted at /.Need
Disk space check has failed. Installation cannot continue.
执行后会有一系列提示让你确认,非常非常非常非常关键的地方是是否安装361这个低版本的驱动:
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 361.62?
答案必须是n,否则之前安装的GTX1080驱动就白费了,而且问题多多。
Logging to /opt/temp//cuda_install_6583.log Using more to view the EULA. End User License Agreement &&&&&&&&&
Preface&&-
The following contains specific license terms and conditions for four separate NVIDIA products. By accepting this agreement, you agree to comply with all the terms and conditions applicable to the specific product(s) included herein.
Do you accept the previously read EULA?accept/decline/quit: accept
Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 361.62?(y)es/(n)o/(q)uit: n
Install the CUDA 8.0 Toolkit?(y)es/(n)o/(q)uit: y
Enter Toolkit Location[ default is /usr/local/cuda-8.0 ]:
Do you want to install a symbolic link at /usr/local/cuda?(y)es/(n)o/(q)uit: y
Install the CUDA 8.0 Samples?(y)es/(n)o/(q)uit: y
Enter CUDA Samples Location[ default is /home/textminer ]:
Installing the CUDA Toolkit in /usr/local/cuda-8.0 & Installing the CUDA Samples in /home/textminer & Copying samples to /home/textminer/NVIDIA_CUDA-8.0_Samples now& Finished copying samples.
=========== = Summary = ===========
Driver: Not Selected Toolkit: Installed in /usr/local/cuda-8.0 Samples: Installed in /home/textminer
Please make sure that & PATH includes /usr/local/cuda-8.0/bin & LD_LIBRARY_PATH includes /usr/local/cuda-8.0/lib64, or, add /usr/local/cuda-8.0/lib64 to /etc/ld.so.conf and run ldconfig as root
To uninstall the CUDA Toolkit, run the uninstall script in /usr/local/cuda-8.0/bin
Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-8.0/doc/pdf for detailed information on setting up CUDA.
***WARNING: Incomplete installation! This installation did not install the CUDA Driver. A driver of version at least 361.00 is required for CUDA 8.0 functionality to work. To install the driver using this installer, run the following command, replacing with the name of this run file: sudo .run -silent -driver
Logfile is /opt/temp//cuda_install_6583.log
安装完毕后,再声明一下环境变量,并将其写入到 ~/.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}}
最后再来测试一下CUDA,运行:
nvidia-smi
结果如下所示:
再来试几个CUDA例子:
cd 1_Utilities/deviceQuerymake
这里如果提示gcc版本过高,可以安装低版本的gcc并做软连接替换,具体方法请自行google,我在用低版本的gcc4.9替换了ubuntu16.04自带的gcc5.x版本。
&/usr/local/cuda-8.0&P/bin/nvcc -ccbin g++ -I../../common/inc -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o deviceQuery.o -c deviceQuery.cpp &/usr/local/cuda-8.0&P/bin/nvcc -ccbin g++ -m64 -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_60,code=compute_60 -o deviceQuery deviceQuery.o mkdir -p ../../bin/x86_64/linux/release cp deviceQuery ../../bin/x86_64/linux/release
执行 ./deviceQuery ,得到:
./deviceQuery Starting&
CUDA Device Query (Runtime API) version (CUDART static linking)
Detected 1 CUDA Capable device(s)
Device 0: &GeForce GTX 1080& CUDA Driver Version / Runtime Version 8.0 / 8.0 CUDA Capability Major/Minor version number: 6.1 Total amount of global memory: 8112 MBytes ( bytes) (20) Multiprocessors, (128) CUDA Cores/MP: 2560 CUDA Cores GPU Max Clock rate: 1835 MHz (1.84 GHz) Memory Clock rate: 5005 Mhz Memory Bus Width: 256-bit L2 Cache Size: 2097152 bytes Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(536), 3D=(1, 16384) Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers Maximum Layered 2D Texture Size, (num) layers 2D=(3), 2048 layers Total amount of constant memory: 65536 bytes Total amount of shared memory per block: 49152 bytes Total number of registers available per block: 65536 Warp size: 32 Maximum number of threads per multiprocessor: 2048 Maximum number of threads per block: 1024 Max dimension size of a thread block (x,y,z): (, 64) Max dimension size of a grid size (x,y,z): (, 6) Maximum memory pitch:
bytes Texture alignment: 512 bytes Concurrent copy and kernel execution: Yes with 2 copy engine(s) Run time limit on kernels: Yes Integrated GPU sharing Host Memory: No Support host page-locked memory mapping: Yes Alignment requirement for Surfaces: Yes Device has ECC support: Disabled Device supports Unified Addressing (UVA): Yes Device PCI Domain ID / Bus ID / location ID: 0 / 1 / 0 Compute Mode: &Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) &
deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX 1080Result = PASS
再测试试一下nobody:
cd ../../5_Simulations/nbody/make
./nbody -benchmark -numbodies=256000 -device=0
& Windowed mode & Simulation data stored in video memory & Single precision floating point simulation & 1 Devices used for simulation gpuDeviceInit() CUDA Device [0]: &GeForce GTX 1080 & Compute 6.1 CUDA device: [GeForce GTX 1080] number of bodies = 256000 256000 bodies, total time for 10 iterations:
ms = 286.000 billion interactions per second =
single-precision GFLOP/s at 20 flops per interaction
Ubuntu 14.04 安装配置CUDA&
Ubuntu 12.04配置NVIDIA CUDA5.5实录&
Ubuntu安装Theano+CUDA&
关于Ubuntu 12.04 下 CUDA5.5 的安装请参看如下链接
Caffe配置简明教程 ( Ubuntu 14.04 / CUDA 7.5 / cuDNN 5.1 / OpenCV 3.1 )
在Ubuntu 14.04上配置CUDA+Caffe+cuDNN+Anaconda+DIGITS&
Ubuntu16.04下CUDA8.0+Caffe安装配置过程&
Ubuntu 14.04下CUDA8.0 + cuDNN v5 + Caffe& 安装配置
更多Ubuntu相关信息见 专题页面
本文永久更新链接地址:
相关资讯 & & &
& (06月22日)
& (02月22日)
& (08月21日)
& (03月07日)
& (01月07日)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅读并接受上述条款caffe学习(21)
注意:本教程只针对以下配置而言,其他配置可能会出现其他问题,不承担任何责任。
配置说明:
双硬盘双系统,250G固态硬盘装了win10,4T机械硬盘装了Ubuntu16.04
双显卡:集显加独显(GTX1080)
先按照了win10,再装Ubuntu16.04,都是制作了U盘引导盘安装,没什么好说
<span style="font-family:KaiTi_GB80装机只能使用DVI接口的显示器,无法使用VGA或者转接头之类的。或者先使用集显连显示器。当然当你把显卡驱动安好之后,是能用VGA接口的,不过在那之前,VGA不识别。
2、1080需要使用自己的显卡驱动,不能使用cuda 自带的驱动。
3、Ubuntu16.04 系统的默认GCC版本为5.4, 而编译caffe最高只支持5.3.
4、不能直接安装,因为cuda8是新出的,opencv 无法识别。
一、安装Ubuntu16.04
1、先上官网下载Ubuntu16.04的镜像iso
2、再用UltraISO制作引导盘
3、U盘按照Ubuntu16.04
在这里发现如果显示器接的是独显1080的话,会出现分辨率问题而无法进行安装界面,屏幕显示“输入不支持”。
在这里卡了很久,也谷歌了好久,网上都说需要手动添加显卡选项: nomodeset,使其支持Nvidia系列显卡。
(参考:&&or&)
但发现还是没能解决问题。后来是把视频线接到集显输出后,就能正常进入安装界面,在安装完后,我也是手动修改了grub文件,顺便改改分辨率:
找到这一行:GRUB_CMDLINE_LINUX_DEFAULT=&quiet splash&修改为:GRUB_CMDLINE_LINUX_DEFAULT=&quiet splashnomodeset&
然后顺便改分辨率
# The resolution used on graphical terminal&
# note that you can use only modes which your graphic card supports via VBE&
# you can see them in real GRUB with the command `vbeinfo’&
#GRUB_GFXMODE=640×480&
# 这里分辨率自行设置&
GRUB_GFXMODE=
更新GRUB:
二、安装nvidia显卡驱动
在这里附上一下关于查看显卡信息的命令
(1)检查你的电脑有哪些显卡
(2)查看哪一个专有驱动是推荐安装的
有个recommended 的那个驱动就是推荐的。
也可以上官网查自己显卡型号推荐的驱动()
安装驱动有三种方法:(1)run文件;(2)deb文件;(3)第三方安装
各种尝试后发现第三种方法是最简便安全的。试过第一种,要各种配置,装完后还在图形界面那里无限循环了,反正就各种问题
下面是第三种方法:
第一次运行出现如下的警告:
Fresh drivers from upstream, currently shipping Nvidia.
## Current StatusWe currently recommend: nvidia-361nvidia-361, Nvidia’s current long lived branch.&
For GeForce 8 and 9 series GPUs use nvidia-340nvidia-340 For GeForce 6 and 7 series GPUs use nvidia-304nvidia-304
## What we’re working on right now:– Normal driver updates– Investigating how to bring this goodness to distro on a cadence.
## WARNINGS:This PPA is currently in testing, you should be experienced with packaging before you dive in here.&
Give us a few days to sort out the kinks.Volunteers welcome! See also: /mamarley/nvidia-graphics-drivers//download/desktop/contribute
更多信息: https://launchpad/~graphics-drivers/&#43;archive/ubuntu/ppa&
按回车继续或者 Ctrl&#43;c 取消添加
回车后继续:
把上面的显卡驱动型号改成你匹配的型号
之后重启系统让GTX1080显卡驱动生效&
终端输入:
出现类&#20284;上述界面说明安装成功了
三、安装cuda-8.0
在安装 CUDA 之前,google了一下,发现在Ubuntu16.04下安装CUDA7.5问题多多,幸好CUDA8已出,支持GTX1080:
从上图也可以看出,CUDA 也有好几种安装方法,
但不推荐用deb方法,因为deb包里自带了一个旧的显卡驱动,不支持1080,安装完后需要重新安装367版本的显卡驱动。
参考文章【3】是按deb方法安装的,可作参考
下面介绍run方法:
1、官网下载“cuda_8.0.27_linux.run”(建议先在windows下载再拷过去),或者从我给的百度网盘里也有下载;2、sudo
sh cuda_8.0.27_linux.run&
有可能要加&--override&参数:
这个参数会覆盖原来的驱动,如果没出现问题可以不需要这个参数。
启动安装程序,一直按空&#26684;到最后,输入accept接受条款&输入n不安装nvidia图像驱动,之前已经安装过了&输入y安装cuda 8.0工具&回车确认cuda默认安装路径:/usr/local/cuda-8.0&输入y用sudo权限运行安装,输入密码&输入y或者n安装或者不安装指向/usr/local/cuda的符号链接&输入y安装CUDA
8.0 Samples,以便后面测试&回车确认CUDA 8.0 Samples默认安装路径:/home/pawn(pawn是我的用户名),该安装路径测试完可以删除&
3、添加环境变量
保存退出后使其立刻生效
4、安装例程测试
(1)查看cuda版本
(2)最后进入cuda自带的例子中看cuda是否已正确配置&
这里可能出现gcc、g&#43;&#43;版本过高的问题。
两种方法:
a、直接下载低版本的gcc、g&#43;&#43;替换之
ubuntu16.04 默认安装的gcc版本为gcc-5.4,(可用gcc --version查看)有时可能需要低版本的,所以我们先安装gcc-4.8.5 &
这样再用gcc --version查看就是4.8.5了,如果想切换为系统默认的版本:&
b、修改源码,使其支持更高版本的gcc和g&#43;&#43;
Ctrl &#43; F 搜索GNUC,找到一段类&#20284;于 &“if _GNUC_&5 || (_GNUC_ == 5 &&_GNUC_MINOR_& 3)”,就是最大支持gcc-5.3,可自己取消该限制。建议改为使其支持gcc-5.4,或者直接把两个5改成6
(3)进入例程
./deviceQuery Starting…CUDA Device Query (Runtime API) version (CUDART static linking)Detected 1 CUDA Capable device(s)Device 0: “GeForce GTX 1080”&CUDA Driver Version / Runtime Version 8.0 / 8.0&CUDA Capability Major/Minor
version number: 6.1&Total amount of global memory: 8112 MBytes ( bytes)&(20) Multiprocessors, (128) CUDA Cores/MP: 2560 CUDA Cores&GPU Max Clock rate: 1835 MHz (1.84 GHz)&Memory Clock rate: 5005 Mhz&Memory Bus Width: 256-bit&L2 Cache Size: 2097152
bytes&Maximum Texture Dimension Size (x,y,z) 1D=(131072), 2D=(536), 3D=(1, 16384)&Maximum Layered 1D Texture Size, (num) layers 1D=(32768), 2048 layers&Maximum Layered 2D Texture Size, (num) layers 2D=(3), 2048 layers&Total
amount of constant memory: 65536 bytes&Total amount of shared memory per block: 49152 bytes&Total number of registers available per block: 65536&Warp size: 32&Maximum number of threads per multiprocessor: 2048&Maximum number of threads per block: 1024&Max
dimension size of a thread block (x,y,z): (, 64)&Max dimension size of a grid size (x,y,z): (, 6)&Maximum memory pitch:
bytes&Texture alignment: 512 bytes&Concurrent copy and kernel execution: Yes with 2 copy engine(s)&Run
time limit on kernels: Yes&Integrated GPU sharing Host Memory: No&Support host page-locked memory mapping: Yes&Alignment requirement for Surfaces: Yes&Device has ECC support: Disabled&Device supports Unified Addressing (UVA): Yes&Device PCI Domain ID / Bus
ID / location ID: 0 / 1 / 0&Compute Mode:&&Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) &deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 8.0, CUDA Runtime Version = 8.0, NumDevs = 1, Device0 = GeForce GTX 1080Result
说明cuda已经安装成功!
四、安装opencv3.0
网上有opencv3,0的安装脚本,非常方便,如果你还提前下载了对应版本的安装包,那就更省时间了
1、提供一个百度云,里面有安装包。百度云盘链接: /s/1qX1uFHa 密码:wysa
2、在Install-OpenCV-master文件夹中包含安装各个版本opencv脚本
3、切换到目录执行,安装依赖项:&
4、执行opencv3.0安装脚本&
等待安装完成即可
期间可能会卡在ippcv的下载中,Ctrl &#43; c中断后,可以自行从http://sourceforge/projects/opencvlibrary/files/3rdparty/ippicv这里下载,解压到opencv-master
—& 3rdparty —& ippicv —& downloads —&&-xxxxxxxxxxxxxxxx 下面
再把选项-D WITH_IPP=OFF添加到上面的cmake命令中,重新cmake即可。即
提醒一下,这时候要把opencv3_0_0.sh这个文件稍微修改一下啊,比如注释掉mkdir build 等,还可以把后面的make -j4改到make -j16
最后就只需要等待安装完就好,过程要挺久的,慢慢等!
问题1、 cuda8.0新出,opencv3.0.0或者2.4.10不支持。报错:
解决方案:需要修改一处源码:
在OpenCV/opencv-3.0.0/modules/cudalegacy/src/graphcuts.cpp中做以下修改
问题2、opencv可编译成功,但运行时始终遇到问题:
这是因为编译的opencv计算能力与电脑显卡的实际计算能力不匹配导致的。一般而言直接添加一下2个cmake编译选项即可解决
但如果运气不佳,添加编译选项并不能解决问题。这时候我们需要修改opencv中关于CUDA计算能力这部分的配置文件./cmake/OpenCVDetectCUDA.cmake。
五、安装cudnn
在下载cudnn v5.0 for cuda8.0rc:
&cudnn-8.0-linux-x64-v5.0-ga.tgz&
还有v3,v4,v5.1版本的,可以都先下下来,之后编译或者以后可能会出现cudnn版本不适应的问题,这时候就要一个版本一个版本的去试了
安装过程很简单,直接解压拷贝就可以了: &
建立软链接:
以后需要更换cudnn版本的时候就把原来的libcudnn*替换掉,再重新软链接就好(建议把重复的步骤做个脚本就方便了)
最后更新一下链接库就可以:
六、安装matlab14.04a
由于该软件为商业软件,仅提供百度云安装学习,并确保不使用做商业目的,下载24小时删除……&
下载链接&&&提取密码
将part1.rar压缩文件解压,如果无法解压,可以先安装unrar
将Mathworks.iso - 右键 - 使用磁盘映像挂载器打开”,进入装载的虚拟光盘,拷贝全部文件至home/Matlab 文件夹(想要安装的路径)(PS:取名不要有空&#26684;)
复制Crack/install.jar至 home/Matlab/Java/jar/ 并覆盖源文件
接着会出现一个类&#20284;window的安装窗口,按以下步骤操作
选项:不使用Internet安装&
序列号: - (随意20位数据)
默认路径:/usr/local/MATLAB/R2014a&
建议全选安装
勾选从默认启动路径创建符号链接(实现在任意位置运行matlab启动程序)&
激活文件:Crack/license_14a.lic&
拷贝 Crack/linux目录下的libmwservices.so 至 /usr/local/MATLAB/R2014a/bin/glnxa64
4.解决编译器gcc/g&#43;&#43;版本问题
因为Ubuntu 16.04的gcc/g&#43;&#43;版本是5.4,而Matlab 2014a(2015a)的版本是4.7.x所以在使用matla调用mex文件的时候,基本上都会报错,根据报错信息,考虑如下两步解决方案。&
A. 降级安装gcc/g&#43;&#43;版本为4.7.x
B. 暴力引用新版本GLIBCXX_3.4.21
通过命令“strings /usr/local/MATLAB/R2014a/sys/os/glnxa64/libstdc&#43;&#43;.so.6 | grep GLIBCXX_” 可以看一下,是否已经成功包含了GLIBCXX_3.4.21,如果已经存在,基本上就成功了。
建议用方法B,试过方法A,4.7版本的gcc在make all 时都会出错,应该前面cuda编译时用的就是5.4的,除非重装系统,把cuda也用4.7编译。
5.建立桌面快捷方式
&在/usr/share/applications 中创建Matlab2014.desktop 文档,并输入以下内容
七、安装caffe
1、安装基本依赖库
2、安装科学计算库BLAS(Basic Linear Algebra Subprograms 基本线性代数子程序)
常用的BLAS实现有:Intel MKL、atlas、OpenBLAS等。可以选择其中一种,其中atlas的安装最简单,而MKL最快,本人选择的是MKL。
1)安装atlas
a、下载与安装
首先下载并安装英特尔(R) 数学内核库 Linux* 版MKL(Intel(R) Parallel Studio XE Cluster Edition for Linux 2016),下载链接是:,
使用学生身份(邮件 &#43; 学校)下载Student版,填好各种信息,可以直接下载,同时会给你一个邮件告知序列号。下载完之后,要把文件解压到home文件夹(注意任何一级文件夹不能包含空&#26684;,否则安装会失败)
输入第三条命令后会打开图形安装界面,会有同意协议,输入序列号,选择安装库等,按照流程应该没问题。
PS: 安装的时候,建议使用root权限安装,过程中会要求输入Linux的root口令。(设置方法:命令行:$ sudo passwd)
b、MKL与CUDA的环境设置&
1.新建intel_mkl.conf, 并编辑之:
2.新建cuda.conf,并编辑之:
3.完成lib文件的链接操作,执行:
3、安装python的pip和easy_install,方便安装软件包&
按Ctrl&#43;D退出sudo su模式
1)下载caffe
去下载.zip安装包,放在某路径Caffe_Path下解压。
2)修改Makefile.config配置文件
进入caffe根目录: &
设置以下内容: &
保存退出。
3)编译caffe
继续在Caffe-master文件夹目录下:
&-j4&是使用CPU的多核进行编译,可以极大地加速编译的速度,建议使用。
必须根据自己CPU情况选择4或8或16,选择过大的数字编译时会出错!!!
编译过程中可能还会有各种问题,大多数都是cudnn的问题,还可能是一些库没安装好,cudnn的问题就换不同版本的cudnn试试。
如果出现问题:
可能是gcc版本问题,改回ubuntu16.04自带的gcc-5.4版本即可,居然方法请回去看“三、安装cuda-8.0”时的介绍。
有些是因为电脑问题,支持不了太低版本的cudnn,可能就用不了cudnn了。例如笔记本上显卡是GT540M,它的CUDA Capability是2.1,而官方的cudnn加速是不支持3.0以下的版本的,因此只能在Makefile.config中注释掉USE_CUDNN这行。
=================================================================
简单讲就是GPU的加速性能不够,CUDNN只支持CUDA Capability 3.0以上的GPU加速
==================================================================
如果是一些库的问题,那就手动编译,再在配置文件里加入库路径就好,有问题多百度谷歌,一步步排除,可以先注释cudnn,甚至是注释掉cuda,只是CPU_ONLY,一步步找出是在哪里出问题!
出错了就在原终端中输入make clean清除第一次编译结果&
再次输入make all -j4重新编译
4)编译python-caffe接口
编译完在终端输入python,再import caffe,如果没报错说明成功了
报错的话应该就是路径问题,只需要在~/.bashrc文件下export PYTHONPATH即可
再尝试import caffe ,应该没问题。
5)编译matlab-caffe接口
打开Makefile.config文件,注释掉MATLAB_DIR,并将MATLAB_DIR换成自己的MATLAB安装路径
虽然会有警告说gcc版本不一致,但最后还是编译成功了。
可以用matlab自带的一个demo检验一下,打开matlab,在matlab窗口敲入:
[python]&&
PS,还要先下一个cifar10里要用到的model:bvlc_reference_caffenet.caffemodel 才可以运行哦!
得到下面的结果即成功!
八、mnist测试
1、获取mnist数据集&
下载mnist数据集,终端输入&
在/home/pawn/caffe/data/mnist/目录下会多出训练集图片、训练集标签、测试集图片和测试集标签等4个文件
2、mnist数据&#26684;式转换&
必须要在第一行之后运行第二行,即必须要在caffe根目录下运行create_mnist.sh&
此时在/caffe/examples/mnist/目录下生成mnist_test_lmdb和mnist_train_lmdb两个LMDB&#26684;式的训练集和测试集
3、训练mnist
LeNet-5模型描述在/caffe/examples/mnist/lenet_train_test.prototxt
Solver配置文件在/caffe/examples/mnist/lenet_solver.prototxt
执行文件在/caffe/examples/mnist/train的lenet.sh&
即可开始训练,准确率一般都有0.99以上
最后想说的是1080太新了,可能caffe还有其他一些环境跟不上的话很容易出现一些意想不到的错误,希望大家都能顺利搭建成功吧!
最后再附上之前写的一篇装ubuntu后推荐安装的软件博文:&
九、备份系统
好不容易配好系统了,万一脑残不知动了哪给搞坏了怎么办?先备份个系统吧。&
9.1 系统备份 &
系统设置(system setting)里有Backups,但只能备份还原home文件夹。&
首先打开终端进入根目录并获取root权限&
其中 Ubuntu_backup.tgz为备份系统的名字,exclude参数用于设定忽略的文件夹,最后那个/是指示需要备份的目录。
备份完后就可以拷贝到其他盘里保存了。&
9.2 系统恢复 &
在 Ubuntu_backup.tgz 所在文件夹下打开终端获取root权限,将 Ubuntu_backup.tgz拷贝到根目录下&
新建备份时忽略的文件夹,如
参考文章:
&&相关文章推荐
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:382020次
积分:5194
积分:5194
排名:第5621名
原创:95篇
转载:332篇
评论:63条
(10)(1)(1)(9)(1)(10)(2)(6)(8)(1)(2)(8)(5)(3)(2)(20)(1)(4)(1)(4)(1)(1)(29)(32)(9)(15)(43)(28)(3)(17)(19)(16)(13)(13)(18)(40)(31)
(window.slotbydup = window.slotbydup || []).push({
id: '4740881',
container: s,
size: '200,200',
display: 'inlay-fix'

我要回帖

更多关于 cuda 版本查看 的文章

 

随机推荐