Getting Started#
Runtime requirements#
Python version >= 3.10
Installing from PyPI#
$ pip install cupti-python
Setting for CUPTI C Library#
CUPTI Python has a dependency on
nvidia-cuda-cuptiand uses the CUPTI C librarylibcupti.so*.CUPTI Python automatically searches for
libcupti.so*from thenvidia-cuda-cuptipackage in the following locations (in order):Virtual environment site-packages at
<venv>/.../site-packages/nvidia/cu13/lib/libcupti.so*(when running inside a virtual environment)System site-packages at
<system-site-packages>/nvidia/cu13/lib/libcupti.so*(when using system Python, or when a virtual environment was created with--system-site-packages)Additional site-packages directories at
<site-packages>/nvidia/cu13/lib/libcupti.so*(any remaining directories from site.getsitepackages())User site-packages at
<user-site-packages>/nvidia/cu13/lib/libcupti.so*(if user site is enabled)Fall back to the native loader (Linux:
dlopen()). If the CUPTI library is not found in any site-packages directories, you can set theLD_LIBRARY_PATHenvironment variable to the directory containinglibcupti.so*. When the CUDA Toolkit is installed,libcupti.so*is typically located under$CUDA_TOOLKIT_INSTALL_PATH/extras/CUPTI/lib64.
Example: If the
CUDA_TOOLKIT_INSTALL_PATHis/usr/local/cuda-13.0:$ export LD_LIBRARY_PATH=/usr/local/cuda-13.0/extras/CUPTI/lib64
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