NVIDIA Tools Extension (NVTX)

The NVIDIA® Tools Extension SDK (NVTX) is a C-based Application Programming Interface (API) for annotating events, code ranges, and resources in your applications. Applications which integrate NVTX can use NVIDIA Nsight, Tegra System Profiler, and Visual Profiler to capture and visualize these events and ranges.

The NVTX API provides additional information to improve presentation of data. In general, the NVTX SDK adds additional value to NVIDIA’s tools while incurring almost no overhead when the tool is not attached to the application.

The NVTX API provides two core services:

  1. Tracing of CPU events and time ranges.
  2. Naming of OS and API resources.

NVTX can be quickly integrated into an application. The sample program below shows the use of range events (nvtxRangePush() and nvtxRangePop()), marker events (nvtxMark()), and resource naming (nvtxNameOsThread()).

#include <nvToolsExt.h> 
#include <sys/syscall.h>
#include <unistd.h>
static void wait(int seconds) {
int main(void) {
nvtxNameOsThread(syscall(SYS_gettid), "Main Thread");

More information is available as comments in nvToolsExt.h. NVTX v3 is a header-only C library. The headers ship with CUDA Toolkit and Nsight tools such as Nsight Graphics and Nsight Systems.


NVIDIA® GameWorks™ Documentation Rev. 1.0.220830 ©2014-2022. NVIDIA Corporation and affiliates. All Rights Reserved.