"no CUDA-capable device is detected" with CUDA GPU attached

I have ubuntu 12.04 on a computer with an attached 9800 GT (CCV#1.0). I followed the getting started directions and when I run the deviceQuery program, I get:

/home/ubuntu/Cuda/NVIDIA_CUDA-6.0_Samples/bin/x86_64/linux/release/deviceQuery Starting…

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

FATAL: Error inserting nvidia_331 (/lib/modules/3.11.0-15-generic/updates/dkms/nvidia_331.ko): No such device
cudaGetDeviceCount returned 38
-> no CUDA-capable device is detected
Result = FAIL

I used the .deb installation, there is no directory /dev/nvidia, I have a 64bit architecture, the fan is spinning on the GPU, and my graphics are running off the motherboard. Also I would like to mention that (other than android) this is my first contact with a Linux OS.

I would really appreciate any advice on the steps to take to get this system up and running considering this will save me thousands of hours of processing time in the end. Thanks!!!

You can quickly check if ubuntu recognizes the card by opening a terminal and running “lspci | grep -i nvidia”

What getting started guide did you use. The internet seem to be flooded with different versions. I recently installed CUDA more or less succesfully on ubuntu 13.04 using this one http://docs.nvidia.com/cuda/pdf/CUDA_Getting_Started_Linux.pdf. However i was not able to make the deb package work. Instead i used the run script. Since you are new to linux i will try and add some detail.

Disclaimer: I have not gotten it to work entirely but i suspect that is because i am on a laptop with optimus. nVidia does not seem to prioritize linux optimus support. Some sample results in a device unavailable error for me.

First off the guide dictates that you need to turn of the GUI before installing. This it might be handy to take notes and write down the commands needed before starting.

First go to https://developer.nvidia.com/cuda-downloads under the linux tab and download the approriate “RUN” depending on distro and architecture. That would be ubuntu 12.04 64bit for you. I’m guessing the run files are actually the same for all distros, but there’s no point in taking chances. It should be called cuda_6.0.37_linux_64.run

Then make sure you remove the deb package you tried installing. Otherwise there might be some clashes. You should be able to do this with “sudo apt-get purge cuda-repo-ubuntu1204_6.0-37_amd64” or something along those lines.

Now is the time to shut down the GUI. On a vanilla ubuntu 12.04 this is done by opening a terminal and entering “sudo service lightdm stop”.

Navigate to the directory where you downloaded the run file to. Make it executable using “chmod +X cuda_6.0.37_linux_64.run” and then execute it using “./cuda_6.0.37_linux_64.run”. The installation guide mentions that if you are running both an integrated and a discreet GPU you should run it with the --no-opengl-libs" flag. It sounds like this is the case for you but i am not quite sure. If you want to use the flag, simply run “./cuda_6.0.37_linux_64.run --no-opengl-libs” instead. Now the installation should be running. It will prompt you about a few things. For most of them the default should be ok. It’s only really the location of the samples that you might want to change.

If you are running Nouveau you need a few extra steps. I will add them if necessary. To check if you are look for a file called something like /boot/initramfs-3.11.0-23-generic.img.

You need some additional packages. These can be installed with

sudo apt-get install freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev

now you should two files called /dev/nvidia0 and /dev/nvidiactl. Try running nvida-smi. If this does note work either there is a startup script in the startup guide you can use.

Installation should now be done and you can restart the gui with “sudo service lightdm start”

The last thing you have to do is added CUDA to your path This can be done with the following

export PATH=/usr/local/cuda-6.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-6.0/lib64:$LD_LIBRARY_PATH

in your .bashrc or similar.

I have not proof read the post as it took longer than expected to write. Mistakes are to be expected. Hope it helps. Feel free to ask if anything is not clear.