How to Install CUDA 5.0 Toolkit in Ubuntu
This guide is based on Ubuntu 12.04 LTS, but the same principles apply in newer versions of Ubuntu. Let’s begin.
1. Make sure you have a CUDA supported GPU
You must have a nVIDIA GPU that supports CUDA, otherwise you can’t program in CUDA code. Here’s a list with the CUDA supported GPU models.
2. Install nVIDIA proprietary drivers
Use Jockey (additional drivers) or just pick the driver you want from the NVIDIA official website.
3. Download CUDA Toolkit 5.0 for Ubuntu
I used the Ubuntu 11.10 32bit version. It’s the latest version so far, but it currently works fine. So please download.
4. Fix the libglut.so error
There will be an error when you’ll try to install the CUDA 5.0 examples. The driver is trying to find the libglut.so file and it doesn’t look for other versions, such as so.1, so.2 etc.
First confirm that you have a libglut file:
$ sudo find /usr -name libglut\*
If you do, symlink that file to libglut.so.
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libglut.so.3 /usr/lib/libglut.so
$ sudo ln -s /usr/lib/i386-linux-gnu/libglut.so.3 /usr/lib/libglut.so
5. Install the CUDA Toolkit and Samples
Press CTRL+ALT+F1 to open a shell — yeah, we’re going to do this in old (yet powerful) command-line way, but there’s no need to be afraid of the black and white terminal with a blinking cursor. After all you know what they say, once you go black…
5.1 Shutdown the all the graphics
Ubuntu uses LightDM, so you need to stop this service:
$ sudo service lightdm stop
5.2 Run the installer
Go to (using cd) the directory where you have the CUDA installer (a file with *.run extension) and type the following:
$ sudo chmod +x *.run
$ sudo ./*.run
Accept the License and install only the CUDA 5 Toolkit and the Samples. DO NOT install the drivers because we have already done that.
6. Enable the nvcc compiler
In order to compile CUDA code you have to use the nvcc compile. In that so you have to tweak some environment variables into your ~/.bashrc file:
export PATH=$PATH:/usr/local/cuda-5.0/bin export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib
export PATH=$PATH:/usr/local/cuda-5.0/bin export LD_LIBRARY_PATH=/usr/local/cuda-5.0/lib64:/lib
If you want to compile a CUDA file (*.cu extension) you can use the following command:
nvcc -o file file.cu ./file
Or use the NSight Eclipse Edition.
Like us on Facebook
We need your assistance to stay live
This week Top Posts
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX : Wow! Early last week it was all over the internet, if you haven't heard it yet then this is the t...0 comments |
- Grive: An Unofficial, Open Source Linux Client For Google Drive : A couple of months before, we have featured a Linux client for Google Drive named Syncdrive, which w...1 comment |
- Top Things To Do After Installing Ubuntu 13.10 'Saucy Salamander' : Ubuntu 13.10 Saucy Salamander will be released on coming October 17th with many new salient featur...0 comments |
- How To "Fix E: Could not open file /var/lib/dpkg/status" : QUESTION: I get the following error when I use sudo apt-get update: E: Could not open file /var/...0 comments |
- Install Sublime Text 3 In Fedora Easily With Fedy : Sublime Text is a sophisticated text editor for code, markup and prose. In this tutorial we are goi...0 comments |
- Install nSnake Game In Terminal : From github repo nsnake is a clone of the classic snake game that we all used to play on our cellp...0 comments |
- Install Sublime Text 3 In Fedora Easily With Fedy
- Grive: An Unofficial, Open Source Linux Client For Google Drive
- Install nSnake Game In Terminal
- How To “Fix E: Could not open file /var/lib/dpkg/status”
- Wow! Linux Foundation To Offer Free Linux Course This Summer Worth $2,400 on EdX
- Fedora 21 Scheduled For Release In October
- Install Uget Download Manager In Ubuntu, Fedora, Debian
- Download Elementary OS ‘Luna’ Official Wallpapers
- Install Power Commands 0.1.5 On Ubuntu 14.04/13.10/12.10/12.04
- 5 Android Apps that’s Going to Make Running Your Business Less Stressful
This work by unixmen.com is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.
Copyright © 2008-2013 Unixmen.com .