An NVIDIA Nsight Systems plugin to monitor and record H3P PCIe switch utilization, throughput, and error counters onto the Nsight Systems timeline.
- CUDA Toolkit (for NVTX headers, usually located at
/usr/local/cuda/include) - libh3ppci / libph3ppci: This plugin interfaces with the H3P PCIe switch using the
libh3ppci.soshared library. - g++ and Make
- Be sure to check the
Makefileto ensure it points to the correct location of yourlibh3ppci.solibrary (viaH3PPCI_LIB_DIRor by manually editingLDFLAGS) and the CUDA headers (CXXFLAGS). - Run
maketo compile:This generates themake
h3_sw_countersexecutable.
Nsight Systems loads the plugin via the configuration provided in the h3_sw_counters.yaml manifest.
- Ensure the
h3_sw_countersexecutable was built successfully. - Set the
NSYS_PLUGIN_SEARCH_DIRSenvironment variable to point to the$(pwd)subdirectory inside this repository. You can use the following command in the project root:(Note: The variable must point to the folder containing theexport NSYS_PLUGIN_SEARCH_DIRS=$(pwd)
h3_sw_counters.yamlfile) - Run
nsys profileand pass the--enableflag with the name of the plugin (h3_sw_counters):nsys profile --enable h3_sw_counters <your_target_application>
When using the --enable flag, you can pass custom arguments to the h3_sw_counters (such as the module type or sampling interval).
The syntax requires the plugin name followed by its arguments, all separated by commas (no spaces) inside double quotes:
nsys profile --enable "h3_sw_counters,<arg1>,<val1>,<arg2>,<val2>" <your_target_application>-
Monitor Error Counters instead of Throughput:
nsys profile --enable "h3_sw_counters,-m,error" ./my_app -
Set Sampling Interval to 500ms:
nsys profile --enable "h3_sw_counters,-t,500" ./my_app -
Combine both (Error module + 500ms interval):
nsys profile --enable "h3_sw_counters,-m,throughput,-t,500,-p,0,32" ./my_app -
Filter by Device Index (e.g., Device 0 only):
nsys profile --enable "h3_sw_counters,-i,0" ./my_app
These arguments are passed directly to the h3_sw_counters executable by Nsight Systems during the profiling session.