# Invalid Device?

**URL:** <https://forums.developer.nvidia.com/t/invalid-device/28798>\
**Category:** CUDA Programming and Performance\
**Created:** [March 28, 2013, 3:22pm UTC](https://forums.developer.nvidia.com/t/invalid-device/28798 "2013-03-28T15:22:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cypris87](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cypris87](https://forums.developer.nvidia.com/u/cypris87)\
**Post date:** [March 28, 2013, 3:22pm UTC](https://forums.developer.nvidia.com/t/invalid-device/28798/1 "2013-03-28T15:22:58Z")

</div>

I’ve recently added a card to a headless system, and after some struggles got it installed without errors, however whenever I try to run any CUDA code, I get Invalid Device errors:

```auto
# /usr/local/cuda/samples/bin/linux/release/deviceQuery 
/usr/local/cuda/samples/bin/linux/release/deviceQuery Starting...

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

cudaGetDeviceCount returned 10
-> invalid device ordinal

```

Here’s at least most of the diagnostics I’ve done so far after looking a lots of other posts:

# lspci | grep -i nv

03:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GT 640] (rev a1)  
03:00.1 Audio device: NVIDIA Corporation Device 0e1b (rev a1)

# cat /proc/driver/nvidia/version

NVRM version: NVIDIA UNIX x86\_64 Kernel Module 310.40 Sun Mar 3 22:11:07 PST 2013  
GCC version: gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

#ls -la /dev/nv\*  
crw-rw-rw- 1 root root 195, 0 Mar 28 2013 /dev/nvidia0  
crw-rw-rw- 1 root root 195, 255 Mar 28 2013 /dev/nvidiactl  
crw-r----- 1 root kmem 10, 144 Mar 28 09:16 /dev/nvram

# lsmod | grep “nvidia|nouveau”

nvidia 9399922 0  
i2c\_core 31084 2 nvidia,i2c\_piix4

Also, in-case it makes a difference, I referenced [https://access.redhat.com/knowledge/solutions/64300](https://access.redhat.com/knowledge/solutions/64300) for creating the init.d script to add the devices to /dev
