Ubuntu 11.04 安装 NVIDIA CUDA 4.0 RC2


NVIDIA CUDA 4.0 在 2011 年 4 月释出,一样有各种平台的版本,除了 Windows XP, Windows VISTA、Windows 7 与 Mac OS 外,Linux 的部份也支持好几种版本:
  • Fedora 13
  • RedHat Enterprise Linux 4.8
  • RedHat Enterprise Linux 5.5
  • RedHat Enterprise Linux 6.0
  • Ubuntu Linux 10.10
  • OpenSUSE 11.2
  • SUSE Linux Enterprise Server 11 SP1

这里介绍如何在 Ubuntu 11.04 中安装 CUDA 4.0 RC2,目前 NVIDIA 官方网站上明确支持的 Ubuntu 版本只有到 Ubuntu 10.10,但经过一些小修改,也可以装在 Ubuntu 11.04 的系统上。

安好后截图预览:

Ubuntu 11.04 安装 NVIDIA CUDA 4.0 RC2

图1

Ubuntu 11.04 安装 NVIDIA CUDA 4.0 RC2

图2

载与安装 CUDA 4.0 

首先从 NVIDIA 网站下载 CUDA Toolkit for Ubuntu Linux 10.10、CUDA Tools SDK 与 GPU Computing SDK code samples。

下载完成后先安装  CUDA Toolkit for Ubuntu Linux 10.10:

chmod +x cudatoolkit_4.0.13_linux_64_ubuntu10.10.run
sudo ./cudatoolkit_4.0.13_linux_64_ubuntu10.10.run


预设是安装在 /usr/local/cuda 目录下,建议就依照他的预设路径安装,安装完成后要设定 Library 的 Path,有两个方式,一种是更改 LD_LIBRARY_PATH 环境变数,但我习惯直接加在 /etc/ld.so.conf.d/ 里面:

sudo echo "/usr/local/cuda/lib64" > /etc/ld.so.conf.d/cuda-40.conf
sudo echo "/usr/local/cuda/lib" >> /etc/ld.so.conf.d/cuda-40.conf
sudo ldconfig


再设定 PATH:

echo 'export PATH=$PATH:/usr/local/cuda/bin' >> ~/.bashrc

安装 CUDA Tools SDK:

chmod +x cudatools_4.0.13_linux_64.run
sudo ./cudatools_4.0.13_linux_64.run


预设是安装在 /usr/local/cuda/CUDAToolsSDK 目录下。

安装 GPU Computing SDK code samples:

chmod +x gpucomputingsdk_4.0.13_linux.run
./gpucomputingsdk_4.0.13_linux.run


预设是安装在自己帐号的 ~/NVIDIA_GPU_Computing_SDK 目录下,安装时要设置 CUDA 安装的路径:
Enter CUDA install path (default /usr/local/cuda):
若 CUDA 都是依照预设路径安装,则这里就不需要更动。
  • 1
  • 2
  • 下一页

相关内容