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!

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

Ubuntu14.04.2中文语言支持与输入法设置

参考资料 [1]Ubuntu 14.04中文输入法的安装  [2]Ubuntu系统如何设置添加中文输入法...
  • Q1302182594
  • Q1302182594
  • 2015年07月26日 09:15
  • 18588

Ubuntu 14.04主题美化

Ubuntu 14.04主题美化
  • u011762313
  • u011762313
  • 2015年08月07日 09:32
  • 1926

ubuntu 14.04英文版设置成中文版

ubuntu 14.04英文版设置成中文 适用于ubuntu 12.04英文版的系统,其它版本的设置应该是大同小异的。 进入ubuntu系统,在顶部齿状标志找到system... ...
  • dayancn
  • dayancn
  • 2015年04月04日 10:28
  • 6231

ubuntu 14.04 启用root用户解决方案

一、设置root用户密码以及切换root权限操作 1、首先,使用安装Ubuntu系统时的账户登录,我创建的用户为user,登录界面如下: 2、第二步、按下Ctrl+Alt+T组合键打开终端命令窗口...
  • jidi2009
  • jidi2009
  • 2017年03月03日 10:16
  • 4306

Ubuntu 14.04(64位)安装和使用docker

这里主要描述的如何在ubuntu 14.04(64)位中安装和使用docker,以及docker的一些基本命令的解释...
  • liujan511536
  • liujan511536
  • 2015年05月29日 11:01
  • 7040

ubuntu 14.04 server 下安装ZABBIX 及增加客户机配置过程

#首先安装apache、php5、mysql 这个几个软件(在已经默认装好的机器上没有配过,改天尝试一下) #apt-get 方式安装起来方便是方便就是没有办法人为控制 这点比较 su...
  • oushengm
  • oushengm
  • 2015年07月13日 14:59
  • 2185

Ubuntu 14.04中文输入法的安装

Ubuntu默认自带的中文输入法是IBUS框架的ibus-pinyin,IBUS-Bopomofo等。对于习惯于搜狗,紫光华宇,谷歌拼音的我们可能有点使用不习惯。下面就是安装常用的IBUS中文输入法。...
  • maverick1990
  • maverick1990
  • 2014年11月21日 16:56
  • 2095

Linux学习篇之---Ubuntu14.04防火墙配置

Ubuntu14.04防火墙配置 1、安装: apt-get install ufw 2、启用: ufw enable ufw default deny 3、开启/禁用: ufw all...
  • A_little_e
  • A_little_e
  • 2015年05月19日 13:17
  • 2624

Ubuntu 14.04安装与介绍

Linux在最近几年发展迅速,在各个领域都有非常重要的应用,包括:嵌入式、服务器、编程开发等等关键、热门领域。另外现在的Linux套装中含有非常良好、易操作的图形界面,所以就算不是拿来用于技术开发,L...
  • Nolan__Roronoa
  • Nolan__Roronoa
  • 2016年08月27日 14:42
  • 751

【安装教程】ubuntu14.04 自动升级为ubuntu16.04.1

7块钱的牛肉砂锅,大学校园里难得的福利。 今天讲一讲ubuntu14.04 64位系统自动升级为ubuntu16.04.1 64位系统的经历,非常顺利。 正常情况下,连接网络,终端输入下图三句(主...
  • u011918106
  • u011918106
  • 2016年11月28日 20:30
  • 1180
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Guide of Installing CUDA-7.5 on Ubuntu 14.04
举报原因:
原因补充:

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