Search code examples
cudaremote-debugging

How to debug host functions in CUDA programs and watch the program output in Visual Studio with Nsight?


I just set up the Parallel Nsight debugging environment and started remote debugging my CUDA program. I can debug the kernel function, but I don't think I can set a breakpoint in a host function and let the debugger stop at that breakpoint. I don't know where to watch the program output either. The remote machine actually pops up a command line window and the output is shown in that window. But I want to see the output in my local machine. Any suggestions?

My environment:

target machine(remote machine): Windows 7, Parallel Nsight monitor 2.1, GTX 315.

host machine(local machine): Window 7, Visual Studio 2010, Parallel Nsight 2.1, GTX 9400 m


Solution

  • To do this you will also need to remote debug your host code. That is, you will need to start a separate instance of Visual Studio. AFAIK you can't achieve the same from within the same instance of Visual Studio.

    You use this new instance to start debugging by attaching to a process. When selecting the process to attach to, make sure to select your remote machine and attach to your application running on it.