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
muslpy 3.10–3.910 runs
build_error
glibcpy 3.10–3.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.fixInstall `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.fixRun 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.fixReplace `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.fixUpgrade 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.