NVIDIA CUDA Profiling Tools Interface (CUPTI) - CUDA Toolkit 12.0
The NVIDIA® CUDA Profiling Tools Interface (CUPTI) is a dynamic library that enables the creation of profiling and tracing tools that target CUDA applications. CUPTI provides a set of APIs targeted at ISVs creating profilers and other performance optimization tools:
- the Activity API,
- the Callback API,
- the Event API,
- the Metric API,
- the Profiler API,
- the PC Sampling API, and
- the Checkpoint API
Using these CUPTI APIs, independent software developers can create profiling tools that provide low and deterministic profiling overhead on the target system, while giving insight into the CPU and GPU behavior of CUDA applications. Normally packaged with the CUDA Toolkit, NVIDIA occasionally uses this page to provide CUPTI improvements and bug fixes between toolkit releases.
- Trace CUDA API by registering callbacks for API calls of interest
- Full support for entry and exit points in the CUDA C Runtime (CUDART) and CUDA Driver
- GPU workload trace for the activities happening on the GPU, which includes kernel executions, memory operations (e.g., Host-to-Device memory copies) and memset operations.
- CUDA Unified Memory trace for transfers from host to device, device to host, device to device and page faults on CPU and GPU etc.
- Normalized timestamps for CPU and GPU trace
- Profile hardware and software event counters, including:
- Utilization metrics for various hardware units
- Instruction count and throughput
- Memory load/store events and throughput
- Cache hits/misses
- Branches and divergent branches
- Many more
- Enables automated bottleneck identification based on metrics such as instruction throughput, memory throughput, and more
- Range profiling to enable metric collection over concurrent kernel launches within a range
- Metrics attribution at the high-level source code and the executed assembly instructions.
- Device-wide sampling of the program counter (PC). The PC Sampling gives the number of samples for each source and assembly line with various stall reasons.
Updates in CUDA 12.0 Update 1
- Reduced the host memory overhead by avoiding caching copies of cubin images at the time of loading CUDA modules. Copies of cubin images are now created only when profiling features that need it are enabled.
- By default CUPTI switches back to the device memory, instead of the pinned host memory, for allocation of the profiling buffer for concurrent kernel tracing. This might help in improving the performance of the tracing run. Memory location can be controlled using the attribute
CUPTI_ACTIVITY_ATTR_MEM_ALLOCATION_TYPE_HOST_PINNEDof the activity attribute enum
- CUPTI now captures the cudaGraphLaunch API and its kernels when CUPTI is attached after the graph is instantiated using the API cudaGraphInstantiate but it is attached before the graph is launched using the API cudaGraphLaunch. Some data in the kernel record would be missing i.e.
sharedMemoryCarveoutRequestedetc. This fix requires the matching CUDA driver which ships with the CUDA 12.0 Update 1 release.
Updates in CUDA Toolkit 12.0
- Added new fields
maxActiveClustersto help in calculating the cluster occupancy correctly. These fields are valid for devices with compute capability 9.0 and higher. To accommodate this change, activity record
CUpti_ActivityKernel8is deprecated and replaced by a new activity record
- Enhancements for PC Sampling APIs:
- CUPTI creates few worker threads to offload certain operations like decoding of the hardware data to the CUPTI PC sampling data and correlation of the PC data to the SASS instructions. CUPTI wakes up these threads periodically. To control the sleep time of the worker threads, a new attribute
CUPTI_PC_SAMPLING_CONFIGURATION_ATTR_TYPE_WORKER_THREAD_PERIODIC_SLEEP_SPANis added in the enum
- Improved error reporting for hardware buffer overflow. When hardware buffer overflows, CUPTI returns the out of memory error code. And a new field
hardwareBufferFulladded in the struct
CUpti_PCSamplingDatais set to differentiate it from other out of memory cases. User can either increase the hardware buffer size or flush the hardware buffer at a higher frequency to avoid overflow.
- Profiling APIs are supported on Windows Subsystem for Linux (WSL) with WSL version 2, NVIDIA display driver version 525 or higher and Windows 11.
- CUPTI support for Kepler GPUs was dropped in CUDA Toolkit 12.0
- Removed minor CUDA version from the SONAME of the CUPTI shared library for compatibility reasons. For example, SONAME of CUPTI library is libcupti.so.12 instead of libcupti.so.12.0 in CUDA 12.0 release.
- Activity kinds
CUPTI_ACTIVITY_KIND_MARKER_DATAcan be enabled together.
- CUPTI has made the following fixes as part of the CUDA Toolkit 12.0 release:
- Linux x86_64
- Windows x86_64
- Linux PowerPC
- Linux aarch64 SBSA
- DRIVE OS QNX aarch64
- DRIVE OS Linux aarch64
 available in the Embedded or Drive toolkits only
Supported NVIDIA GPU architectures
- Activity and Callback APIs
- All architectures supported by CUDA Toolkit
- Event and Metric APIs
- Profiling and PC Sampling APIs
- Hopper: GH100
- Ada: AD10x
- Ampere: A100 with Multi-Instance GPU, GA10x
- Volta: GV100, GV10B
- CUPTI can be found in the CUDA Toolkit 12.0 Update 1 production release
- Please use the following drivers
- 528.33 (Windows)
- 525.85.12 (Linux)
To provide feedback, request additional features, or report issues, please use the Developer Forums.
When installing CUDA Toolkit 12.0 Update 1 and specifying options, be sure to select CUDA > Development > Tools > CUPTI.