Using NVTX with Tegra System Profiler


Tegra System Profiler is a multi-core CPU sampling profiler that provides an interactive view of captured profiling data, helping improve overall application performance. The NVIDIA Tools Extension Library (NVTX) is a powerful mechanism that allows users to manually instrument their application. Tegra System Profiler can then collect the information and present it on the timeline.

Tegra System Profiler supports version 1.0 of the NVTX specification, on both Android and Linux-based target devices.

The following features are supported:

To use NVTX in your application, follow these steps:

  1. Add #include "nvToolsExt.h" in your source code. This header file is located in the Target-arm/nvtx/include directory on the host.
  2. Link with libnvToolsExt.a static library (-lnvToolsExt compiler flag).
  3. Add the following compiler flags as well: -pthread -ldl -lrt.
  4. Add calls to the NVTX API functions. For example, try adding nvtxRangePushA("main") in the beginning of the main() function, and nvtxRangePop() just before the return statement in the end.
  5. In the project settings, select the Collect NVTX trace checkbox.
  6. On Android, make sure that your application is launched by Tegra System Profiler. This is required so that the necessary launch environment is prepared.
  7. On Linux, if the application is launched by Tegra System Profiler, all required environment variables will be set up automatically.
  8. On Linux, if launching the application manually, the following environment variables should be specified:
    NVTX_INJECTION32_PATH=/opt/nvidia/tegra_system_profiler/libToolsInjection32.so (for ARMv7 processes)
    NVTX_INJECTION64_PATH=/opt/nvidia/tegra_system_profiler/libToolsInjection64.so (for Aarch64 processes)
    NVTX_START_IMMEDIATELY=1

 


NVIDIA® GameWorks™ Documentation Rev. 1.0.200601 ©2014-2020. NVIDIA Corporation. All Rights Reserved.