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.
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.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.