Saturday, May 28, 2011

Install Cuda 4.0 on Ubuntu 11.04

NVIDIA Cuda 4.0 was released in this month. It includes Performance Primitives (NPP) library for image/video processing using multi-GPU programming. It is supported on many PCs and laptops with NVIDIA GPUs, including Thinkpad T410 with NVIDIA NVS 3100M.

Ubuntu 11.04 was released in the last month. Here is my instruction to install Cuda 4.0 on Ubuntu 11.04 on my Thinkpad T410 (thanks to instructions from http://forums.nvidia.com/index.php?showtopic=198030)

1. Install dependencies

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

2. And download and install

  • CUDA Toolkit for Ubuntu Linux 10.10 (sudo sh ...)
  • CUDA Tools SDK (sudo sh ...)
  • GPU Computing SDK code samples (no sudo)

from the following links:
LINUXDOWNLOADS
Developer Drivers for Linux (270.41.19)32-bit 64-bit
CUDA Toolkit
  • C/C++ compiler
  • CUDA-GDB debugger
  • Visual Profiler
  • GPU-accelerated BLAS library
  • GPU-accelerated FFT library
  • GPU-accelerated Sparse Matrix library
  • GPU-accelerated RNG library
  • Additional tools and documentation
documentation
CUDA Toolkit for Fedora 1332-bit 64-bit
CUDA Toolkit for RedHat Enterprise Linux 6.064-bit
CUDA Toolkit for RedHat Enterprise Linux 5.532-bit 64-bit
CUDA Toolkit for RedHat Enterprise Linux 4.864-bit
CUDA Toolkit for Ubuntu Linux 10.1032-bit 64-bit
CUDA Toolkit for OpenSUSE 11.232-bit 64-bit
CUDA Toolkit for SUSE Linux Enterprise Server 11 SP132-bit 64-bit
CUDA Tools SDK32-bit 64-bit
GPU Computing SDK code samples download


3. Download the Developer Drivers for Linux (270.41.19) from the above link. For driver installation, you need to

(1) remove the current nvidia packages you might have installed

sudo apt-get remove nvidia-common nvidia-current

(2) go to the text window via ctrl+alt+F2.

(3) stop X

sudo service gdm stop

(4) remove the nouveau module

sudo apt-get --purge remove xserver-xorg-video-nouveau

(5) stop gdm and restart X

sudo service gdm start

Restart the system

(6) stop X

sudo service gdm stop


(7) install driver

sudo sh devdriver_4.0_linux_32_270.41.19.run

(7) restart X

sudo service gdm start


4. Assuming you have accepted the default install location /usr/local/cuda, you should add the following in the .bashrc file of your home folder.

export CUDA_HOME="/usr/local/cuda"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CUDA_HOME}/lib64"
export PATH=${CUDA_HOME}/bin:${PATH}

run ldconfig as root for it to take effect:

source ~/.bashrc

and

sudo ldconfig

5. make nvcc use gcc/g++ version 4.4, for example, in home directory

mkdir gcc44
cd gcc4
ln -s /usr/bin/cpp-4.4 cpp
ln -s /usr/bin/gcc-4.4 gcc
ln -s /usr/bin/g++-4.4 g++

edit /usr/local/cuda/bin/nvcc.profile to look in the gcc44 directory (give it the full path)

compiler-bindir =/home/xxx/gcc44

6. run make in NVIDIA_GPU_Computing_SDK/C

cd ~/NVIDIA_GPU_Computing_SDK/C
make

7. verify CUDA 4.0 installation by running the deviceQuery sample in the NVIDIA_GPU_Computing_SDK/C

bin/linux/release/deviceQuery

my Thinkpad T410 shows

[deviceQuery] starting...
linux/release/deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Found 1 CUDA Capable device(s)

Device 0: "NVS 3100M"
CUDA Driver Version / Runtime Version 4.0 / 4.0
CUDA Capability Major/Minor version number: 1.2
Total amount of global memory: 256 MBytes (268107776 bytes)
( 2) Multiprocessors x ( 8) CUDA Cores/MP: 16 CUDA Cores
GPU Clock Speed: 1.47 GHz
Memory Clock rate: 810.00 Mhz
Memory Bus Width: 64-bit
Max Texture Dimension Size (x,y,z) 1D=(8192), 2D=(65536,32768), 3D=(2048,2048,2048)
Max Layered Texture Size (dim) x layers 1D=(8192) x 512, 2D=(8192,8192) x 512
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 16384
Warp size: 32
Maximum number of threads per block: 512
Maximum sizes of each dimension of a block: 512 x 512 x 64
Maximum sizes of each dimension of a grid: 65535 x 65535 x 1
Maximum memory pitch: 2147483647 bytes
Texture alignment: 256 bytes
Concurrent copy and execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Concurrent kernel execution: No
Alignment requirement for Surfaces: Yes
Device has ECC support enabled: No
Device is using TCC driver mode: No
Device supports Unified Addressing (UVA): No
Device PCI Bus ID / PCI location ID: 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 4.0, CUDA Runtime Version = 4.0, NumDevs = 1, Device = NVS 3100M
[deviceQuery] test results...
PASSED

Press ENTER to exit...


22 comments:

bahrami said...

Hi
I have some problems with your installation guide
compiler-bindir=/home/xxxx/gcc44
where should I add this in nvcc.profile?
but after installing my ubuntu don't boot in normal mode and has this log
API mismatch the nvidia kernel module has version 173.14.30 but this nvidia driver component has version 270.41.19
(I have G98[Geforce 9300 M GS])

Shenbo Yu said...

I put
compiler-bindir =/home/xxx/gcc44
in the last line of /usr/local/cuda/bin/nvcc.profile

Did you run
sudo apt-get remove nvidia-common nvidia-current
to remove your previous driver. Ideally you should use the new installed driver just downloaded from
http://developer.nvidia.com/cuda-toolkit-40#Linux

Patrick said...

Thanks very much for this. I had a little difficulty getting the dev driver to install (Ubuntu 11.04, Dell XPS M1530), but I kept plugging at it, and....

pcarroll@pcarroll-XPS-M1530:~/NVIDIA_GPU_Computing_SDK/C$ bin/linux/release/deviceQuery
[deviceQuery] starting...
bin/linux/release/deviceQuery Starting...

CUDA Device Query (Runtime API) version (CUDART static linking)

Found 1 CUDA Capable device(s)

Device 0: "GeForce 8600M GT"
CUDA Driver Version / Runtime Version 4.0 / 4.0
CUDA Capability Major/Minor version number: 1.1
Total amount of global memory: 256 MBytes (268107776 bytes)
( 4) Multiprocessors x ( 8) CUDA Cores/MP: 32 CUDA Cores
GPU Clock Speed: 0.95 GHz
Memory Clock rate: 702.00 Mhz
Memory Bus Width: 128-bit
Max Texture Dimension Size (x,y,z) 1D=(8192), 2D=(65536,32768), 3D=(2048,2048,2048)
Max Layered Texture Size (dim) x layers 1D=(8192) x 512, 2D=(8192,8192) x 512
Total amount of constant memory: 65536 bytes
Total amount of shared memory per block: 16384 bytes
Total number of registers available per block: 8192
Warp size: 32
Maximum number of threads per block: 512
Maximum sizes of each dimension of a block: 512 x 512 x 64
Maximum sizes of each dimension of a grid: 65535 x 65535 x 1
Maximum memory pitch: 2147483647 bytes
Texture alignment: 256 bytes
Concurrent copy and execution: Yes with 1 copy engine(s)
Run time limit on kernels: Yes
Integrated GPU sharing Host Memory: No
Support host page-locked memory mapping: Yes
Concurrent kernel execution: No
Alignment requirement for Surfaces: Yes
Device has ECC support enabled: No
Device is using TCC driver mode: No
Device supports Unified Addressing (UVA): No
Device PCI Bus ID / PCI location ID: 1 / 0
Compute Mode:
< Default (multiple host threads can use ::cudaSetDevice() with device simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 4.0, CUDA Runtime Version = 4.0, NumDevs = 1, Device = GeForce 8600M GT
[deviceQuery] test results...
PASSED



THANKS!!!!!

King Goddard said...

nice tutorial thanks.

Norio Kimura said...

I'm using the latast nvidia driver via ppa instead of the cuda dev driver (devdriver_4.0_linux_64_270.41.19.run).

$ sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
$ sudo apt-get update
$ sudo apt-get upgrade # or sudo apt-get install nvidia-current
$ sudo reboot

No need to remove the nouveau driver etc.

In this case, however, you should do some workarounds to avoid bugs of SDK:

$ cd ~/NVIDIA_GPU_Computing_SDK/C
$ LPATH=/usr/lib64/nvidia-current make # in 32bit environment, use lib instead of lib64

Marian said...

thank you, good tutorial

Tiago said...
This comment has been removed by the author.
asim said...

Hi
I can not properly install nvidia driver to T410 with NVS 3100M. After creating xorg.conf by nvidia-xconfig X does not start with message 'fatal error, no screen found'
Could you help with that please.

videogamespswii.com said...

thank you for your guidance install Cuda in my Ubuntu.

Alex Honey said...

I used few posts and made bash script for installation.
http://pastebin.com/PyDnT2q6
Nvidia Cuda 4.0 on Ubuntu 11.04

Link to download:
pastebin.com/download.php?i=PyDnT2q6


1. save it like *.sh
2. give the permittions
sudo chmod +x
3. switch shell mode with CTRL+ALT+F1
4. execute script

Unknown said...

I'm having an issue when I try to run make in NVIDIA_GPU_Computing_SDK/C.

I keep getting this error:

make[1]: Entering directory `/home/uvuphys/NVIDIA_GPU_Computting_SDK/C/common'
cc1plus: warning: command line option ‘-Wimplicit’ is valid for C/ObjC but not for C++ [enabled by default]
src/cutil.cpp:28:27: fatal error: builtin_types.h: No such file or directory
compilation terminated.
make[1]: *** [obj/i386/release/cutil.cpp.o] Error 1
make[1]: Leaving directory `/home/uvuphys/NVIDIA_GPU_Computting_SDK/C/common'
make: *** [lib/libcutil.so] Error 2

Any suggestions on what I could be doing wrong?

Thanks for your help.

Daniel Kwok said...

This blog is truly awesome in all aspects.



cudo

Sir ackent said...

I sent your articles links to all my contacts and they all love it including me.
how to get a phlebotomy certification

jerry stock said...

I conceive feeling to have the accumulation that you are card.
Go to Herbal Bath

brandon blake said...

You guys make it really easy for all the folks out there.
Healthy Relationship with Herbal Bath

autoapprovebloglist said...

I'm sure coming again to construe these articles and blogs Tips by VIP Kontor

unsit polek said...

Your way to enlighten everything on this blog is actually pleasant, everyone manage to efficiently be familiar with it, Thanks a great deal.
Learn More About RCM Software

anjila smith said...

These articles and blogs are truly enough for me for a day.
Get more info about Deco En Bois

good studio said...

I will prefer this blog because it has much more informative stuff.
Visit Economy Fence

Timon berg said...

I outright point of view and revalue your repair on every objective.
payday loans online direct lenders

peter watson said...

Great webs site with mesmerizing and unique material what else you would like.
payday loan

unsit polek said...

It's offensively easy to seek out any matter on web as compared to books, as I found this text at this website. Relationship Issues With Hongen 88

Followers

Blog Archive

About Me

My Photo
HD Multimedia Technology player