caffe-segnet安装之路

本文的目的是记录这次毕业设计过程中为了实现语义分割部分所做的事情。我在这里不能提供一个全面详细的安装说明,只是写下自己在安装过程中的选择,参考资料和问题。

首先,我的电脑在三个月前安装了nvidia驱动,CUDA9.0以及cudnn7.5.

查看我的初始配置。

junbo@junbo:~$ nvcc -V

nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

junbo@junbo:~$ cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2

#define CUDNN_MAJOR 7
#define CUDNN_MINOR 5
#define CUDNN PATCHLEVEL 0
#define CUDNN_VERSION (CUDNN_MAJOR * 1000 + CUDNN_MINOR * 100 + CUDNN_PATCHLEVEL)

#include “driver_types.h”

junbo@junbo:~$ cat /proc/driver/nvidia/version

NVRM version: NVIDIA UNIX x86_64 Kernel Module 384.81 Sat Sep 2 02:43:11 PDT 2017
GCC version: gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
junbo@junbo:~$ nvidia-smi
Tue Apr 9 11:44:44 2019
±----------------------------------------------------------------------------+
| NVIDIA-SMI 384.81 Driver Version: 384.81 |
|-------------------------------±---------------------±---------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|=++==============|
| 0 GeForce GTX 960M Off | 00000000:01:00.0 Off | N/A |
| N/A 44C P0 N/A / N/A | 0MiB / 2002MiB | 0% Default |
±------------------------------±---------------------±---------------------+

±----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| No running processes found |
±----------------------------------------------------------------------------+

junbo@junbo:~$ gcc --version

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
Copyright © 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

我的初步想法是配置一个支持cuda, cudnn的caffe, 这样在后续的过程中可以训练我自己的数据,也加快了分割速度。

由于SegNet需要支持cudnnv5版本的caffe,而cudnnv5.1是与CUDA8.0对应的,因此,我需要安装多版本的共存。
环境信息的对应信息:https://blog.csdn.net/zl535320706/article/details/83474849
Ubuntu16.04下安装多版本cuda和cudnn:https://blog.csdn.net/tunhuzhuang1836/article/details/79545625
安装多版本 cuda ,多版本之间切换:https://blog.csdn.net/maple2014/article/details/78574275

首先安装CUDA8.0,注意选择A2版本的.run文件,否则低版本的不支持Ubuntu16.04自带的gcc5.4,deb版本可能会重新安装显卡驱动

以下是安装的选择

Do you accept the previously read EULA?
accept/decline/quit: accept

Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 375.26?
(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: n

Install the CUDA 8.0 Samples?
(y)es/(n)o/(q)uit: y

Enter CUDA Samples Location
[ default is /home/junbo ]: n

Samples location must be an absolute path
Enter CUDA Samples Location
[ default is /home/junbo ]:

Driver: Not Selected
Toolkit: Installed in /usr/local/cuda-8.0
Samples: Installed in /home/junbo

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 /tmp/cuda_install_6840.log

注意,这里安装完成后还需要将cuda添加到环境变量中,而且注意,现在做的是多版本共存,所以添加的路径应该是cuda而不是特指的某个cuda版本,见:https://www.jianshu.com/p/6a6fbce9073f
我的具体做法是:

在/.bashrc中添加
export PATH=/usr/local/cuda-8.0/bin: P A T H e x p o r t L D L I B R A R Y P A T H = / u s r / l o c a l / c u d a − 8.0 / l i b 64 : PATH export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64: PATHexportLDLIBRARYPATH=/usr/local/cuda8.0/lib64:LD_LIBRARY_PATH
以及修改etc/profile
export PATH=/usr/local/cuda-9.0/bin: P A T H e x p o r t L D L I B R A R Y P A

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值