summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 09:51:22 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 09:51:22 -0400
commit9f5fa47a1fc84d5bdfb8ff24a88f6a33e104d097 (patch)
treeab1c3786955e182af6dd95afd6631865c5b28157 /tools
parent7d4647810ee5cee2986ade4f7d9a51f932469c46 (diff)
downloadopen-iov-9f5fa47a1fc84d5bdfb8ff24a88f6a33e104d097.tar.gz
open-iov-9f5fa47a1fc84d5bdfb8ff24a88f6a33e104d097.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.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/guest-diag/cuda_cycle.sh11
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"