Skip to content

Commit aec25ec

Browse files
authored
Merge pull request #256 from parca-dev/fix-cudaverify
Fix cudaverify tests
2 parents 67c3b5d + 0cb28dc commit aec25ec

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
codespell lint ebpf-profiler format format-ebpf format-go pprof-execs \
44
pprof_1_23 pprof_1_24 pprof_1_24_cgo otelcol-ebpf-profiler \
55
rust-components rust-targets rust-tests vanity-import-check vanity-import-fix \
6-
otel-from-tree otel-from-lib
6+
otel-from-tree otel-from-lib cudaverify-test
77

88
SHELL := /usr/bin/env bash
99

@@ -191,5 +191,20 @@ agent:
191191
legal:
192192
go tool $(GO_TOOLS) go-licenses save --force . --save_path=LICENSES
193193

194+
cudaverify-test: ebpf
195+
@set -e; \
196+
tmpdir=$$(mktemp -d); \
197+
trap 'rm -rf "$$tmpdir"' EXIT; \
198+
cupti_headers=$$(go mod download -json github.com/parca-dev/parcagpu@latest 2>/dev/null | \
199+
sed -n 's/.*"Dir": "\(.*\)".*/\1/p')/ebpf; \
200+
echo "==> Downloading parcagpu libs into $$tmpdir"; \
201+
PARCAGPU_DIR="$$tmpdir" $(CURDIR)/test/distro-qemu/download-parcagpu.sh; \
202+
echo "==> Building cudaverify.test (cupti headers: $$cupti_headers)"; \
203+
CGO_ENABLED=1 CGO_CFLAGS="-I$$cupti_headers" \
204+
go test -c -o "$$tmpdir/cudaverify.test" ./test/cudaverify; \
205+
echo "==> Running cudaverify tests (sudo)"; \
206+
cd "$$tmpdir" && sudo env LD_LIBRARY_PATH="$$tmpdir" \
207+
./cudaverify.test -test.v -so-path ./libparcagpucupti.so
208+
194209
codespell:
195210
@codespell

test/distro-qemu/mock-cupti-headers/cupti_pcsampling.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ typedef struct {
2121
uint32_t functionIndex;
2222
char *functionName;
2323
uint32_t stallReasonCount;
24-
CUpti_PCSamplingStallReason stallReason[CUPTI_PC_SAMPLING_MAX_STALL_REASONS];
24+
CUpti_PCSamplingStallReason *stallReason;
25+
uint32_t correlationId;
2526
} CUpti_PCSamplingPCData;
2627

2728
typedef struct {

0 commit comments

Comments
 (0)