Getting Started#
Runtime requirements#
Python version >= 3.10
Installing from PyPI#
$ pip install cupti-python
Locating the CUPTI Library#
CUPTI Python has a dependency on
nvidia-cuda-cuptiand uses the CUPTI C librarylibcupti.so*.CUPTI Python uses cuda.pathfinder to locate and load
libcupti.so*. For detailed information about the search order and library discovery mechanism, please refer to the search order in cuda.pathfinder.load_nvidia_dynamic_lib.
Profiling Library Configuration#
If you intend to use profiling features such as
cupti.pm_sampling, the CUPTI shared library dynamically loadslibnvperf_host.soandlibnvperf_target.soat runtime. These ship in the same directory aslibcupti.so*, so make that directory discoverable to the dynamic linker viaLD_LIBRARY_PATH.e.g. If CUPTI Python is using the CUPTI shared library from the
nvidia-cuda-cuptipackage:
$ export LD_LIBRARY_PATH=<site-packages>/nvidia/cu13/lib:$LD_LIBRARY_PATH
NVTX Configuration#
CUPTI Python provides support for NVTX through the activity kinds
cupti.cupti.ActivityKind.MARKER,cupti.cupti.ActivityKind.MARKER_DATA, andcupti.cupti.ActivityKind.NAME.To enable proper collection of NVTX-related activity records, ensure the following setup:
Set the
NVTX_INJECTION64_PATHenvironment variable to point to the same CUPTI shared library that CUPTI Python is using.e.g. If CUPTI Python is using the CUPTI shared library from the
nvidia-cuda-cuptipackage, the path should be:
$ export NVTX_INJECTION64_PATH=<site-packages>/nvidia/cu13/lib/libcupti.so.13