Nsight Debugging C++ Application with Cuda Code inside

I have a problem with debugging my testsuite in Visual Studio.
I have a project “MainProject” and a project called “whitebox” where i wrote some tests.
At this project i am calling a Cuda-Kernel written at convolution.cu at MainProject.
The application works well but if i try to debug my kernel with nsight debugger it replies

Der Thread ‘CUDA’ (0x1) hat mit Code 0 (0x0) geendet.
Das Programm “[5088] whitebox.exe: CUDA” wurde mit Code 0 (0x0) beendet.

If i open a new Cuda C project the debugging works well but i need to debug my c++ Project which includes
cuda code. Any ideas?

I think my nsight user properties are correct. The path is set to the whitebox.exe. Do i have to make further settings in Visual Studio?

Thanks a lot.


Could you tell me how you launch the debugger, your GPU and driver version?

The message is clear, the cuda app runs well, you should hit the bp in cuda code. BTW you should launch the cuda debugger via “right click the project -> Debug menu -> Start legacy debugger”.

Best Regards


i tried to launch the debugger in the nsight menu of visual studio by starting the
cuda legacy debugger and via right click the project, but it doesn’t matter. It doesn’t work either.

GPU: NVIDIA GeForce GTX 750 Ti
Driver: Nvidia Grafics Driver 376.51
Nsight Version: 5.5

Do you have any other ideas?

Best regards

I guess it’s driver’s issue, nsight only work with the right version of driver, 376 is too old, you shall try the latest 390 or 391 one.

But why does it work within a cuda project?
And not in a c++ project?

I’ll try the newest driver version.

Hi, nsight can only debug the code in global or device, it cannot debug the c++ code unless you use the next-gen debugger in nsight 5.6, but next-gen only work with tesla cards.

I know that but i try to explain my project setup.
I have in my project both .h, .cpp, .cu, .cuh files and of course
i only try to debug my global functions with nsight.
But this doesn’t work and that’s the matter.

Perhaps i should ask in another way;)

What Nsight User Properties do i need?
Do i have to change some other Properties in my Visual C++ Project?
Perhaps it’s not possible to debug my cuda kernels in a Visual c++ project
because i have no option tab like cuda c++ in my project properties
where i can set the cuda debugging to yes?
I have really no idea what the problem is?

I tried the newest driver version. unfortunately it doesn’t change anything :(

Could you tell me the detailed info of your project?

I guess MainProject is a c++ dll project and whitebox is a exe, right?

That’s right. And in my dll project you can find the .cu file.
What should i do?

I really have no idea, we have a test case to cover this scenario. Last question, did you use debug mode to compile you cuda app? if it still doesn’t work, can you share your project with me? I shall repo it on my computer.

I compiled all files in this visual c++ project by using debug mode in visual studio…that’s not correct?

i can’t share this project because the source code of the company i write my master thesis for is
also in this project.

So no other ideas?

Sorry, I really have no idea, we have 750Ti in our auto test machine and nsight works well with them, could you share a minimum project which doesn’t have any confidential code then I can try to repo it on my computer.