summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/cycle-r1780.sh
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-12 18:28:16 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-12 18:28:16 -0500
commit800c108f9d2463066a221a0e4ff56867304551a6 (patch)
treef9fec57a2402c5022f19f4a0be164e58f96b7fe5 /tools/guest-diag/cycle-r1780.sh
parent8dce7e59027e8d07ccdf4aa6ac3da02b6e9e9fd9 (diff)
downloadopen-iov-800c108f9d2463066a221a0e4ff56867304551a6.tar.gz
open-iov-800c108f9d2463066a221a0e4ff56867304551a6.zip
tools: fix r1780 cycle prerequisites and add SDL GLX-pbuffer shim
- cycle-r1780.sh: load vfio modules one per modprobe (the multi-module form was silently treating the extra names as parameters and never loading mdev); auto-detect the vgpu mdev type and prefer the 2 GiB type used by the campaign. - sdl_cap.c: gate capture-file creation to processes that can actually read GL pixels (a child was truncating the capture), and log the capture pid/pointers. - gz_pbuf.c: LD_PRELOAD shim that gives an SDL2 GL client a GLX pbuffer context on the guest's NVIDIA X server (the proven gl_frames path), with SDL_GL_GetDrawableSize/SwapWindow interception.
Diffstat (limited to 'tools/guest-diag/cycle-r1780.sh')
-rwxr-xr-xtools/guest-diag/cycle-r1780.sh17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/guest-diag/cycle-r1780.sh b/tools/guest-diag/cycle-r1780.sh
index 23cf0d1..0acab1c 100755
--- a/tools/guest-diag/cycle-r1780.sh
+++ b/tools/guest-diag/cycle-r1780.sh
@@ -16,7 +16,7 @@ ARGV_FILE="${INSMOD_PARAMS:-$HERE/params-r1780.txt}"
BACKUP="$REPO/backups/evidence-20261002-victory/r1780"
DISK="${GUEST_DISK:-/home/rmcore/.local/libvf.io/kernel/linux.qcow2}"
MDEV_PARENT="0000:01:00.0"
-MDEV_TYPE="nvidia-nvidia-vgpu-turing"
+MDEV_TYPE="${MDEV_TYPE:-}"
RUNDIR="$HERE/run"
QEMU_SCRIPT="$HERE/launch_qemu_r1780.run.sh"
mkdir -p "$RUNDIR" "$BACKUP"
@@ -72,8 +72,7 @@ if [ -d /sys/module/vgsp ]; then
fi
echo "[cycle $TAG] load VFIO/mdev prerequisites"
-sudo modprobe vfio vfio_iommu_type1 vfio_pci mdev 2>/dev/null || true
-sudo modprobe vfio_iommu_type1 2>/dev/null || true
+for m in vfio vfio_iommu_type1 vfio_pci mdev; do sudo modprobe "$m" 2>/dev/null || true; done
echo "[cycle $TAG] stop nvidia-persistenced, power/control=on"
sudo systemctl stop nvidia-persistenced 2>/dev/null || true
@@ -84,6 +83,18 @@ echo "[cycle $TAG] insmod $(basename "$MODULE")"
# shellcheck disable=SC2046
sudo insmod "$MODULE" $(cat "$ARGV_FILE")
+for i in $(seq 1 40); do
+ [ -d "/sys/class/mdev_bus/$MDEV_PARENT/mdev_supported_types" ] && break
+ sleep 0.5
+done
+if [ -z "$MDEV_TYPE" ]; then
+ MDEV_TYPE=$(ls "/sys/class/mdev_bus/$MDEV_PARENT/mdev_supported_types" 2>/dev/null | grep -m1 'vgpu-turing-2g$' || true)
+fi
+if [ -z "$MDEV_TYPE" ]; then
+ MDEV_TYPE=$(ls "/sys/class/mdev_bus/$MDEV_PARENT/mdev_supported_types" 2>/dev/null | grep -m1 'vgpu-turing$' || true)
+fi
+if [ -z "$MDEV_TYPE" ]; then echo "FATAL: no vgpu-turing mdev type under $MDEV_PARENT"; ls "/sys/class/mdev_bus/$MDEV_PARENT/mdev_supported_types" 2>/dev/null; exit 1; fi
+echo "[cycle $TAG] mdev type $MDEV_TYPE"
U=$(uuidgen)
echo "$U" | sudo tee "/sys/class/mdev_bus/$MDEV_PARENT/mdev_supported_types/$MDEV_TYPE/create" >/dev/null
if [ ! -d "/sys/bus/mdev/devices/$U" ]; then echo "FATAL: mdev create failed"; exit 1; fi