tracy-memory

작성자: nvidia

Tracy 캡처 도구가 설치된 후 Kit 기반 애플리케이션에서 Tracy를 사용하여 CPU 및 GPU 메모리 할당을 프로파일링합니다. LD_PRELOAD 설정을 다룹니다…

npx skills add https://github.com/nvidia/omniperf --skill tracy-memory

Tracy Memory Profiling for Kit-Based Applications

Capture per-allocation CPU and GPU memory data in Tracy. Prerequisite: Tracy capture setup (see profiling skill), install-profilers for binaries.

Step 1: Environment Variables (Linux, required)

The omni.cpumemorytracking extension uses LD_PRELOAD to intercept malloc/free. Without it, Kit logs Failed to load library: 'liballocwrapper.so' and zero memory events are captured.

# Path varies by packman version
export LD_PRELOAD=~/.cache/packman/chk/allocmemwrapper/<version>/liballocwrapper.so
export TRACY_USE_LIB_UNWIND_FOR_BT=1   # libunwind-based backtrace
export TRACY_NO_SYS_TRACE=1            # reduce overhead
export TRACY_PORT="${TRACY_PORT:-8086}" # use 8087 for Isaac Sim 6.0+ when needed

Step 2: Kit Flags

# Base Tracy backend
--/app/profilerBackend=tracy
--/app/profileFromStart=true
--/profiler/enabled=true
--/plugins/carb.profiler-tracy.plugin/skipEventsOnShutdown=true
--/plugins/carb.profiler-tracy.plugin/memoryTraceStackCaptureDepth=16

# Reduce noise
--/profiler/channels/carb.tasking/enabled=false
--/profiler/channels/carb.events/enabled=false

# CPU memory tracking
--enable omni.cpumemorytracking
--/profiler/channels/cpu.memory/enabled=true
--/plugins/carb.cpumemorytracking.plugin/minCpuAllocSizeInBytesToTrack=1024

# GPU memory tracking
--/plugins/carb.memorytracking.plugin/enabled=true
--/profiler/channels/graphics.memory/enabled=true

Step 3: Unset LD_PRELOAD Before Capture Binary

Only Kit should use the interposer. The Tracy capture binary must NOT inherit it:

# After launching Kit with LD_PRELOAD in background
unset LD_PRELOAD
TRACY_CAPTURE_BIN=$(command -v capture || command -v capture-release || command -v tracy-capture)
[ -n "$TRACY_CAPTURE_BIN" ] || { echo "Missing capture/capture-release/tracy-capture binary"; exit 1; }
"$TRACY_CAPTURE_BIN" -o memtrace.tracy -f -p "${TRACY_PORT:-8086}"

Step 4: Verify — Strip Test (MANDATORY)

Do not rely on Kit log lines alone. Verify actual memory data in the output:

# Strip memory events and compare file sizes
TRACY_UPDATE_BIN=$(command -v update || command -v tracy-update)
[ -n "$TRACY_UPDATE_BIN" ] || { echo "Missing update/tracy-update binary; see install-profilers"; exit 1; }
"$TRACY_UPDATE_BIN" -s M memtrace.tracy memtrace_no_mem.tracy

# Good:   67 MB → 44 MB (~23 MB of memory data)
# Broken: 18 MB → 18 MB (zero memory data — LD_PRELOAD failed)

Kit Log Verification

Must see both lines:

[carb.cpumemorytracking] Loaded shared library: 'liballocwrapper.so'
[carb.cpumemorytracking] set memory alloc/free callbacks successfully!

If you see Failed to load library: 'liballocwrapper.so' → LD_PRELOAD path is wrong. Stop and fix before re-running.

Step 5: Analysis in Tracy

Open in Tracy GUI → Memory tab. A successful capture shows:

  • Live counters: Active allocations, Memory usage
  • Callstack tree grouping allocations by function
  • Timeline showing allocation/free events

If Memory tab is empty: recheck LD_PRELOAD path and cpu.memory channel setting.

Debug Symbols

?? and [unknown] ??:??? in allocation callstacks = debug symbols missing. Stripped release binaries only have addresses.

To see function names and source locations:

  • Build with RelWithDebInfo or keep .debug/.pdb files
  • Or use debuginfod / Tracy's symbol path setting (Tools → Resolve symbol path)

Without symbols: allocation size/count/lifetime analysis still works, but code-level attribution doesn't.

Common Mistakes

  • Missing LD_PRELOAD=liballocwrapper.so → extension starts but hooks never install
  • Missing TRACY_USE_LIB_UNWIND_FOR_BT=1 → poor backtrace quality
  • Missing GPU memory: need both carb.memorytracking.plugin/enabled=true AND graphics.memory channel
  • LD_PRELOAD bleeding into capture binary → corrupt capture
  • Trusting Kit log text without strip test → false positive

nvidia의 다른 스킬

fhir-basics
nvidia
에이전트에게 FHIR R4 API의 작동 방식, 사용 가능한 리소스, 검색 매개변수를 사용한 쿼리 방법, 모든 응답 형식을 올바르게 파싱하는 방법을 가르칩니다…
compileiq-validate-result
nvidia
검색이 완료된 후, 속도 향상을 청구하거나 ACF를 발송하기 전에 사용합니다. dump_results CSV를 로드하고, 상위 K개 후보(단일 목표)를 추출합니다…
changelog-audit
nvidia
릴리스 전에 Warp CHANGELOG.md를 감사합니다: 누락된 항목 복구, 사용자 영향별 정렬, 항목 언어 다듬기, 줄 바꿈, (릴리스 브랜치 모드) 비교 업데이트…
dgx-diagnose
nvidia
일반적인 DGX Station GB300 문제 진단 — CUDA 충돌, 잘못된 GPU 타겟팅, vLLM/SGLang 컨테이너 버그, MIG 상태 문제, NVLink/Fabric Manager 오류,…
aicr-managing-openvex
nvidia
Use when adding, updating, or removing CVE/GHSA suppressions in `.openvex.json` — the OpenVEX document consumed by the daily image vulnerability scan workflow.…
aicr-creating-slide-decks
nvidia
기술 개념이나 워크플로우에 대한 독립형 HTML 슬라이드 덱 또는 시각적 발표 자료(예: demos/*.html)를 만들 때 사용하세요. 전체 화면으로 표시하거나…
aicr-creating-guided-demos
nvidia
대화형 안내 데모 스크립트(demos/*.sh)를 라이브 또는 자기 주도 방식으로 Frame → Tell → Show → Close 패턴에 따라 구조화한다. "데모 스크립트", "안내…"와 같은 표현에 반응한다.
aicr-analyzing-snapshots
nvidia
AICR 스냅샷 YAML 파일을 분석하거나, 클러스터 상태를 검토하거나, 공급자 특성을 비교하거나, GPU/네트워크 토폴로지 인사이트를 추출할 때 사용합니다...