Search code examples
cudaprofilernvprof

Filtering functions on NVIDIA Visual Profiler


I'm having trouble to isolate key parts of my code on NVIDIA Visual Profiler's timeline. Some huge bars, as the one in the image. A NVIDIA Visual Profiler timeline with a huge bar related to a single function

I'm not interested in optimizing this function and its existence in the timeline is disrupting several statistical measurements in the program. Hence, I would like to tell the profiler to ignore it. Is it possible?


Solution

  • You can modify the profiling scope using different techniques at different points in the development cycle:

    1. When writing your code, you can use the CUDA profiler API to start and stop profiling activity. If you use this method, when actually running the profiler to capture the data, you will probably want to start with profiling turned off (opposite of default), and then turn profiling on at specific point(s) in your code. In visual profiler, you can select a checkbox during the initial dialog to do this. nvprof has a command line switch to modify the starting profiling behavior.

    2. Mostly Independent of item 1 above, you can modify what data the profiler captures, at the point at which you are running the profiler to capture the data. With nvprof for example, you can select specific kernels by name to profile.

    3. perhaps most directly concerning your question, at the point of visualization of profiler data, the visual profiler has a Timeline Options tab in the File...New Session dialog, and it is also available if you are importing a session e.g. from nvprof, to filter the data actually displayed. The data can be filtered by time of capture as well as data type, for example:

    enter image description here