Guide of Installing CUDA-7.5 on Ubuntu 14.04

原创 2015年11月18日 22:30:57

Guide of Installing CUDA-7.5 on Ubuntu 14.04

I have struggled a whole day to install the driver of Nvidia GTX 970 on Ubuntu. In this blog, you will learn step by step to pre-configure your Linux and run the installation run-file. I hope this blog will save your time. You are welcome!


[1] PRE-INSTALLATION ACTIONS

(1)Verify You Have a CUDA-Capable GPU

To verify that your GPU is CUDA-capable, go to your distribution’s equivalent of System Properties, or, from the command line, enter:

$ lspci | grep -i nvidia

If you do not see any settings, update the PCI hardware database that Linux maintains by entering update-pciids (generally found in /sbin) at the command line and rerun the previous lspci command.

If your graphics card is from NVIDIA and it is listed in http://developer.nvidia.com/ cuda-gpus, your GPU is CUDA-capable.

The Release Notes for the CUDA Toolkit also contain a list of supported products.

(2) Verify You Have a Supported Version of Linux

The CUDA Development Tools are only supported on some specific distributions of Linux. These are listed in the CUDA Toolkit release notes.
To determine which distribution and release number you’re running, type the following at the command line:

$ uname -m && cat /etc/*release

You should see output similar to the following, modified for your particular system:

x86_64
Red Hat Enterprise Linux Workstation release 6.0 (Santiago)

The x86_64 line indicates you are running on a 64-bit system. The remainder gives information about your distribution.

(3) Verify the System Has gcc Installed

The gcc compiler is required for development using the CUDA Toolkit. It is not required for running CUDA applications. It is generally installed as part of the Linux installation, and in most cases the version of gcc installed with a supported version of Linux will work correctly.

To verify the version of gcc installed on your system, type the following on the command line:

$ gcc --version

If an error message displays, you need to install the development tools from your Linux distribution or obtain a version of gcc and its accompanying toolchain from the Web.

(4) Verify the System has the Correct Kernel Headers and Development Packages Installed

The CUDA Driver requires that the kernel headers and development packages for the running version of the kernel be installed at the time of the driver installation, as well whenever the driver is rebuilt. For example, if your system is running kernel version 3.17.4-301, the 3.17.4-301 kernel headers and development packages must also be installed.

While the Runfile installation performs no package validation, the RPM and Deb installations of the driver will make an attempt to install the kernel header and development packages if no version of these packages is currently installed. However, it will install the latest version of these packages, which may or may not match the version of the kernel your system is using. Therefore, it is best to manually ensure the correct version of the kernel headers and development packages are installed prior to installing the CUDA Drivers, as well as whenever you change the kernel version.

The version of the kernel your system is running can be found by running the following command:

$ uname -r

This is the version of the kernel headers and development packages that must be installed prior to installing the CUDA Drivers. This command will be used multiple times below to specify the version of the packages to install. Note that below are the common-case scenarios for kernel usage. More advanced cases, such as custom kernel branches, should ensure that their kernel headers and sources match the kernel build they are running.

The kernel headers and development packages for the currently running kernel can be installed with:

$ sudo apt-get install linux-headers-$(uname -r)

[2] RUNFILE INSTALLATION

Perform the following steps to install CUDA and verify the installation.

Because the GPU cannot be recognized by Ubuntu 14.04 automatically, you have to use iGpu first to play with your system, and you can set this in your BIOS.

step 0: Shutdown the X window.

sudo service lightdm stop

step 1: Disable the Nouveau drivers

1. Create a file at /etc/modprobe.d/blacklist-nouveau.conf with the following contents:

blacklist nouveau
options nouveau modeset=0

2. Regenerate the kernel initramfs:

sudo update-initramfs -u

step 2: Reboot into runlevel 3

sudo init 3

step 3: Run the installer silently to install with the default selections (implies acceptance of the EULA):

sudo sh cuda_<version>_linux.run

After this step, you will see the installation failed. That maybe caused by you are using iGPU but not GPU. Now, you have to shutdown your computer and plug in your DVI cable on you GPU to connect with your screen and then enter your BIOS to set use GPU(maybe AUTO or PCIE). Although the previous installation has not successfully installed the whole CUDA, it still made the GPU driven to light the screen. With this GPU lighting screen, you need to repeat the previous four steps and you will see the successful installation.

step 4: Create an xorg.conf file to use the NVIDIA GPU for display

$ sudo nvidia-xconfig

Without this step, you will suffer from loop login.

step 5: Set up the development environment by modifying the PATH and LD_LIBRARY_PATH variables

You are recommended to add the following commands to your .bashrc

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

step 6: Reboot the system to load the graphical interface.

Install OpenCV

When you make OpenCV, you should try the following command.

cd opencv-[version]/
mkdir build
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..
make -j 4
sudo make install

This blog refers to the manual of CUDA and some Q&As on the web.

Enjoy your research!

版权声明:本文为博主原创文章,未经博主允许不得转载。

相关文章推荐

NVIDIA Cuda 7.5 on Ubuntu 14.04 64 bits

关于在Linux上搭Cuda环境,做个笔记备忘。 1. 安装GPU Driver 在Ubuntu中可以通过System Settings -> Software & Updates安装: ...

Installing CUDA 8.0 + cuDNN 5.1 + TensorFlow with Ubuntu 14.04 (上)

花了一天在Ubuntu 14.04安装CUDA 8.0 + cuDNN 5.1 + TensorFlow,最终成功,记录一下安装过程,方便日后重装。教程大多来自外网,所以就用英文记录,不翻译了。 1、...

Installing CUDA 8.0 + cuDNN 5.1 + TensorFlow with Ubuntu 14.04 (下)

Step 2. Install NVIDIA cuDNN Once the CUDA Toolkit is installed, download cuDNN v5.1 Library(或者从百度云下...

ubuntu14.04+cuda7.5+caffe

一CUDA Repository 二CUDA Toolkit 三Environment Variables 四 安装CUDA SAMPLE 五安装 Atlas 六opencv 安装 七python 安...

ubuntu14.04+caffe+cuda7.5 出现unmet dependencies错误

官网上下载deb(local)安装包,并且完全按照官方文档安装,然后出现如下错误: The following packages have unmet dependencies: cuda...

Darknet(YOLO)安装与测试笔记(T440p+Ubuntu14.04+OpenCV2.4.10+CUDA7.5)

本笔记记录安装测试Joseph Redmon的YOLO代码。 项目主页:http://pjreddie.com/darknet/yolo/ CVPR论文:Only Look Once:Unifie...

Caffe配置简明教程 ( Ubuntu 14.04 / CUDA 7.5 / cuDNN 5.1 / OpenCV 3.1 )

1. 前言 本教程使用的系统是Ubuntu 14.04 LTS 64-bit,使用的CUDA版本为7.5,使用的NVIDIA驱动版本为352。 如果您使用的Pascal架构显卡,如GTX1080或者新...

Ubuntu14.04 64位配置Caffe 教程(基于CUDA7.5)

深度学习是研究计算机视觉的重要工具,尤其在图像分类与识别等领域有着划时代的意义。现在有很多深度学习框架,Caffe是比较常用的一个。本文讲述了Ubuntu 14.04(64位)系统下配置Caffe的基...
  • zzlyw
  • zzlyw
  • 2016-11-18 12:57
  • 846

Ubuntu14.04+CUDA7.5+Anaconda2-4.0.0+Matlab2014b+Caffe from Scratch

Ubuntu14.04+CUDA7.5+Anaconda2-4.0.0+Matlab2014b+Caffe from Scratch前言 花了三天时间,从装双系统到安装Caffe并编译成功,其间踩...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:深度学习:神经网络中的前向传播和反向传播算法推导
举报原因:
原因补充:

(最多只允许输入30个字)