Skip to content

Build, Test, and CI

FindHao edited this page Aug 31, 2025 · 6 revisions

Build 🔨

  • 1. Install Dependencies: Before the first build, run ./install_third_party.sh to download NVBit.
  • 2. Compile: make -j builds lib/cutracer.so for all supported architectures by default.
  • For a faster, targeted build, you can specify an architecture, e.g., make ARCH=sm_90.
  • inject_funcs.cu is compiled with special flags; ptxas version gates may alter -maxrregcount.

Local tests 🧪

  • C++ baseline and injected run: tests/vectoradd
  • Python Triton/Proton example: tests/proton_tests
  • Hang detection example: tests/hang_test

Example commands ▶️:

# Build tool
cd /home/findhao/d/CUTracer && make -j

# VectorAdd (no CUTracer)
cd /home/findhao/d/CUTracer/tests/vectoradd && make && ./vectoradd

# Triton/Proton histogram collection
cd /home/findhao/d/CUTracer/tests/proton_tests
CUDA_INJECTION64_PATH=/home/findhao/d/CUTracer/lib/cutracer.so \
CUTRACER_ANALYSIS=proton_instr_histogram \
KERNEL_FILTERS=add_kernel \
python ./vector-add-instrumented.py

# Clean Chrome trace (no CUTracer)
python ./vector-add-instrumented.py

# Merge for IPC
python /home/findhao/d/CUTracer/scripts/parse_instr_hist_trace.py \
  --chrome-trace ./vector.chrome_trace \
  --cutracer-trace ./kernel_*_add_kernel_hist.csv \
  --cutracer-log ./cutracer_main_*.log \
  --output vectoradd_ipc.csv

# Hang detection (intentional loop kernel)
cd /home/findhao/d/CUTracer/tests/hang_test
CUDA_INJECTION64_PATH=/home/findhao/d/CUTracer/lib/cutracer.so \
CUTRACER_ANALYSIS=deadlock_detection \
python ./test_hang.py

Key validations in tests:

  • CUTracer run creates kernel log and matches CTA/warp EXIT lines
  • Histogram CSV header: warp_id,region_id,instruction,count
  • Generated IPC CSV has more than a minimal number of lines

CI 🤖

  • Project CI configuration may vary by environment. Use the local tests above to validate functionality.

Clone this wiki locally