What is NVTX and how does it work?
devNVTX (NVIDIA Tools Extension Library) is a cross-platform API used to annotate source code with contextual information. This information is consumed by developer tools (like NVIDIA Nsight Systems) to provide meaningful insights during profiling.
Key Behavior: By default, NVTX API calls do nothing. They only become active when the program is launched from a developer tool that implements the NVTX API. When active, these calls can be used to:
- Record traces on a timeline.
- Build statistical profiles of time spent in specific code sections.
- Print messages to the console.
- Enable/disable specific tool features based on the current execution context.