cudametricnvprof

Can not profile a cuda code with nvprof when using CUPTI functions inside


I'm doing a simple experiment. Everyone may know about callback_metric sample code of CUPTI (located in CUPTI folder: /usr/local/cuda/extras/CUPTI/sample/callback_metric). It contains only a simple code for reading a metric when running a vectorAdd kernel. Everything works when I compile and run the code.

But when I run this code under nvprof command (nvprof ./callback_metric), I get an error message as:

Error: incompatible CUDA driver version

both nvprof and other CUPTI-based codes work fine separately.


Solution

  • The profilers are not intended to be used in this way with applications that make use of CUPTI.

    This is documented in the profiler documentation:

    Here are a couple of reasons why Visual Profiler may fail to gather metric or event information. More than one tool is trying to access the GPU. To fix this issue please make sure only one tool is using the GPU at any given point. Tools include the CUDA command line profiler, Parallel NSight Analysis Tools and Graphics Tools, and applications that use either CUPTI or PerfKit API (NVPM) to read event values.