Configuration.md

April 23, 2026 ยท View on GitHub

CUTracer is configured entirely through environment variables. This page is the complete reference.

Core Configuration

VariableTypeDefaultDescription
CUDA_INJECTION64_PATHpathโ€”Path to lib/cutracer.so. The CUDA driver uses this to load CUTracer
CUTRACER_INSTRUMENTstring (comma-separated)"" (none)Instrumentation types to enable. See values below
CUTRACER_ANALYSISstring (comma-separated)"" (none)Analysis types to enable. See values below
KERNEL_FILTERSstring (comma-separated)"" (all kernels)Kernel name substring filters (matched against both mangled and unmangled names). Example: KERNEL_FILTERS=add,_Z2_gemm,reduce
INSTR_BEGINuint320Start of the static instruction index interval for instrumentation
INSTR_ENDuint32UINT32_MAXEnd of the static instruction index interval for instrumentation
TOOL_VERBOSEint0Tool log verbosity level (0 = quiet, 1 = verbose, 2 = more verbose)

CUTRACER_INSTRUMENT Values

ValueOverheadDescription
opcode_onlyLightest ๐ŸชถCollects opcode ID, warp ID, PC, CTA IDs, kernel_launch_id. Used for instruction histograms
reg_traceMedium ๐Ÿ”ฌCollects per-thread register values including uniform registers
mem_addr_traceHeavy ๐Ÿง Collects 32-lane memory access addresses
mem_value_traceHeaviest ๐Ÿ’พCollects memory addresses + values (up to 128-bit per lane), plus memory space, load/store direction, and access width
tma_traceMedium ๐Ÿ“ฆTMA descriptor tracing for UTMALDG/UTMASTG/UTMAREDG instructions on Hopper/Blackwell GPUs
random_delayLow ๐Ÿ”€Injects delays before synchronization instructions for data race detection

โš ๏ธ Enabling both mem_addr_trace and mem_value_trace triggers a warning. mem_value_trace already includes address information, so there is usually no need to enable both.

CUTRACER_ANALYSIS Values

ValueAuto-enables InstrumentationDescription
proton_instr_histogramopcode_onlyPer-warp instruction histogram, segmented by clock regions
deadlock_detectionreg_traceKernel hang detection based on warp loop signatures
random_delayrandom_delay instrumentationRandom delay injection on synchronization instructions. Requires CUTRACER_DELAY_NS

When an analysis auto-enables an instrumentation type, you do not need to repeat it in CUTRACER_INSTRUMENT.


Output Configuration

VariableTypeDefaultDescription
CUTRACER_OUTPUT_DIRpath"" (current working directory)Output directory for trace files. Must already exist, be a directory (not a file), and be writable
CUTRACER_TRACE_FORMATstring or intndjson (2)Trace output format. Accepts string names (case-insensitive) or numeric values. See values below
CUTRACER_ZSTD_LEVELint9Zstd compression level (1โ€“22). Only takes effect when format is zstd (1)

Deprecated: TRACE_FORMAT_NDJSON is still accepted as a fallback if CUTRACER_TRACE_FORMAT is not set, but it is deprecated and will print a deprecation notice. Use CUTRACER_TRACE_FORMAT instead.

CUTRACER_TRACE_FORMAT Values

StringNumericFormatDescription
text0TextPlain-text format, human-readable
zstd1NDJSON + ZstdCompressed NDJSON (.ndjson.zst)
ndjson2NDJSONDefault. Uncompressed NDJSON, useful for debugging
clp3CLP ArchiveCLP archive format

Unrecognized string names or out-of-range numeric values cause a fatal error.

CUTRACER_ZSTD_LEVEL Range

  • 1โ€“3: Faster compression, slightly larger output
  • 19โ€“22: Maximum compression, slower but smallest output
  • Default: 9 (balanced compression speed and ratio)
  • Invalid values (< 1 or > 22) fall back to 9 with a warning

Instruction Category Filtering

VariableTypeDefaultDescription
CUTRACER_INSTR_CATEGORIESstring (comma-separated)"" (no filter โ€” all instructions instrumented)Only instrument instructions belonging to the specified categories

Supported Categories

CategoryMatched SASS InstructionsDescription
mmaHGMMA, UTCHMMA, UTCIMMA, UTCQMMA, UTCOMMAMatrix Multiply-Accumulate
tmaUTMALDG, UTMASTG, UTMAREDGTensor Memory Access
syncWARPGROUP.DEPBARSynchronization
  • Case-insensitive
  • Empty or unset means all instructions are instrumented (no filtering)
  • Setting the variable with no valid category names prints a WARNING

Example โ€” trace only MMA and TMA instructions:

CUTRACER_INSTR_CATEGORIES=mma,tma \
CUTRACER_INSTRUMENT=reg_trace \
CUDA_INJECTION64_PATH=./lib/cutracer.so \
python3 your_kernel.py

Delay Injection Configuration (random_delay analysis)

VariableTypeDefaultDescription
CUTRACER_DELAY_NSuint640Delay value in nanoseconds. Must be positive (โ‰ค UINT32_MAX) when random_delay analysis is enabled
CUTRACER_DELAY_MIN_NSuint640Lower bound for sampled delays in random mode. Must be โ‰ค CUTRACER_DELAY_NS
CUTRACER_DELAY_MODEstringrandomOne of random, fixed, cluster, cluster_fixed. Selects the delay sampling strategy used by the random_delay analysis
CUTRACER_CLUSTER_CTA_IDint-1 (disabled)Restrict delay injection to a specific CTA ID (used with cluster* modes). Setting this together with CUTRACER_DELAY_LOAD_PATH produces non-bit-identical replays
CUTRACER_DELAY_DUMP_PATHpath"" (disabled)Output path for delay config JSON (dump mode โ€” records random delay pattern)
CUTRACER_DELAY_LOAD_PATHpath"" (disabled)Input path for delay config JSON (replay mode โ€” deterministically reproduces a recorded pattern)

โš ๏ธ CUTRACER_DELAY_DUMP_PATH and CUTRACER_DELAY_LOAD_PATH are mutually exclusive. Setting both causes a FATAL exit.

See Analyses for full usage details including dump/replay workflow.


Debug Configuration

VariableTypeDefaultDescription
CUTRACER_DUMP_CUBINintautoSet to 1 to dump cubin files for instrumented kernels, 0 to disable. When not set, auto-enabled whenever any instrumentation is active. The log indicates enabled (auto) vs enabled

Advanced Configuration

These knobs are not needed for typical workflows. They control instrumentation points, host-side callstack capture, kernel-level metadata events, channel buffer sizing, and runtime safety limits.

Instrumentation Point (IPOINT) Selection

NVBit lets each instrumentation be inserted before (a, the default) or after (b) the target instruction. These two variables control that choice. Setting both is a FATAL error.

VariableTypeDefaultDescription
CUTRACER_INSTRUMENT_IPOINT_UNIFORMstring (a/b)aApply a single IPOINT to all enabled instruments
CUTRACER_INSTRUMENT_IPOINTstring (comma-separated, a/b)โ€”Per-instrument IPOINT list. Length must equal the number of values in CUTRACER_INSTRUMENT, in the same order. Example: CUTRACER_INSTRUMENT=opcode_only,reg_trace + CUTRACER_INSTRUMENT_IPOINT=a,b

CPU-Side Callstack Capture

VariableTypeDefaultDescription
CUTRACER_CPU_CALLSTACKstringautoHost callstack capture strategy. Values: auto, auto_gil, pytorch, backtrace, 0 (disable), 1 (enable, default backend)

Kernel Metadata Events (NDJSON)

VariableTypeDefaultDescription
CUTRACER_KERNEL_EVENTSstring0Per-kernel metadata events writer. Values: 0 (disabled), dedup, full, nostack. Anything other than 0 requires CUTRACER_CPU_CALLSTACK โ‰  0

When enabled, CUTracer writes a separate kernel_events_*.ndjson file. See Outputs and File Formats for the file layout.

GPU Channel Buffer Sizing

VariableTypeDefaultDescription
CUTRACER_CHANNEL_RECORDSint0 (use built-in default)Number of records the GPUโ†’CPU channel buffer should hold. The on-device buffer size is computed from this value. Increase for high-throughput kernels if you see drops

Runtime Safety Limits

These guardrails terminate the run early if a kernel is hung or a trace is runaway-large. All accept 0 to disable.

VariableTypeDefaultDescription
CUTRACER_KERNEL_TIMEOUT_Suint320 (disabled)Max wall-clock seconds a single kernel is allowed to run
CUTRACER_NO_DATA_TIMEOUT_Suint3215Abort if no records arrive on the channel for this many seconds
CUTRACER_TRACE_SIZE_LIMIT_MBuint320 (disabled)Stop tracing once the on-disk trace reaches this size (MB)

Implicitly Set Variables

These are set automatically by CUTracer at startup. Users should not set them manually:

VariableValueDescription
CUDA_MANAGED_FORCE_DEVICE_ALLOC1Simplifies channel memory handling

CUDA/NVBit/driver versions must be compatible with your GPU.


Quick Reference (alphabetical)

VariableSection
CUDA_INJECTION64_PATHCore
CUDA_MANAGED_FORCE_DEVICE_ALLOCImplicit
CUTRACER_ANALYSISCore
CUTRACER_CHANNEL_RECORDSAdvanced โ€” Channel
CUTRACER_CLUSTER_CTA_IDDelay Injection
CUTRACER_CPU_CALLSTACKAdvanced โ€” Callstack
CUTRACER_DELAY_DUMP_PATHDelay Injection
CUTRACER_DELAY_LOAD_PATHDelay Injection
CUTRACER_DELAY_MIN_NSDelay Injection
CUTRACER_DELAY_MODEDelay Injection
CUTRACER_DELAY_NSDelay Injection
CUTRACER_DUMP_CUBINDebug
CUTRACER_INSTR_CATEGORIESInstruction Category Filtering
CUTRACER_INSTRUMENTCore
CUTRACER_INSTRUMENT_IPOINTAdvanced โ€” IPOINT
CUTRACER_INSTRUMENT_IPOINT_UNIFORMAdvanced โ€” IPOINT
CUTRACER_KERNEL_EVENTSAdvanced โ€” Kernel Events
CUTRACER_KERNEL_TIMEOUT_SAdvanced โ€” Runtime Limits
CUTRACER_NO_DATA_TIMEOUT_SAdvanced โ€” Runtime Limits
CUTRACER_OUTPUT_DIROutput
CUTRACER_TRACE_FORMATOutput
CUTRACER_TRACE_SIZE_LIMIT_MBAdvanced โ€” Runtime Limits
CUTRACER_ZSTD_LEVELOutput
INSTR_BEGINCore
INSTR_ENDCore
KERNEL_FILTERSCore
TOOL_VERBOSECore

Notes ๐Ÿ“

  • When proton_instr_histogram is enabled, opcode_only is forced internally to minimize overhead and ensure required data is available.
  • When deadlock_detection is enabled, reg_trace is forced internally because loop detection relies on PC and opcode correlation per warp.
  • When random_delay analysis is enabled, the tool will FATAL exit if CUTRACER_DELAY_NS is not set or is zero.
  • KERNEL_FILTERS uses substring matching against both unmangled and mangled names; any match enables instrumentation for that function and related device functions.
  • Enabling additional instrumentation modes increases overhead and output volume; prefer the minimal set that satisfies your analysis.