Cuda samples not work

Hello everyone

I install cuda-5 tookit on Ubuntu 12.04 in my pure new Computer. The installation went successfully, but when I ran samples, it gives such problems:

lv@lv-P15SM:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ sudo ./deviceQuery
./deviceQuery Starting…

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

cudaGetDeviceCount returned 10
-> invalid device ordinal

Here is a brief summary of my installation. I install it from with these two tutorial:

I didn’t install a standalone driver, since the Nvidia manual says the Cuda5 contains one. So I didn’t use the sudo apt-get remove --purge nvidia* to clean the last one (It’s new machine)

All the three parts in Cuda5 install successfully, then I met the problem.

Here is a summary of machine now. Hope it can help:

lv@lv-P15SM:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ lspci|grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GK104M [GeForce GTX 780M] (rev a1)

lv@lv-P15SM:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ uname -m && cat /etc/*release
VERSION=“12.04.2 LTS, Precise Pangolin”
PRETTY_NAME=“Ubuntu precise (12.04.2 LTS)”

lv@lv-P15SM:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ nvcc -V
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2012 NVIDIA Corporation
Built on Fri_Sep_21_17:28:58_PDT_2012
Cuda compilation tools, release 5.0, V0.2.1221

lv@lv-P15SM:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3

lv@lv-P15SM:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ ls -la /dev/nvidia*
crw-rw-rw- 1 root root 195, 0 Jun 15 14:54 /dev/nvidia0
crw-rw-rw- 1 root root 195, 255 Jun 15 14:54 /dev/nvidiactl

When I use nvidia-settings, it will say:
You do not appear to be using the NVIDIA X driver. Please edit your X configuration file (just run nvidia-xconfig as root), and restart the X server.

I’m not sure whether it’s the driver problem (Not supported). When I install the standalone driver, I use nvidia-current to update my drive or download from the website then run. In both trials, I failed. Then I reinstalled the system and tried Cuda directly.

If you need more clues, don’t hesitate to ask.

As nvidia-settings reports, tou’re not using the NVIDIA driver, so CUDA’s not going to work. Look at that Getting Started in Linux guide you linked for the blacklist lines to prevent the Nouveau driver from being used. Install the nvidia driver again (from the toolkit is fine) and you’ll probably be up and running.

Thank you very much. I did exactly as the guide said to set blacklist.

blacklist amd76x_edac
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv

Is that right and enough?

It seems that only doing this is not enough to make my driver work.

Thank you very much again. I download the new version driver from Nvidia and install it. Now the sample seems work. But there are still two problems:

  1. When I type nvidia-settings, the information is still there: “You do not appear to be using the NVIDIA X driver. Please edit your X configuration file (just run nvidia-xconfig as root), and restart the X server.”

  2. I tried several samples, the ./deviceQuery works. Others seems can detect device, but seems don’t stop, such as ./bandwidthTest.