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 https://docs.nvidia.com/cuda/cuda-gdb/index.html for debugging on Linux or https://developer.nvidia.com/nsight-visual-studio-edition on Windows. You can also use https://docs.nvidia.com/cuda/cuda-memcheck/index.html to detect potential deadlocks and races in your GPU code.