From 9f5fa47a1fc84d5bdfb8ff24a88f6a33e104d097 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 09:51:22 -0400 Subject: tools: cuda_cycle.sh - detect channels from dmesg (client timeout is ~30 s) The client times out the context-init counter wait in ~30 s; the previous poll loop spent ~50 s on chan_dump round-trips before injecting. Count the per-channel first-pump log lines straight from dmesg every 0.5 s instead. --- tools/guest-diag/cuda_cycle.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/guest-diag/cuda_cycle.sh b/tools/guest-diag/cuda_cycle.sh index 19143a2..cc333fb 100755 --- a/tools/guest-diag/cuda_cycle.sh +++ b/tools/guest-diag/cuda_cycle.sh @@ -33,15 +33,16 @@ timeout 30 "$VMEXEC" exec \ >/dev/null 2>&1 echo "[*] waiting for 20 GR channels" -for i in $(seq 1 90); do - sleep 2 - echo 1 | sudo tee /sys/module/open_iov_vfio/parameters/chan_dump >/dev/null - sleep 1 - n=$(sudo dmesg -T | grep "sema-chan-dump" | grep "eng=0" | wc -l) +# The client times out its context-init wait in ~30 s, so detection must be +# cheap: count the per-channel first-pump log lines straight from dmesg +# instead of round-tripping through the chan_dump parameter every second. +for i in $(seq 1 240); do + n=$(sudo dmesg -T | grep -c "sema-chan: h=0x5c" || true) if [ "$n" -ge 20 ]; then echo " GR channels up (poll $i)" break fi + sleep 0.5 done echo "[*] injecting counters" -- cgit v1.2.3