Breakpoint in kernel code not being hit when Debugging in Nsight for Visual Studio

Hi,

I am unable to debug CUDA programs in Nsight. Whenever I click on Start CUDA debugging, I just get a message saying that Nsight has connected from host-PC to host PC, then another one saying that Nsight has disconnected. In the output box on Visual Studio I get the following message:

The thread ‘CUDA’ (0x1) has exited with code 0 (0x0).
The program ‘[6492] PS1.exe: CUDA’ has exited with code 0 (0x0).

So my program does run and the CUDA kernels are launched and completed successfully but the program does not pause in the breakpoints on the CUDA kernel code.

I tried debugging the included samples in the CUDA SDK and in those examples the execution pauses on the breakpoints. I have checked the project settings on both the sample programs and mines and they are the same.

Any help would be greatly appreciated,

thanks

Possibly relevant Info

OS:Windows 7 Pro
Hardware: Intel i5 w 4GB RAM
NVIDIA CARD: 1 GeForce GT640
Driver Version: 331.65
CUDA Version: 5.5
Compute Capability: 3.0
Visual Studio 2012 Ultimate
Nsight Visual Studio Edition 3.1

just to add: the project I am experiencing this problem makes use of openCV. I do not know if this would cause any problems

Hi,

Could it be that the working directory is not set correctly and it is actually not running to completion?

OpenCV shouldn’t be an issue, however, we have seen where too many modules (with debug info) are loaded and the app may run out of memory. Is the app 32-bit or 64-bit?
We’ve done better handling of this in newer builds, and noticed that you are on Nsight 3.1, that build is a bit old now, would it be possible for you to try newer builds like Nsight 3.2.2 or the latest 4.0 Release Candidate 1 builds?

Thank you

Hi Rafi,

   Thanks for the reply. I have tried running the app using the Visual Studio debugger and it does run. The app is 32-bit. I'll try updating Nsight to 3.2.2. Thanks

Hi Rafi,

I update Nsight to version 3.2.2 and I still get the same problem. Any other things I can try? I have verified that the program does run to completion.

thanks

Make sure the working directory is set in the Nsight User properties, right click on the launching project and select Nsight user properties(just making sure that’s not the problem).

Is there a way I can get a hold of your project for me to reproduce?

Any news about this bug. I have the same problem here.

I have no problem to debug my code with Nsight on my CUDA project.
As soon as I add OpenCV library and OpenCV code to my CUDA project, I can compile my project, run it and debug with the host debuger (VS2010), but I cannot debug my project with Nsight. Nsight Start and immediatly Stop and I get the message:

The thread ‘CUDA’ (0x1) has exited with code 0 (0x0).
The program ‘[5856] OpenCVImgCuda.exe:’ has exited with code 0 (0x0).

I try x86 and x64 project configuration with the same problem.

My configuration is:

Windows 7 Professionnal, SP1
Hardware: Intel i7 with 6GB
Video card: GTX 970
CUDA 6.5
Nsight 4.2
OpenCV 2.4.9

Thank’s for your help…

So far this is a known issue of Nsight. Nsight is not able to debug Cuda and OpenCV at the same time. A workaround is invoking any CUDA runtime API before OpenCV code. Then Nsight could debug CUDA.

ok… thank’s for the answer qzhang.

Any idea if the bug is plan to be resolve in the futur…

We have addressed and fixed this issue in newer edition. Please look forward to Nsight 4.6. Thanks for your patience.

I install CUDA 7.0 and after that I install Nsight 4.6…
I got the same problem… canot debug my code with Nsight when OpenCV is present…

Cuda 7.0 install the 347.88 version of the graphic device driver… not bthe 347.62… it’s not suppose to be a problem…

Launch Option

Connection name : localhost
Commenand line arguments: $(LocalDebuggerCommandArguments)
Working directory: C:\Users\champagg\Documents\420-AE8-LL GPGPU et Robot\GPGPU\A2015\OpenCVImgCuda\x64

Any idea…

THank’s