reprospect.tools.ncu.session module
- class reprospect.tools.ncu.session.Command(*, executable: str | Path, output: Path, opts: tuple[str, ...] = (), metrics: tuple[Metric | MetricCorrelation | MetricDeviceAttribute, ...] | None = None, nvtx_includes: tuple[str, ...] | None = None, args: tuple[str | Path, ...] | None = None, env: Mapping[str, str] | None = None)View on GitHub
Bases:
objectRun a
ncucommand line.- __init__(*, executable: str | Path, output: Path, opts: tuple[str, ...] = (), metrics: tuple[Metric | MetricCorrelation | MetricDeviceAttribute, ...] | None = None, nvtx_includes: tuple[str, ...] | None = None, args: tuple[str | Path, ...] | None = None, env: Mapping[str, str] | None = None) None
Method generated by attrs for class Command.
- metrics: tuple[Metric | MetricCorrelation | MetricDeviceAttribute, ...] | None
Metrics.
- nvtx_includes: tuple[str, ...] | None
NVTX include. Refer to https://docs.nvidia.com/nsight-compute/2023.3/NsightComputeCli/index.html#nvtx-filtering.
- run(*, cwd: Path | None = None, env: MutableMapping[str, str] | None = None) intView on GitHub
- class reprospect.tools.ncu.session.Session(command: Command)View on GitHub
Bases:
objectNsight Compute session interface.
- run(cwd: ~pathlib.Path | None = None, env: ~typing.MutableMapping | None = None, retries: int = 1, sleep: ~typing.Callable[[int, int], float] = <function Session.<lambda>>) NoneView on GitHub
Run
ncuusingcommand.- Parameters:
retries –
ncumight fail acquiring some resources because other instances are running. Retry a few times. See https://docs.nvidia.com/nsight-compute/ProfilingGuide/index.html#faq (Profiling failed because a driver resource was unavailable).sleep – The time to sleep between successive retries. The callable is given the current retry index (descending) and the amount of allowed retries.
Warning
According to https://developer.nvidia.com/nvidia-development-tools-solutions-err_nvgpuctrperm-permission-issue-performance-counters#ElevPrivsTag, GPU performance counters are not available to all users by default.
Note
As of
ncu2025.1.1.0, a note tells us that specified NVTX include expressions match only start/end ranges.References: