Repository navigation
Conversation
Docker builds now ship libcupti.so (CUDA 12.9.1, from the cuda-headers image) next to libparcagpucupti.so: in the export stage, the runtime image's /usr/lib, make build-<arch>, and a parcagpu-<arch>.tar.gz release asset. parcagpu tries Proton's usual lookup first and loads the bundled copy from its own directory only when that fails. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f095-6696-742c-b484-3c159d3570a0 Co-authored-by: Tommy Reilly <tommy.reilly@dash0.com>
Docker builds now ship libcupti.so.12 (CUDA 12.9.1) and libcupti.so.13 (CUDA 13.0.2) next to libparcagpucupti.so, each with the libnvperf_host.so it loads for PC sampling, renamed libnvperf_host.so.12 and .13. A new Dockerfile stage downloads them from NVIDIA's cuda_cupti redist archives and checks their sha256. When Proton's usual lookup finds no libcupti.so, parcagpu loads the bundled CUPTI 13 if the driver supports CUDA 13 and every GPU has compute capability 7.5 or higher (read through NVML, since cuDeviceGet does not work inside InitializeInjection), and CUPTI 12 otherwise. With PC sampling on it also loads the matching libnvperf_host.so; without it CUPTI reports zero stall reasons. The activity and PC sampling layouts and callback IDs parcagpu uses are the same in CUPTI 12.9 and 13.0, so one build against the 12.9 headers serves both. The mock libcupti.so.12 symlink in build-local/lib is gone: nothing used it, and the bundled lookup would have loaded it on drivers below 580. Amp-Thread-ID: https://ampcode.com/threads/T-01a1f15d-3db3-720a-9385-b4ee902158c4 Co-authored-by: Tommy Reilly <tommy.reilly@dash0.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
parcagpu now ships two CUPTI versions next to
libparcagpucupti.soand picks one at runtime, so it works withoutLD_LIBRARY_PATHor other env vars on both CUDA 12 and CUDA 13 systems.What ships
Docker builds (
make build-<arch>, the runtime image's/usr/lib, and a newparcagpu-<arch>.tar.gzrelease asset) include:libcupti.so.12(CUDA 12.9.1) andlibcupti.so.13(CUDA 13.0.2)libnvperf_host.so.12and.13. CUPTI loadslibnvperf_host.soby name for PC sampling and reports zero stall reasons without it.A new Dockerfile stage downloads these from NVIDIA's
cuda_cuptiredist archives and checks their sha256. The arm64 tarball is 17 MB.How parcagpu picks one
Proton's lookup still goes first:
TRITON_CUPTI_LIB_PATH, an already loadedlibcupti.so, thenLD_LIBRARY_PATHand the system library paths. If none of these finds CUPTI, parcagpu loads:libcupti.so.13whencuDriverGetVersionis at least 13000 and every GPU has compute capability 7.5 or higher. CUPTI 13 dropped Volta and Pascal, which still run on driver 580. Compute capability comes from NVML, becausecuDeviceGetdoes not work insideInitializeInjection.libcupti.so.12otherwise.With PC sampling on, parcagpu also loads the matching
libnvperf_host.so, which adds about 110 MB of RSS.One build serves both
The fields parcagpu and
ebpf/cupti_bpf.hread fromCUpti_ActivityKernel5sit at the same offsets in Kernel9 (emitted by CUPTI 12.9) and Kernel10 (emitted by 13.0).CUpti_PCSamplingPCDataandCUpti_PCSamplingDataare byte-identical in both versions. Every callback ID parcagpu or Proton uses keeps its number. So we still compile once against the 12.9 headers.An app's own CUPTI is not reused
PyTorch cu13 loads
libcupti.so.13from its pip wheel. parcagpu still loads its bundled copy. CUPTI accepts only one subscriber per process either way. With a shared copy, kineto takes over parcagpu's activity buffers and PC sampling breaks. With separate copies, parcagpu keeps all kernel records, and atorch.profilerstarted later getsCUPTI_ERROR_MULTIPLE_SUBSCRIBERS_NOT_SUPPORTED, logs a warning and records nothing; nothing crashes.Testing
Tested on an NVIDIA GB10 (Blackwell, sm_121, arm64) with driver 580.178.04, no env vars, and
LD_LIBRARY_PATHunset:/proc/<pid>/mapsshowed only the bundled copy.make test-pc-realpasses with both a CUDA 13 toy (1627 PC samples) and a CUDA 12.9 toy (1613 PC samples).make test-multipasses (890 kernel events through BPF; mock CUPTI).make build-arm64output, run in an Ubuntu 24.04 container on the same GPU, recorded all 6 kernels and 36 stall reasons.Not tested: pre-Turing GPUs, and drivers older than 580 (the CUPTI 12 path on real hardware).
make test-nvtx(case9) and three BPF checks inmake test-pc-mockfail the same way on the base branch, so this PR does not cause them.