Invalid Device?

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:

# /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 for creating the init.d script to add the devices to /dev