Break on API Error

Hi,

I can build all of the samples and have started on my own project.
I have an issue where when I run the program a couple of times (sometimes just once or twice) my computer becomes completely frozen and I have to hard-reset the pc. Other times it works perfectly fine and gets the right results.

I started using nsight compute and whenever I run the program I hit a breakpoint for api error:
cuDriverGetVersion.

It doesn’t matter if I run my program or the samples. It always breaks(hits a breakpoint) there.
With the sample program if I continue everything works as expected, however with mine Compute becomes unresponsive and the pc again crashes. I can’t even terminate the program.

Thanks for your time

From your explanation, it appears the issue is not related to Nsight Compute, but some kind of bug in your application, correct? I would advise to first use a CPU/GPU debugger to pinpoint and solve the issue before using Nsight Compute for profiling. While Nsight Compute does allow stepping and inspecting API calls, the error value you see does not seem to be the issue in your case. Otherwise, the sample would likely show the hang, too.

Depending on your system, you can use CUDA-GDB :: CUDA Toolkit Documentation for debugging on Linux or NVIDIA Nsight Visual Studio Edition | NVIDIA Developer on Windows. You can also use CUDA-MEMCHECK :: CUDA Toolkit Documentation to detect potential deadlocks and races in your GPU code.