title: Selecting a device for CUDA debugging
body: <p>I've got a couple of Parallel Nsight compatible CUDA GPU's. The second (lower) one is connected to my monitor, and the first (upper) one is is set up as a PhysX accelerator. You can clearly see my configuration below.</p>
  
  <p>Now in order to perform CUDA debugging with Nsight, I need to only run kernel code on the GPU not connected to the monitor. My computer is already setup for "headless debugging". Also below is a basic example of code I wish to execute on the other GPU:</p>
  
  <pre><code>// KernelCall.cu
  #include &lt;iostream&gt;
  #include "cuda.h"
  #include "cuda_runtime.h"
  #include "device_launch_parameters.h"
  
  __global__ void kernel(void){}
  
  int main()
  {
      kernel&lt;&lt;&lt;1,1&gt;&gt;&gt;();
  
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>My question is basically what do I need to put in this code so that it only executes on the other device and allow me to perform CUDA debugging?</p>
  
  <p><img src="https://i.stack.imgur.com/sSDg1.png" alt="NVIDIA Control Panel"></p>