CUDA And Debian Lenny

Want to support HowtoForge? Become a subscriber!
Submitted by schniggie (Contact Author) (Forums) on Thu, 2009-10-01 12:24. :: Debian

CUDA And Debian Lenny

NVIDIA® CUDA™ is a general purpose parallel computing architecture that leverages the parallel compute engine in NVIDIA graphics processing units (GPUs) to solve many complex computational problems in a fraction of the time required on a CPU. I don't know why but there is still no CUDA Driver/Toolkit/SDK Package for Debian.

Go to and download the Linux Packages for Ubuntu 9.04. Before we can install the CUDA Driver Package we must know which Kernel we are using and with which gcc it was built.

cat /proc/version

Linux version 2.6.26-2-amd64 (Debian 2.6.26-19) ( (gcc version 4.1.3
20080704 (prerelease) (Debian 4.1.2-25)) #1 SMP Wed Aug 19 22:33:18 UTC 2009

Now me must install the right Kernel Sources and we must install the gcc version which our running Kernel was built with. In my case it was Kernel-2.6.26-2 and gcc-4.1.3.

aptitude install linux-source-2.6.26

aptitude install gcc-4.1

Next we unpack the downloaded Kernel Source in /usr/src.

tar xjvf linux-source-2.6.26.tar.bz2

ln -s linux-source-2.6.26 linux

Before we can start the CUDA Driver Installation we must set our environment to use the right gcc version, so in my case:

export CC="gcc-4.1"

Now we are ready for the CUDA Driver.


The installer will then build the Kernel Module and at the end it can update the xorg.conf (X restart is needed). After that we can install the CUDA Toolkit.


And as the last step we install the CUDA SDK.


If you want to build the CUDA SDK examples you need the following libraries:

aptitude install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxmu-dev libglut-dev

Don't forget to update your PATH and LD environment. See how I added the bin and lib of CUDA to my system:

cat /etc/


cat /etc/profile | grep PATH


After that your system should be ready to build nice CUDA projects. Enjoy parallel computation.

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Wed, 2010-02-03 05:42.
Excellent and truly helpful! THe part I was missing was the extra packages that needed to be installed. It's not in the CUDA documentation that I read but once I did the install then my CUDA installation worked! Can someone make this into a Debian package with the dependencies? Thanks a lot!
Submitted by meanderly (registered user) on Sun, 2009-10-04 10:52.

Excellent! I was reluctant to install a non-debian nvidia kernel, just to play with the latest cuda, now I can, it works!


Thanks very much.