NVIDIA Nsight Visual Studio Edition 2.2 User Guide > Analysis Tools > The NVIDIA Tools Extension Library (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 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 marker events, range events, and resource naming.

void Wait(int waitMilliseconds)
{
nvtxNameOsThread(“MAIN”);
nvtxRangePush(__FUNCTION__);
nvtxMark("Waiting...");
Sleep(waitMilliseconds);
nvtxRangePop();
}
 
int main(void)
{
nvtxNameOsThread("MAIN");
nvtxRangePush(__FUNCTION__);
Wait();
nvtxRangePop();
}

 

The NVTX API can be used to:

 

 

 


NVIDIA® Nsight™ Development Platform, Visual Studio Edition User Guide Rev. 2.2.120522 ©2009-2012. NVIDIA Corporation. All Rights Reserved.