Skip to main content

GPU Profiler Environment Variables

Zymtrace GPU profiler​

The following environment variables enable and control the behavior of the Zymtrace GPU profiler. You are required to set them as part of your CUDA application startup arguments. Refer to the docker and K8s manifest examples.

Environment VariableDescription
CUDA_INJECTION64_PATHEnable CUDA profiler by setting env path to libzymtracecudaprofiler, Example: `CUDA_INJECTION64_PATH="/opt/zymtrace/profiler/libzymtracecudaprofiler.so".
NVTX_INJECTION64_PATHEnable NVTX support in the profiler by setting env path to libzymtracecudaprofiler, Example: `NVTX_INJECTION64_PATH="/opt/zymtrace/profiler/libzymtracecudaprofiler.so".
ZYMTRACE_CUDAPROFILER__COLLECT_PER_GPUWhether kernels should be aggregated per GPU or globally. Example: ZYMTRACE_CUDAPROFILER__COLLECT_PER_GPU=false. Default is true.
ZYMTRACE_CUDAPROFILER__ENABLE_NVTXTurn NVTX support on or off. Note: requires the NVTX_INJECTION64_PATH path variable to be set as well. Example: ZYMTRACE_CUDAPROFILER__ENABLE_NVTX=false. Default is true.
ZYMTRACE_CUDAPROFILER__ENABLE_PC_SAMPLINGOverride for enabling PC sampling (takes precedence over auto-detection). Example: ZYMTRACE_CUDAPROFILER__ENABLE_PC_SAMPLING=false. Default is false.
ZYMTRACE_CUDAPROFILER__INTERNAL__MEASURE_STATSWhether to measure additional statistics (printed based on PRINT_STATS, see below). Default is false.
ZYMTRACE_CUDAPROFILER__MODEL_SHAPE__ENABLEDExtract the model shape of PyTorch applications at runtime: the module tree, tensor shapes and parameter count, shown on the Models page, with CUDA kernels attributed to the model layers that launched them. Beta, behind the Models feature flag. Example: ZYMTRACE_CUDAPROFILER__MODEL_SHAPE__ENABLED=true. Default is false.
ZYMTRACE_CUDAPROFILER__MODEL_SHAPE__POLL_INTERVALHow often to poll the process for model shape changes, in seconds (fractions allowed). Example: ZYMTRACE_CUDAPROFILER__MODEL_SHAPE__POLL_INTERVAL=60. Default is 30.
ZYMTRACE_CUDAPROFILER__MODEL_SHAPE__SETTLEHow long no new modules must be registered before a poll runs, in seconds (fractions allowed), so a model is reported once, after it's built. Minimum is 0.1; the wait never exceeds POLL_INTERVAL. Default is 2.
ZYMTRACE_CUDAPROFILER__NCCLCollect NCCL metrics, which straggler detection and slow operations need. Requires NCCL 2.27 or newer. Example: ZYMTRACE_CUDAPROFILER__NCCL=true. Default is false.
ZYMTRACE_CUDAPROFILER__NOOPWhether to do nothing at all and exit immediately without profiling. Example: ZYMTRACE_CUDAPROFILER__NOOP=true. Default is false.
ZYMTRACE_CUDAPROFILER__PRINT_OVERHEADWhether to print process statistics (CPU, memory usage) to the console. Example: ZYMTRACE_CUDAPROFILER__PRINT_OVERHEAD=true. Default is false.
ZYMTRACE_CUDAPROFILER__PRINT_OVERHEAD_INTERVALTime between printing overhead metrics, in seconds (fractions allowed). Example: ZYMTRACE_CUDAPROFILER__PRINT_OVERHEAD_INTERVAL=10. Default is 5.
ZYMTRACE_CUDAPROFILER__PRINT_STATSWhether to periodically dump profiling stats to console. Example: ZYMTRACE_CUDAPROFILER__PRINT_STATS=true. Default is false.
ZYMTRACE_CUDAPROFILER__PRINT_STATS_INTERVALTime between printing stats, in seconds (fractions allowed). Example: ZYMTRACE_CUDAPROFILER__PRINT_STATS_INTERVAL=10. Default is 5.
ZYMTRACE_CUDAPROFILER__PROFILE_MEMORYWhether to profile memory operations. Default is true.
ZYMTRACE_CUDAPROFILER__PROFILE_SYNCWhether to profile synchronization operations. Default is true.
ZYMTRACE_CUDAPROFILER__QUIETIf set to false, enable output to the console. Example: ZYMTRACE_CUDAPROFILER__QUIET=false. Default is true (silent operation). None of the PRINT_* settings have any effect unless this is false.
ZYMTRACE_CUDAPROFILER__STACK_TRACE_SAMPLING__ENABLEDWhether to sample kernel launches, rather than profiling all launches. Default is true.
ZYMTRACE_CUDAPROFILER__STACK_TRACE_SAMPLING__TARGETHow many kernels to profile, per (OS) thread, per WINDOW_SIZE. Default is 50.
ZYMTRACE_CUDAPROFILER__STACK_TRACE_SAMPLING__WINDOW_SIZEThe duration, in seconds (fractions allowed), over which to reach the above defined TARGET sample rate. For example, if this is 1, that means profile (up to) $TARGET kernels / second. Default is 1.
ZYMTRACE_CUDAPROFILER__GRAPH_SAMPLING__*Same one as above, default target is 20.
ZYMTRACE_CUDAPROFILER__MEMORY_SAMPLING__*Same one as above, default target is 20.
ZYMTRACE_CUDAPROFILER__SYNC_SAMPLING__*Same one as above, default target is 20.
important

PC sampling requires appropriate system permissions. Either CAP_SYS_ADMIN privileges or RmProfilingAdminOnly=0 in NVIDIA driver setting.

Check this by running cat /proc/driver/nvidia/params | grep RmProfilingAdminOnly