From c8ccdd772c7650f19d14f143f34b700813575746 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Thu, 8 Oct 2026 04:15:24 -0400 Subject: vgsp+guest-diag: kcore-truth pin resolver (pool/pushbuffer/channel ring+userd) + GR ring userd-derived candidates guest_pin_stream.py now resolves translations entirely from guest truth via /proc/kcore + a manual page-table walk (no QMP races): the CE semaphore pool and pushbuffer memory from the UVM rm_mem structures, and each channel's GPFIFO ring + GPPUT from the tracking semaphore's embedding uvm_channel_t (channel_info located by its gpFifoGpuVa value). This removes the watcher pipeline's flakiness on the cudaMalloc stall class (missing pool/pushbuffer pins). gsp_sema_service.c: svc_gr_ring_autopin tries the guest-registered USERD memdesc base as a ring candidate (the fixed FB convention only matches when the guest's VRAM allocator happens to reproduce the old layout), plus an optional (gsp_sema_dbg) one-shot FB scan + raw-word diagnostics when every candidate fails. tools/cuda-ab/p2: self-checking arbitrary-kernel acceptance suite (10 programs: sequential launches, shapes, params, smem/GEMM, streams, malloc churn, printf+error, FMA benchmark, mixed, managed probe) with host oracle expectations and a guest runner. --- tools/cuda-ab/p2/build.sh | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 tools/cuda-ab/p2/build.sh (limited to 'tools/cuda-ab/p2/build.sh') diff --git a/tools/cuda-ab/p2/build.sh b/tools/cuda-ab/p2/build.sh new file mode 100755 index 0000000..867182c --- /dev/null +++ b/tools/cuda-ab/p2/build.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# SPDX-License-Identifier: BSD-3-Clause +# +# p2/build.sh - build the P2 "arbitrary CUDA kernels" acceptance programs. +# +# Target is sm_75 (Turing TU104) to match the project's GPU. The CUDA +# runtime is linked statically (--cudart=static) so the guest needs only the +# driver's libcuda.so, exactly like ab.sh/victory_mail. +# +# Usage: ./build.sh [program ...] (default: all programs) +set -e + +HERE="$(cd "$(dirname "$0")" && pwd)" +NVCC="${NVCC:-nvcc}" +FLAGS="${P2_NVCC_FLAGS:--O2 -arch=sm_75 --cudart=static}" + +command -v "$NVCC" >/dev/null || { echo "nvcc not found"; exit 1; } + +mkdir -p "$HERE/bin" + +build_one() { + local src="$HERE/src/$1.cu" + local bin="$HERE/bin/$1" + + [ -f "$src" ] || { echo "[build] missing source: $src" >&2; return 1; } + echo "[build] $1" + # shellcheck disable=SC2086 + "$NVCC" $FLAGS -I"$HERE/src" -o "$bin" "$src" +} + +if [ "$#" -gt 0 ]; then + for p in "$@"; do build_one "$p"; done +else + for src in "$HERE"/src/p2_*.cu; do + build_one "$(basename "$src" .cu)" + done +fi + +echo "[build] OK: $(ls "$HERE"/bin/p2_* 2>/dev/null | wc -l) program(s) in $HERE/bin" -- cgit v1.2.3