invalid device ordinal (I can't find any help about this)

so I’m using GTX 590 on ubuntu 10.04 64bit
recently I tried to update cuda toolkit to 4.2 version, so I updated the cuda driver and cuda toolkit,
then when i was trying to build the newest gpu computing sdk, I went successfully
however i got a problem, when i tried to run ./deviceQuery, this message appeared

./deviceQuery Starting…

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

cudaGetDeviceCount returned 10
-> invalid device ordinal
[deviceQuery] test results…

then tried to revert back to previous toolkit version 4.1 with it’s devdriver and computingsdk, however it didnt work, still the same error msg
anyone can help me about this?

i tried to find any helpful post about this, but there is nothing… anyone can help me?

Hello, a you solve you problem?

I have same problem.
i have next:
ubuntu 11.04 natty
two cards 9800GTX+
Tesla C2050.
monitor connect to geforce.
devdriver,toolkit,sdk installing succesfully.
bur i run ./deviceQuery
i have the same error
cudagetDeviceCount returned 10
invalid device ordinal .
if use only one card all work fine.

what you amount of RAM?
wherewer i read that the problem in amount of host memory.

p.s. cuda version 4.0 and 4.2

sorry for my poor english.

Double check that you are running the Nvidia driver ( cat /proc/driver/nvidia/version ) and not what Ubuntu decided was the best for you…

thanks for reply)

please, tell what linux will the best for me

i will try use the CentOS 6.2 DVD (x86_64),and i think,that all will work fine

i want to bench my hardware with Cuda Accelerated Linpack.

but i know linux a little(

Hi, I ran into same error ( invalid device ordinal ) with CUDA 5 on Redhat EH6:

cat /proc/driver/nvidia/version

NVRM version: NVIDIA UNIX x86_64 Kernel Module 302.06.03 Thu May 3 18:19:16 PDT 2012

GCC version: gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC)

I followed the suggestion from an earlier thread … 2010

… > sudo -i

cd /your/executable/blah-blah


and it seems to go away.

What bugs me is there seems to be a lack of explanation for this. Does it mean everyone has to be root to run CUDA codes ?

Thanks ahead Nvidia for monitoring this thread…

I stand corrected …

After getting it to run once, you can exit all-mighty shell and run as mere mortals…

i think my question was silly

so i tried to run from terminal but i didnt setup the script file as it is required while u dont use the GPU for monitor

read this carefully, there is a quide that u have to put a script file

I have installed CUDA on Ubuntu 12.04 LTS, and got same problem and SOLVED.

The problem is the CUDA environment is not defined in either user or root environment.

So, we then insert the following script into ~/.bashrc of user

[i]export CUDA_HOME=/usr/local/cuda-6.0

export PATH[/i]

And then change to root: $sudo su
Insert the above script into .bashrc of root.

Then restart, and run ./devicequerry
It will work well.