感谢支持
我们一直在努力

Ubuntu 12.04配置NVIDIA CUDA5.5实录

现在重新在Ubuntu 12.04下配置NVIDIA CUDA5.5,特此记录参考网站以便查阅。

环境:Ubuntu 12.04+Cuda5.5

1. 判断安装环境:

  • The setup of CUDA development tools on a system running the appropriate version of Linux consists of a few simple steps:
  • Verify the system has a CUDA-capable GPU.
  • Verify the system has a supported version of Linux.
  • Verify the system has gcc installed.

见官方配置手册:http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html

2. 下载镜像:

https://developer.nvidia.com/cuda-downloads

下run好了

3. 安装必要的库

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev
libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

4. 删除已有nvidia,拉黑名单

sudo apt-get remove –purge nvidia*
sudo nano /etc/modprobe.d/blacklist.conf

blacklist.conf加入

lacklist amd76x_edac
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv

————————————–分割线 ————————————–

Ubuntu 12.04 下 CUDA 编程 http://www.linuxidc.com/linux/2014-06/103056.htm

Ubuntu 12.04 安装 CUDA-5.5  http://www.linuxidc.com/Linux/2013-10/91101.htm

Ubuntu 11.10 上安装CUDA开发环境 http://www.linuxidc.com/Linux/2012-04/58913.htm

Fedora 15系统下配置CUDA环境 http://www.linuxidc.com/Linux/2011-12/49874.htm

Ubuntu 11.04 安装 NVIDIA CUDA 4.0 RC2 http://www.linuxidc.com/Linux/2011-10/46304.htm

Linux Mint 13/Ubuntu 12.04 配置CUDA 4.2 & OpenCV 2.4.2 方法 http://www.linuxidc.com/Linux/2013-10/91102.htm

CUDA入门教程 http://www.linuxidc.com/Linux/2014-07/104328.htm

————————————–分割线 ————————————–

5. Ctrl+Alt+F1, 登陆后安装

sudo service lightdm stop
chmod +x cuda_5.5.22_linux_64.run
sudo ./cuda_5.5.22_linux_64.run

Cuda5.5集成了toolkit,sdk和driver, 所以安装的时候一路同意下来就好了

6. 得到以下安装结果

Driver:  Installed

Toolkit:  Installed In /Usr/Local/Cuda-5.0

Samples:  Installation Failed. Missing Required Libraries.

也就是SDK安装失败,这个官方手册上也提到了解决方案。

7. 单独安装SDK

解压sdk:

sh cuda_5.5.22_linux_64.run -extract=/path/to/extract/dir/

到根目录下的/path/to/extract/dir/去找cuda-samples_5.5.22_*******.run, 安装

sh cuda-samples_5.5.22_*******.run

8. Path配置:

$sudo gedit etc/profile或~/.bashrc

export PATH=$PATH:/usr/local/cuda-5.5/bin
export LD_LIBRARY_PATH=/usr/local/cuda-5.5/lib64:/lib

使之生效:

source /etc/profile(对应profile)或sudo ldconfig(对应bashrc)

还有一种装sdk的方法见http://askubuntu.com/questions/338907/how-to-install-cuda-5-5-under-ubuntu-12-04-lts-64-bit

9. 验证

见官网http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-linux/index.html#verify-installation

nvcc-V:

Ubuntu 12.04配置NVIDIA CUDA5.5实录

deviceQuery:

Ubuntu 12.04配置NVIDIA CUDA5.5实录

10. Cuda Hello World:

https://devtalk.nvidia.com/default/topic/486692/cuda-programming-and-performance/guide-installing-cuda-sdk-on-linux-walkthrough-on-how-to-install-the-cuda-sdk-and-build-the-example/

正文最下方

11. 装好theano的前提下配置~/.theanorc配置GPU

sudo vim ~/.theanorc

写入

[global]

floatX = float32

device = gpu

进行测试:http://deeplearning.net/software/theano/tutorial/using_gpu.html#testing-theano-with-gpu

Ubuntu 12.04配置NVIDIA CUDA5.5实录

此外附上其他配置参考:

1. theano+Python模块

(Ubuntu 12.04自带python不用装,但要注意系统里很多模块依赖python,没事不要随便删!!!) http://www.linuxidc.com/Linux/2014-10/107503.htm

更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-10/107502.htm

赞(0) 打赏
转载请注明出处:服务器评测 » Ubuntu 12.04配置NVIDIA CUDA5.5实录
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏