Ubuntu16.04上安装CUDA Toolkit 8.0

安装场景:

服务器SCS4850上已经成功安装Ubuntu16.04和NVIDIA公司的显卡Tesla P40的驱动384.9。

CUDA是NVIDIA的编程语言平台,想使用GPU就必须要使用CUDA。 
从这里下载CUDA的安装文件。
https://developer.nvidia.com/cuda-release-candidate-download 
这里写图片描述
注意这里下载的是CUDA8.0的runfile(local)文件。 
这里是nvidia给出的官方安装指南(遇到问题时可以查阅): 
http://docs.nvidia.com/cuda/cuda-installation-guide-linux/#axzz4HIBXnwyt 
下载完CUDA8.0后,执行如下语句,运行runfile文件:

sudo sh cuda_8.0.27_linux.run

执行后会有一系列提示让你确认,但是注意,有个让你选择是否安装NVIDIA361驱动时,一定要选择否,因为前面我们已经安装了更加新的NVIDIA367,所以这里不要选择安装。其余的都直接默认或者选择是即可。

安装成功后会出现如下界面:

===========
= 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}}

然后设置环境变量和动态链接库,在命令行输入:

$ 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

使链接立即生效。

3、测试cuda的Samples

cd /usr/local/cuda-7.5/samples/1_Utilities/deviceQuery
make
sudo ./deviceQuery

如果显示的是一些关于GPU的信息,则说明安装成功了。

我的SCS4450的显示信息如下所示:

130537_6sIP_614348.png

转载于:https://my.oschina.net/wangsifangyuan/blog/1575004

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值