diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 09:51:22 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-09-29 09:51:22 -0400 |
| commit | 8cb84c25cb55ac61e423ee39b7dcb6420d302f96 (patch) | |
| tree | 62f80c8bbd0599ce1ea9bdb2286d80c7de5b51da | |
| parent | 497d4d8f333fb750e365e4ff0a32764ed008548b (diff) | |
| download | open-iov-8cb84c25cb55ac61e423ee39b7dcb6420d302f96.tar.gz open-iov-8cb84c25cb55ac61e423ee39b7dcb6420d302f96.zip | |
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.
| -rwxr-xr-x | tools/guest-diag/cuda_cycle.sh | 11 |
1 files 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" |
