summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/gl_verify.sh
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-12 20:01:04 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-12 20:01:04 -0500
commit725898e44666b4def396f7f3c5e50712fd37aa33 (patch)
tree261bba910db49036624cc2cf89baac6554a6f58d /tools/guest-diag/gl_verify.sh
parent800c108f9d2463066a221a0e4ff56867304551a6 (diff)
downloadopen-iov-725898e44666b4def396f7f3c5e50712fd37aa33.tar.gz
open-iov-725898e44666b4def396f7f3c5e50712fd37aa33.zip
vgsp: stop fabricating 0xFFFF into the nvPush error notifier; add r1780 GL ops tooling
The uncommitted keep-alive change wrote 0xFFFF into slot 0's status field (u16 at notifier+0x0e) on the X DDX / GLX kick-idle channel families. Ground truth (570.144 reference sources + stock nvidia_drv.so disassembly): slot 0 of an nvPush notifier block is the ERROR notifier; nvPushCheckChannelError reads that status and 0xFFFF aborts every nvPushWaitForNotifier/idle wait as a channel error. There is no pb_kickIfIdle in 570.144 - the DDX DMA-idle test reads the progress-tracker semaphore word, not this slot. Leave slot 0 untouched; keep the 0x8000->0 completion ack for the remaining slots and the r864 0xFFFF/0x8000 completion on the RC-watchdog/beef families. Correct the CONT.408/409 comments accordingly. New host/guest tooling: gpa.py (QMP gva2gpa), tick_gen.py (guest-RM timer BO tick), guest_mode.sh (shared nvClip modeNum reader), gl_verify.sh (X/GLX bring-up with ScreenInit-lottery retries), push_gl_tools.sh, the gzdoom_pbuf_run.sh guest recipe and the test_tri SDL2 harness validation program; ignore tools/guest-diag/build/.
Diffstat (limited to 'tools/guest-diag/gl_verify.sh')
-rw-r--r--tools/guest-diag/gl_verify.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/tools/guest-diag/gl_verify.sh b/tools/guest-diag/gl_verify.sh
new file mode 100644
index 0000000..edfaab2
--- /dev/null
+++ b/tools/guest-diag/gl_verify.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright (c) 2026 Open-IOV contributors
+# gl_verify.sh - host-side: (re)start X in the running guest, verify xdpyinfo +
+# glxinfo -B + shared nvClip modeNum. Prints a compact summary.
+#
+# Usage: bash tools/guest-diag/gl_verify.sh [--no-restart]
+# --no-restart : check the current X without killing/restarting it.
+set -u
+
+HERE="$(cd "$(dirname "$0")" && pwd)"
+VMEXEC=(sudo python3 "$HERE/../../scripts/vgpu_vm.py")
+RESTART=1
+[ "${1:-}" = "--no-restart" ] && RESTART=0
+
+gx() { "${VMEXEC[@]}" exec --timeout "${1:-45}" "$2" 2>&1 | tail -n "${3:-40}"; }
+
+if [ "$RESTART" = "1" ]; then
+ # The DDX ScreenInit is a per-start lottery ("GPU exception"): retry up to 3x.
+ for try in 1 2 3; do
+ gx 30 "pkill -f '[X]org :0' 2>/dev/null; sleep 1; systemctl reset-failed xorg0 2>/dev/null; systemd-run --unit=xorg0 --collect --setenv=HOME=/root /usr/bin/Xorg :0 -config /etc/X11/xorg.conf >/dev/null 2>&1; echo XSTART-ISSUED" >/dev/null
+ sleep 8
+ ok=$(gx 20 "timeout 12 env DISPLAY=:0 xdpyinfo >/dev/null 2>&1 && echo XDPYINFO-OK || echo X-DEAD" 3 | tail -1)
+ echo "try $try: $ok"
+ [ "$ok" = "XDPYINFO-OK" ] && break
+ sleep 4
+ done
+fi
+
+gx 40 "pgrep -c Xorg || echo NO_XORG; timeout 15 env DISPLAY=:0 xdpyinfo >/dev/null 2>&1 && echo XDPYINFO-OK || echo X-HUNG; timeout 20 env DISPLAY=:0 glxinfo -B 2>&1 | grep -E 'direct rendering|OpenGL (renderer|version|core profile version)'; timeout 20 env DISPLAY=:0 glxinfo -B >/dev/null 2>&1 && echo GLXINFO-OK || echo GLX-HUNG; bash /tmp/guest_mode.sh 2>/dev/null || echo NO_MODENUM_SCRIPT" 60