Developing cuda without developer drivers

Is it possible to develop applications in CUDA without installing developers device drivers?
I’m using Ubuntu 10.10 and I have installed the proprietary NVIDIA device drivers provided from Ubuntu developers. I don’t want to erase them, because they work very well in my system.
However I want to develop applications in CUDA, and I don’t know if it is possible to develop and run applications made in CUDA without installing the CUDA device drivers.
If someone have a suggestion to my case, I will be pleased.

Maybe. There are three potential problems, however[list=1]

CUDA toolkits are tied to driver versions. Usually the stable “non-free” drivers are several releases behind the developer driver, so you will probably be limited to a rather old toolkit

The Ubuntu driver packages have tended to put files which are critical to CUDA in non standard places, which can cause problems with the toolkit operation and might require a number of non-standard environment settings to get everything to work.

If you have problems, NVIDIA don’t support the repackaged drivers and the official support channels won’t be much help to you

I use Ubuntu as my workstation and development OS, but I never bother with the repo drivers for these exact reasons.

If I install NVIDIA developer device driver will I need to reinstall it on every kernel update?

I friend of mine, have installed the drivers provided by NVIDIA and everytime Ubuntu updates it’s kernel, he have to reinstall NVIDIA drivers in order to get the X running normally again.

Yes. This is the downside of Linux tying kernel module drivers to specific kernel versions. Whenever the kernel is updated, you have to rerun the NVIDIA driver installer so that it recompiles the wrapper around the binary driver and installs it into the module directory for the new kernel.

Yes you will.

This is the most boring part of the story and my main concern when I started this topic.

Is there a workaround for it?

Can I set up any script to recompile the kernel modules on every kernel update?

Not really. If it really bothers you that much, you can always fix the kernel in your dpkg setup so that it doesn’t update when the update manager runs. But doing it is a trivial task, I don’t understand what the big concern is. If you have a working X11 setup you don’t want to change, then you can tell the NVIDIA installer not to touch it and everything will just work.

The main problem here is that I wish to release an CUDA application to people that doesn’t know how to install NVIDIA device drivers on Linux.

I’m going to have lots of problems when explaining them how to install and manage CUDA drivers.

In my case, I really don’t care about the boring work to enter in a terminal, kill the X server install the drivers and reboot, but for many people it is a lots of trouble to do this simple task.

I really don’t understand why nvidia have two device drivers for their GPU: one for CUDA/OpenCL/Graphics and another for Graphics only.

They don’t. If you download the current “stable” NVIDIA driver package from the NVIDIA homepage, you definitely get CUDA driver support, and I am 99% certain you get OpenCL 1.0 as well.

EDIT: Just checked the manifest of the current NVIDIA driver bundle for x86_64:

~/NVIDIA-Linux-x86_64-260.19.21$ ls -hl libcuda* libOpenCL*

-rwxr-xr-x 1 avidday avidday 8.4M 2010-11-05 06:54

-rwxr-xr-x 1 avidday avidday  21K 2010-11-05 06:54

So you do indeed get CUDA and OpenCL in the regular driver bundle.

:thanks: :thanks: :thanks:

That solved my whole problem!

The only think that we need to do to compile and run an CUDA application is to install the SDK files and compile CUDA with the nvcc.

With the most recent nvidia device drivers, we already have access to CUDA, without the need to install the developers drivers.

In order to make this post more useful to people in my situation what I have done is:

  • Install Nvidia device drivers from Ubuntu’s repository.

  • Downloaded the SDK from CUDA SDK

  • Edited my /etc/environment file to the following:


  • Compiled an test application using nvcc

  • And ran that with this command: LD_LIBRARY_PATH=/usr/local/cuda/lib ./a.out

People who seek for more info can find in the following document:

CUDA on Linux

Err no.

You need to install the CUDA toolkit, not the SDK, and you need to pay close attention to the very first point I made in my original reply to you.

The manifest I posted above comes from the current release NVIDIA driver bundle. That is not the same thing as what you can install from a Ubuntu repository somewhere. The Ubuntu supplied deb packages are the result of someone pulling an NVIDIA driver bundle apart, and sticking some or all of its contents into a deb package with their own additional script-fu to make it all work with Ubuntu’s own kernel packaging system.

Toolkit versions are tied to driver versions. There is no guarantee that when you install repackaged drivers from Ubuntu and download a toolkit from the NVIDIA site, they will work together, and further to that there is no guarantee that what you get in the repackaged drivers from Ubuntu will be the same (and installed in the same places) as what you get when you install drivers using th NVIDIA bundle, even for the same driver version. You have been warned. Twice.