1
votes

I am trying to run a cuda application on an Ubuntu 10.04 system with a GeForce GTX 590.
I'm using the 295.41 drivers. I have set up 3 other systems with this code and all have worked. Two of them had GT 640s and one had a GTX 480 (or 460 - I can't quite remember). I have run cuda code on this machine with the same hardware before but it has since been formatted.

I get the invalid device ordinal error when I run my code and also when I run the SDK examples. I set up this machine with gentoo and got this error - I thought it could have something to do with the OS so I installed ubuntu and have the same problem. I can't think of what else to try. Does anyone have any suggestions?

Below is some output that could be handy.

user@pchan1:~$ lspci | grep nVidia
02:00.0 PCI bridge: nVidia Corporation Device 05b1 (rev a3)
03:00.0 PCI bridge: nVidia Corporation Device 05b1 (rev a3)
03:02.0 PCI bridge: nVidia Corporation Device 05b1 (rev a3)
06:00.0 PCI bridge: nVidia Corporation Device 05b9 (rev a3)
07:00.0 PCI bridge: nVidia Corporation Device 05b9 (rev a3)
07:02.0 PCI bridge: nVidia Corporation Device 05b9 (rev a3)
08:00.0 3D controller: nVidia Corporation Device 1088 (rev a1)
08:00.1 Audio device: nVidia Corporation Device 0e09 (rev a1)
09:00.0 VGA compatible controller: nVidia Corporation Device 1088 (rev a1)
09:00.1 Audio device: nVidia Corporation Device 0e09 (rev a1)

user@pchan1:~$ ls -l /dev/nvidia*
crw-rw-rw- 1 root root 195, 0 2012-10-30 10:22 /dev/nvidia0
crw-rw-rw- 1 root root 195, 1 2012-10-30 10:22 /dev/nvidia1
crw-rw-rw- 1 root root 195, 255 2012-10-30 10:22 /dev/nvidiactl

Edit: When I had this system working I was using a 64 bit os and the 64 bit drivers. I am now using a 32 bit os and 32 bit drivers.

Another Edit:

Thanks very much Przemyslaw Zych. You helped me solve the problem. I had to blacklist Nouveau by doing the following. Add a file in /etc/modprobe.d called blacklist-nouveau.conf (just the .conf ending is important) and in that file put the following two lines.
blacklist nouveau
options nouveau modeset=0
As instructed at the following guide
ftp://download.nvidia.com/XFree86/Linux-x86_64/256.44/README/commonproblems.html

Problem solved :)

1
Can you try running nvidia-smi command? Are you sure no other drivers are using the GPU (e.g. nouveau or vesa?) is the nvdia driver loaded (lsmod). Which ubuntu are you using?Przemyslaw Zych
If I lsmod I see nvidia there but also nouveau. When I enter nvidia-smi I get an error : NVIDIA: could not open the device file /dev/nvidia0 (input/output error). Failed to initialize NVML: Unknown errorDaniel
So I don't know how to mark this as solved or to give you the credit. But you fixed it.Daniel
@Daniel: The simplest thing to do is write what you did as an answer to your own question. You can later accept your own answer and it will mark the question as completed.talonmies

1 Answers

2
votes

As Przemyslaw Zych suggested there was another driver using the GPU (in this case nouveau).
To use the nvidia driver nouveau must be disabled. The procedure is listed here - ftp://download.nvidia.com/XFree86/Linux-x86_64/256.44/README/commonproblems.html - and I will summarise it below.

Create a file in /etc/modprobe.d called blacklist-nouveau.conf
Add the following two lines:
blacklist nouveau
options nouveau modeset=0
Then reboot the pc. This should prevent nouveau from loading and allow the nvidia drivers to be used.