Runtime Requirements#
NVIDIA Nsight Compute from CUDA Toolkit 13.3 Update 1 or later: nsight-python uses the NVIDIA Nsight Compute CLI (ncu 2026.2.1+). Ensure
ncuis installed and available on the system path. The installedncu-reportpackage must be at least as new (by major and minor version) as this NVIDIA Nsight Compute.NVIDIA CUPTI: The CUPTI backend requires the CUPTI Library from CUDA 13.4 or greater. Installing Nsight Python with the
cuptiextra (see Installing from PyPI) installsnvidia-cuda-cupti, which provides this library. See CUPTI Compatibility and Requirements for driver compatibility and other setup requirements.
Import Ordering#
import nsight must come before:
CUDA initialization: You must import nsight before any operation that initializes CUDA (e.g.
torch.cuda.init()). If CUDA is initialized first, NVIDIA Nsight Compute cannot attach correctly and profiling fails (commonly withNV_INJ_ERROR_NOT_INITIALIZED).Recommendation: Place
import nsightat the top of your script, before all CUDA-related imports and calls.This ordering matters because
import nsightactivates NVIDIA Nsight Compute; see Tools.Any NVTX API calls: nsight-python updates
NVTX_INJECTION64_PATHat import time. Any NVTX usage beforeimport nsightwill cause NVTX annotation ranges to be missed and profiling results to be incomplete.