Skip to main content

Module nvtx

Module nvtx 

Source
Expand description

NVTX timeline-annotation helpers for Nsight Systems profiling.

Delegates to [cudarc::nvtx] for the actual NVTX calls

§Gating (two-level)

Cargo feature nvtxDYN_ENABLE_RUST_NVTX envEffect
off (default)anymacros compile to nothing; zero overhead
onunsetone Relaxed load per site (~1 ns)
on1 / true / yescudarc NVTX calls (~50 ns/annotation)

§Usage

let _r = dynamo_nvtx_range!("preprocess.tokenize"); // RAII — pops at scope end
dynamo_nvtx_push!("codec.encode");
dynamo_nvtx_pop!();
dynamo_nvtx_name_thread!("tokio-worker-0");

§Build

cargo build --profile profiling --features nvtx

Requires libnvToolsExt.so at runtime (CUDA Toolkit or NVHPC).

Structs§

NvtxRangeGuard
Zero-sized no-op guard used when the nvtx feature is off.

Functions§

enabled
Returns true when the nvtx feature is compiled in and DYN_ENABLE_RUST_NVTX is set.
init
Initialise the NVTX subsystem from the DYN_ENABLE_RUST_NVTX environment variable. Must be called once at runtime startup before any annotation macros fire. No-op when the nvtx Cargo feature is off.
name_current_thread_impl
Name the current OS thread in the Nsight Systems timeline. No-op (compiled out) when the nvtx feature is off.
pop_impl
Pop the innermost NVTX range from the calling thread’s stack. No-op (compiled out) when the nvtx feature is off.
push_impl
Push an NVTX range onto the calling thread’s stack. No-op (compiled out) when the nvtx feature is off.