Failed to profile kernel

I use NVIDIA Nsight Compute on Linux. Version 2020.1.2

When profiling either interactively, or via CLI, I get:

==PROF== Profiling "osino_computefield" - 1: 0%....50%.. - 11 passes
==ERROR== Failed to profile kernel "osino_computefield" in process 63168
==ERROR== The application returned an error code (8).
==ERROR== An error occurred while trying to profile.
==WARNING== No kernels were profiled.
==WARNING== Profiling kernels launched by child processes requires the --target-processes all option.

I run as root.

The kernel was launched by a OpenGL application.

When I tried to profile a smaller binary, with no graphics, just a test launch of the kernel, it did work.

So I am guessing that the Nsight Compute tool gets confused if OpenGL and CUDA get mixed in a single application.

Note that the error code (8) is not coming from my application. I think the Nsight command line util produces that.

There’s an Nsight Compute section on these forums. You may get better responses there. Nsight Compute should not be “confused” by the presence of OpenGL, and your assertion that your application is not returning that error code is likely false in my experience. One possible path for debug is to accept what the tool is telling you and find the reason for your application returning an error code.