How nvidia/nsight-python works
Nsight Python lets Python users benchmark GPU kernels and inspect profiling metrics. The main workflow decorates or annotates kernel-launch code, runs it through a selected Nsight backend, extracts measurements, and analyzes or visualizes results. Separate capabilities include Compute Sanitizer checks, custom information collection, result transformation, and thermal control. The excerpts show the profiling-session and backend relationships; some additional modules are indexed but not sampled in detail, so their connections are omitted where call ownership is unclear.
Main entry points: analyze.py Kernel analysis · core.py Profile session · ncu.py NCU collector · cupti.py CUPTI collector
Components 16
Python interface
- Public API
nsight/__init__.py - Kernel analysis
nsight/analyze.py
Profiling workflow
- NVTX annotations
nsight/annotation.py - Profile session
nsight/collection/core.py - Tool selection
nsight/tools_manager.py - Custom collectors
nsight/info_collector.py
Collection backends
- NCU collector
nsight/collection/ncu.py - CUPTI collector
nsight/collection/cupti.py - Report extraction
nsight/extraction.py - Sanitizer activation
nsight/sanitize.py - Compute Sanitizer
nsight/collection/compute_sanitizer.py
Results and controls
- Metric visualization
nsight/visualization.py - Result transformation
nsight/transformation.py - Thermal control
nsight/thermovision.py
Other components
- Python user
- NVIDIA profiling tools
Connections 23
- Python user → Public API: imports
nsight/__init__.py - Public API → Kernel analysis: exposes
nsight/__init__.py - Python user → Kernel analysis: profiles kernels
README.md - Kernel analysis → Profile session: runs sessions
nsight/analyze.py - Kernel analysis → Metric visualization: uses
nsight/analyze.py - Kernel analysis → Tool selection: selects tools
nsight/analyze.py - Profile session → NCU collector: profiles with
nsight/collection/ncu.py - Profile session → CUPTI collector: profiles with
nsight/collection/cupti.py - NCU collector → Profile session: runs sessions
nsight/collection/ncu.py - CUPTI collector → Profile session: runs sessions
nsight/collection/cupti.py - NCU collector → Report extraction: extracts reports
nsight/collection/ncu.py - CUPTI collector → Report extraction: uses extraction
nsight/collection/cupti.py - Tool selection → NCU collector: activates
nsight/tools_manager.py - Tool selection → CUPTI collector: activates
nsight/tools_manager.py - Tool selection → Compute Sanitizer: activates
nsight/tools_manager.py - Sanitizer activation → Compute Sanitizer: initializes
nsight/sanitize.py - NVTX annotations → Custom collectors: collects annotation data
nsight/annotation.py - Profile session → Custom collectors: collects run data
nsight/collection/core.py - NVIDIA profiling tools → NCU collector: provides profiler
nsight/collection/ncu.py - NVIDIA profiling tools → CUPTI collector: provides profiler
nsight/collection/cupti.py - NVIDIA profiling tools → Compute Sanitizer: provides checker
nsight/collection/compute_sanitizer.py - Kernel analysis → Result transformation: transforms results
- Kernel analysis → Thermal control: controls thermals