need cuda support for Debian/testing

My laptop has nvidia geforce 9400mg motherboard chipset and 9400mg graphic card
My OS is debian/testing which is a bit newer than Lenny

What version of driver should I choose? It seems that current debian nv driver package is 173.xx.xx which dose not seem to support my gpu

and in nv official website, there is none for debian release but for ubuntu.

so which driver should I choose for my laptop and also toolkit and sdk


Hi uboat,

few days ago I installed CUDA 2.3 on Debian 5.0 (Lenny) 64-bit, so I hope the following steps will help you, too.

  1. Download the Driver/Toolkit/SDK for Ubuntu 9.04 (in my case I choosed the 64-bit versions)

  2. Check your kernel version and the version of gcc used to compile the kernel

    –> enter this to the terminal: cat /proc/version

    –> for example my output: Linux version 2.6.26-2-amd64 (Debian 2.6.26-19lenny2) (

                           (gcc version 4.1.3 20080704 (prerelease) (Debian 4.1.2-25)) 
  3. Next to do is to install the source files for your kernel

    –> aptitude install linux-source-2.6.26 (change the version if it doesn’t match with yours)

  4. In my case I installed the headers, too. Because of dependencies at the driver installation

    –> aptitude install linux-headers-2.6.26-2-amd64 (change version if necessary)

  5. Install gcc, g++ and some dev stuff

    –> aptitude install gcc-4.1 (change version if necessary)

    –> aptitude install g++ (I needed it for compiling the SDK examples)

    –> aptitude install mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libxi-dev libxmu-dev libglut-dev (for SDK)

  6. Now unpack the source files, you will find them in /usr/src and make two links

    –> tar xjvf /usr/src/linux-source-2.6.26.tar.bz2

    –> tar xjvf /usr/src/linux-headers-2.6.26-2-amd64.tar.bz2

    –> ln -s /usr/src/linux-source-2.6.26 /usr/src/linux

    –> ln -s /usr/src/linux-headers-2.6.26-2-amd64 /usr/src/headers

  7. Set the environment variable CC to the gcc version of that one used to compile the kernel

    –> export CC=“gcc-4.1” (check version)

  8. For compiling the SDK you have to set a shortcut to g+±4.3 (maybe you have not to do this or got another version)

    –> ln -s /usr/bin/g+±4.3 /usr/bin/g++

  9. Before run the driver installation, copy(or rename) the file version.Debian to version.h in /usr/src/linux

  10. Install the Driver 190.18 (I don’t know why, but I needed to set the kernel source path to the headers directory)

    –> I changed to the console (Strg+Alt+F1) and stoped the xserver: /etc/init.d/gdm stop

    –> sh --kernel-source-path=/usr/src/headers

    –> and after install i started the xserver again: /etc/init.d/gdm start

  11. Install the toolkit and the SDK (I choosed the default install path for both[/usr/local/cuda and /home/USER/NVIDIA_GPU_Computing_SDK])

–> sh

–> sh

  1. Place a file named cuda.conf in /etc/ with this content: /usr/local/cuda/lib64 (check the directory, if you choosed another for the installation and for a 32-bit version clear the 64 after lib)

  2. Some additional stuff to do (you find the reason for it in Getting_Started_2.3_Linux.pdf)

–> export PATH=/usr/local/cuda/bin:$PATH

–> export LD_LIBRARY_PATH=/usr/local/cuda/lib:$LD_LIBRARY_PATH (for 64-bit: export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH)

–> For permanent use of it add the paths to /etc/profile

  1. change to the directory /home/USER/NVIDIA_GPU_Computing_SDK/C/common and change in the file at line 143 the value -lXi to -LXi

–> before: OPENGLLIB := -lGL -lGLU -lX11 -lXi -lXmu

–> after: OPENGLLIB := -lGL -lGLU -lX11 -LXi -lXmu

–> I have no idea why to change this, but without you will get an error ;-)

  1. Go to /home/USER/NVIDIA_GPU_Computing_SDK/C and run ‘make’

–>cd USER/NVIDIA_GPU_Computing_SDK/C

–> make

–> some warnings will be shown, but the examples will run

After the compilation you find the binarys in /home/USER/NVIDIA_GPU_Computing_SDK/C/bin

I hope you can read and understand all the steps.If you recognized it, my english is not the best ;-)



I wrote a tutorial which describes how to install CUDA on Debian Lenny, but it is in german. Here is the link