Registry / observability / nvidia-nvtx

nvidia-nvtx

JSON →
library13.3.29pypypi✓ verified 22d ago

NVIDIA Tools Extension (NVTX) is a C-based API for annotating events, code ranges, and resources within applications, allowing developers to visualize and analyze performance using NVIDIA profiling tools like Nsight Systems. While `nvidia-nvtx` (version 13.2.20) provides the core C API, Python users typically interact with NVTX through the separate `nvtx` Python package (current version 0.2.15), which offers native Python wrappers for a subset of the C API. It enables profiling Python code, including CPU and GPU activities, and visualizing these on a timeline.

pip install nvidia-nvtx
INSTALL
IMPORT
SIG · NVIDIA-NVTX
N
nvidia-nvtx
observabilitypythonv13.3.29
Install
1.6s avg
Import
Disk
70MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v13.3.29 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
70MB installed
● package 70MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nvtx
import nvidia.nvtx
from nvidia import nvtx

This example demonstrates how to annotate Python code using the `nvtx` package. The `@nvtx.annotate` decorator and `with nvtx.annotate` context manager create profiled ranges. To collect and visualize this data, you need to run your script with an NVIDIA profiling tool, such as NVIDIA Nsight Systems (e.g., `nsys profile -t nvtx python your_script.py`).

import time import nvtx @nvtx.annotate(color="blue", message="my_function_range") def my_function(): for i in range(3): with nvtx.annotate(f"my_loop_iteration_{i}", color="red"): time.sleep(0.01 * i) if __name__ == "__main__": print("Running annotated function...") my_function() print("Function complete. Use NVIDIA Nsight Systems to view profile (e.g., nsys profile -t nvtx python your_script.py)")
Debug
Known issues
gotchaThe `nvidia-nvtx` PyPI package provides the underlying C-based NVTX library. For Python-level annotations, you primarily use the `nvtx` PyPI package. Ensure you install `nvtx` (via `pip install nvtx`) to access the Python API.
fix
Install `nvtx` via `pip install nvtx` in your Python environment. The `nvidia-nvtx` package may still be a necessary low-level dependency depending on your system setup.
affects: All versions
gotchaNVTX API calls, by default, do nothing on their own. To collect and visualize profiling data, your application must be launched under an NVIDIA developer tool, such as NVIDIA Nsight Systems. Without such a tool, NVTX annotations will not yield any profiling output.
fix
Run your annotated Python script using `nsys profile -t nvtx python your_script.py` (or similar command for your chosen NVIDIA profiling tool).
affects: All versions
deprecatedSpecialized `nvidia-nvtx-cuXX` packages (e.g., `nvidia-nvtx-cu13`) are deprecated. Users should migrate to using the main `nvidia-nvtx` and `nvtx` packages.
fix
Replace `pip install nvidia-nvtx-cuXX` with `pip install nvidia-nvtx` and `pip install nvtx`.
affects: < 0.0.1 for `nvidia-nvtx-cu13` and similar
gotchaIn earlier versions of the `nvtx` Python package (prior to 0.2.13), decorator ranges might not end correctly if an exception was thrown within the decorated function. This could lead to incomplete or misleading profiling data.
fix
Upgrade the `nvtx` Python package to version 0.2.13 or newer (`pip install --upgrade nvtx`).
affects: nvtx < 0.2.13
Upgrade
Version history
13.3.29latest on PyPI · released May 26, 2026
Audit
Dependencies
nvtxrequiredProvides the Python API bindings for NVTX. Users typically install this package for Python-based profiling.
Agent activity
34 hits · last 30 days
node
30
OpenAI (training)
3
Resources
nvidia-nvtx — pip install nvidia-nvtx · libregistry