title: CUDA Runtime API error 38: no CUDA-capable device is detected
body: <p><strong>The Situation</strong></p>
  
  <p>I have a 2 gpu server (Ubuntu 12.04) where I switched a Tesla C1060 with a GTX 670. Than I installed CUDA 5.0 over the 4.2. Afterwards I compiled all examples execpt for simpleMPI without error. But when I run <code>./devicequery</code> I get following error message:</p>
  
  <pre><code>foo@bar-serv2:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$ ./deviceQuery
  ./deviceQuery Starting...
  
   CUDA Device Query (Runtime API) version (CUDART static linking)
  
  cudaGetDeviceCount returned 38
  -&gt; no CUDA-capable device is detected
  </code></pre>
  
  <p><strong>What I have tried</strong></p>
  
  <p>To solve this I tried all of the thinks recommended by <a href="https://stackoverflow.com/a/10926016/380038">CUDA-capable device</a>, but to no avail:</p>
  
  <ul>
  <li><p><code>/dev/nvidia*</code> is there and the permissions are 666 (crw-rw-rw-) and owner root:root</p>
  
  <pre><code> foo@bar-serv2:/dev$ ls -l nvidia*
   crw-rw-rw- 1 root root 195,   0 Oct 24 18:51 nvidia0
   crw-rw-rw- 1 root root 195,   1 Oct 24 18:51 nvidia1
   crw-rw-rw- 1 root root 195, 255 Oct 24 18:50 nvidiactl
  </code></pre></li>
  <li><p>I tried executing the code with sudo</p></li>
  <li><p>CUDA 5.0 installs driver and libraries at the same time</p></li>
  </ul>
  
  <p><strong>PS</strong> here is lspci | grep -i nvidia: </p>
  
  <pre><code>foo@bar-serv2:/dev$ lspci | grep -i nvidia
  03:00.0 VGA compatible controller: NVIDIA Corporation GK104 [GeForce GTX 670] (rev a1)
  03:00.1 Audio device: NVIDIA Corporation GK104 HDMI Audio Controller (rev a1)
  04:00.0 VGA compatible controller: NVIDIA Corporation G94 [Quadro FX 1800] (rev a1)
  </code></pre>
  
  <p><strong>[update]</strong></p>
  
  <pre><code>foo@bar-serv2:~/NVIDIA_CUDA-5.0_Samples/bin/linux/release$  nvidia-smi -a
  NVIDIA: API mismatch: the NVIDIA kernel module has version 295.59,
  but this NVIDIA driver component has version 304.54.  Please make
  sure that the kernel module and all NVIDIA driver components
  have the same version.
  Failed to initialize NVML: Unknown Error
  </code></pre>
  
  <p>How could that be, if I use the CUDA 5.0 installer to install driver and libs at the same time. Could the old 4.2 version, that is still lying around mess things up?</p>