Install CUDA 6.0 on Ubuntu 14.04 LTS

Ubuntu 14.04 LTS is out, loads of new features have been added. Here are some procedures I followed to install CUDA 6.0 on my DELL Inspiron.

First of all, Ubuntu need to be installed successfully, and the
necessary libs are also need to installed:

sudo apt-get install build-essential gcc-4.4 g++-4.4 libxi-dev libxmu-dev freeglut3-dev

Things you need to have before start the installation
process:
1. Latest NVIDIA graphic driver
(NVIDIA-Linux-x86_64-331.49.run)
2. CUDA 6.0 installation file (cuda_6.0.37_linux_64.run)

Now let‘s install the graphic driver

If you’re not sure your system type, press Ctrl+Alt+T to open
terminal and run:

uname -m

1. Find out your graphics card model

Use the lspci command to find out the model of your graphics
card

$ lspci -vnn | grep -i VGA -A 12
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GT218 [GeForce 210] [10de:0a65] (rev a2) (prog-if 00 [VGA controller])
        Subsystem: ASUSTeK Computer Inc. Device [1043:8416]

2. Find out the right driver version for your graphics card

Visit http://www.nvidia.com/Download/index.aspx

Fill in the details about your graphics card and system and then
click Search. On the next page, it should tell you the correct
driver version with a download link and additional information.

For the above GeForce 210 card, it showed 331.67 as the correct
driver which can be downloaded from the website. However we shall
install the drivers from ppa to make things easier.

3. Setup the xorg-edgers ppa

The xorg-edgers ppa provides the very latest nvidia drivers. Run
the following commands to set it up.

$ sudo add-apt-repository ppa:xorg-edgers/ppa -y
$ sudo apt-get update

Now the ppa is setup and the package information is also updated.

4. Install the driver

Either you can install the driver directly by installing a single package containing "nvidia" and the major version number ( 173, 304, 310, 313, 319, 331, 334 or 337).

# 331 driver 
$ sudo apt-get install nvidia-331 
 # 334 driver 
$ sudo apt-get install nvidia-334 
# install the latest version 
$ sudo apt-get install nvidia-current

Or you can enable it from the "Additional Drivers" section. This is different on different Ubuntu flavors.

5. Verify the installation

The last thing to do is verify that the nvidia drivers are loaded
and working. Run the lspci command again and this time the kernel
driver should show nvidia

$ lspci -vnn | grep -i VGA -A 12

Check the last line which says "kernel driver in use: nvidia". This
shows that nvidia drivers are now in action. Also check hardware
acceleration with the glxinfo command

$ glxinfo | grep OpenGL | grep renderer
OpenGL renderer string: GeForce 210/PCIe/SSE2

The OpenGL renderer string should be anything other than "MESA". Then it indicates that the hardware drivers are being used for hardware acceleration.

6. Nvidia settings tool

Nvidia would install a gui tool called "Nvidia X Server Settings" somewhere in the menu. It can also be launched from the command line using the command "nvidia-settings". The tool shows miscellaneous information about the graphics card and the monitor connected, and also allows to configure various options.

7. Removing the drivers

Incase anything goes wrong after the installation, like you are not
able to boot Ubuntu, then try removing the Nvidia drivers.

Boot into the recovery console from the grub menu and then issue
the following commands

# remount root file system as writable 
$ mount -o remount,rw / 
 # remove all nvidia packages
 $ apt-get purge nvidia*

Additional Notes

Many tutorials out there talk about blacklisting the nouveau driver. This is no longer necessary, since the nvidia driver would blacklist nouveau itself. This can be verified by checking the contents of nvidia driver files in the the modprobe.d directory.

$ grep ‘nouveau‘ /etc/modprobe.d/* | grep nvidia 
/etc/modprobe.d/nvidia-331_hybrid.conf:blacklist nouveau
/etc/modprobe.d/nvidia-331_hybrid.conf:blacklist lbm-nouveau
/etc/modprobe.d/nvidia-331_hybrid.conf:alias nouveau off
/etc/modprobe.d/nvidia-331_hybrid.conf:alias lbm-nouveau off
/etc/modprobe.d/nvidia-graphics-drivers.conf:blacklist nouveau
/etc/modprobe.d/nvidia-graphics-drivers.conf:blacklist lbm-nouveau
/etc/modprobe.d/nvidia-graphics-drivers.conf:alias nouveau off
/etc/modprobe.d/nvidia-graphics-drivers.conf:alias lbm-nouveau off

Note that the files "nvidia-331_hybrid.conf" and "nvidia-graphics-drivers.conf" have blacklisted nouveau.

To check information about the nvidia driver module, use the commands lsmod, modprobe and modinfo

# check that nvidia kernel module is loaded or not 
$ lsmod | grep nvidia 
nvidia              10699336  49
drm                   302817  2 nvidia

# find the real name of the nvidia module
$ modprobe -R nvidia
nvidia_331

# details about the nvidia_331 module
$ modinfo nvidia_331
filename:       /lib/modules/3.13.0-24-generic/updates/dkms/nvidia_331.ko
alias:          char-major-195-*
version:        331.67
supported:      external
license:        NVIDIA
.....

The kernel module file for the nvidia driver is located at "/lib/modules/3.13.0-24-generic/updates/dkms/nvidia_331.ko".

Note that it is a "dkms" module which means, its loaded dynamically. Due to this the grub screen, the Ubuntu/Kubuntu splash screens would have a low resolution since at that time the nvidia drivers are not in effect, and whatever resolution is available via the VESA extensions, are used.

8. Another Option

$ sudo add-apt-repository ppa:xorg-edgers/ppa

$ sudo apt-get update

$ sudo apt-get install nvidia-340

Then remove it

$ sudo apt-get remove nvidia-340

9. Install CUDA

$ sudo apt install
nvidia-cuda-toolkit

One more tip:

Highlight CUDA syntax in Sublime

cd ~/.config/sublime-text-2/Packages/User

git clone
git://github.com/harrism/sublimetext-cuda-cpp.git

时间: 2024-10-21 23:25:57

Install CUDA 6.0 on Ubuntu 14.04 LTS的相关文章

64位双系统Ubuntu 14.04 LTS + Caffe + CUDA 7.5 + Opencv 3.0 安装配置实战

一切的一切,开端便是这caffe,作为博客的第一篇文章,自然要讲讲一个哲学问题"我是从哪来的" 一.windows情况下安装双系统64位Ubuntu 本段落根据http://www.linuxidc.com/Linux/2014-04/100369p2.htm而成. 下面开始: 1)首先还是分区,在计算机上右键--管理--磁盘管理 装Ubuntu分配的硬盘大小最好是(20G以上)不要太小,配好整个环境就要消耗10G左右,再加上数据集和各种库,空间太小非常尴尬.这里请注意,Ubuntu和

Install Redmine 3.2.0 on Ubuntu 14.04

To install redmine 3.2.0 on Ubuntu 14.04, mainly follow the tutorial: HowTo Install Redmine 3.0.x on Ubuntu 14.04 with Apache2, Phusion Passenger, MySQL, Subversion and Git (Gitolite) During the install process, some problems are encountered. The res

【Android 系统开发】CyanogenMod 13.0 源码下载 编译 ROM 制作 ( 手机平台 : 小米4 | 编译平台 : Ubuntu 14.04 LTS 虚拟机)

作者 : 韩曙亮 转载请注明出处 : http://blog.csdn.net/shulianghan/article/details/51592930 手机的两种模式 : 在下面有详细的图片示例; -- Recovery 模式 : 音量键增加 + 电源键, 长按上述组合键, 看到 "MI" 的 LOGO 后即进入 Recovery 模式; -- Fastboot 模式 : 音量键减小 + 电源键, 长按上述组合键, 看到 "FASTBOOT" 后, 即 进入 FA

在Ubuntu 14.04 LTS下使用apache2+Mono 3.2.8 配置Asp.net 4.0网站

文章假设你已经安装了apache2+mono 3.2.8+mysql,如果没有安装请自行度娘,文章有很多,但是关于apache2和mono在Ubuntu 14.04 LTS下的配置文章却很少,故记录下来. 这篇文章不是一步一步的教程,而是在于理解apache2和mono. 在Ubuntu 14.04 LTS下的apache2的配置目录和以往的版本有些不同,最明显的是没有httpd.conf这个配置文件,如下是配置目录 apache2.conf:apache2的主配置文件 conf-availab

Install golang on Ubuntu 14.04 LTS

1. Install golang on Ubuntu 14.04 LTS a)~$ sudo apt-get install golang                   success b)~$ sudo add-apt-repository ppa:gophers/go ~$ sudo apt-get update ~$ sudo apt-get install golang-stable         fail c) complie from source code        

Install latest Eclipse IDE in Ubuntu 14.04, 13.10

Eclipse Kepler 4.3.2 SR2 is the most recent release from the Eclipse top-level project. It contains what you need to build applications based on Eclipse technology, including integrated development environments IDE, and rich client applications using

Install Cocos2d-x v3.3 on Ubuntu 14.04 & Ubuntu 14.10(转)

Install Cocos2d-x v3.3 on Ubuntu 14.04 & Ubuntu 14.10 1 get the source code sudo apt-get install git git clone https://github.com/cocos2d/cocos2d-x.git or you can download at   http://cn.cocos2d-x.org/download/ 2 init environment cd cocos2d-x/build .

Ubuntu 14.04 LTS 安装Docker

Docker官方是有很详细的安装文档(https://docs.docker.com/engine/installation/ubuntulinux/),这里做了一个Ubuntu 14.04 LTS中文版的. 系统要求 64位 $ file /sbin/init /sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Lin

Ubuntu 14.04 LTS 64bit 编译SDL的问题

http://blog.csdn.net/jhting/article/details/38523945 Ubuntu 14.04 LTS 64bit 编译SDL的问题 分类: C/C++2014-08-12 23:33 423人阅读 评论(0) 收藏 举报 SDL 之前在32位的LINUX中编译是没什么问题的. SDL1.2 需要安装的包: xorg-dev  (执行apt-get install xorg-dev,不安装这个包提示XSHm.h头文件无法找到) 在 make 时提示 _XDat