summaryrefslogtreecommitdiffstats
path: root/tools/guest-diag/push_gl_tools.sh
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-16 23:45:08 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-16 23:45:08 -0500
commit10e03cd7571e905c17092e234a74eed217f1c83d (patch)
tree4ebe8848dbcfa7332f5b55a643cbd771db1824bf /tools/guest-diag/push_gl_tools.sh
parent9386fe4b948e0aba2f3455671a77e18452ddc924 (diff)
downloadopen-iov-10e03cd7571e905c17092e234a74eed217f1c83d.tar.gz
open-iov-10e03cd7571e905c17092e234a74eed217f1c83d.zip
vgsp: eng89s - admit the real CALL(0) 0x3800 draw; GZ_EGL harness
The real 570.144 direct-GL draw window (12068 B @ push 0x402f9d8) carries no 0x3910/0x3914 write. Its draw is an op=4 IMMD to method 0x3800 (imm=0xd48=3400) plus CALL slots 44/57/58 (0x3960/0x39c8/0x39d0), and the window has no colour-target bind of its own, so RT-gated admission sent it down the compute-QMD lane. Recognize and admit the real marker: the walker, chunk check and window marker accept 0x3800/0x3960/0x39c8/0x39d0 (0x3910/ 0x3914 kept); the call-0 admission predicate scans the admitted window (a pre-window run header can swallow the window head); the draw chunk is forced first (draw_slice=1, order 0) and the window replayed verbatim. The booter's DRAW_IAB window predicate accepts the op=4 CALL(0) and the secondaries, the census names slot 0 (MME-CALL-ARGS slot=0 data=), and the final emitted window gets MME-EXEC-CALL slot=0 (the physical GR front-end executes the CALL; the kernel has no CALL interpreter, the 0x114 prelude uploads precede the window in the same launch). Guest harness: add tools/guest-diag/gz_es.c and an on-demand build in push_gl_tools.sh; GZ_EGL=1 switches gzdoom_pbuf_run.sh/mission-gz.sh to SDL offscreen + real NVIDIA EGL/GLES (default unchanged); push_gl_tools.sh creates the NVIDIA EGL vendor ICD only when missing. Receipts: c1025 GL-FLUSH admitted=1, DRAW-WRITE m=0x3800 op=4 data=0xd48, 3D mark admitted (CALL(0) 0x3800 draw marker), 3D stream chunked, 3D chunk launch draw=1, MME-CALL-ARGS slot=0 data=0xd48, MME-EXEC-CALL slot=0 op=4 imm=0xd48. Exact 0x402f9d8 post-fix replay still unverified (run wedged on an earlier draw window); stores/px remain open.
Diffstat (limited to 'tools/guest-diag/push_gl_tools.sh')
-rwxr-xr-xtools/guest-diag/push_gl_tools.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/tools/guest-diag/push_gl_tools.sh b/tools/guest-diag/push_gl_tools.sh
index 986d2d6..4ea5665 100755
--- a/tools/guest-diag/push_gl_tools.sh
+++ b/tools/guest-diag/push_gl_tools.sh
@@ -25,15 +25,30 @@ if [ "${1:-}" = "--dry-run" ]; then
shift
fi
+# gz_es.so is small and its source is tracked; build it on demand (host gcc,
+# same libc family as the guest) so the GZ_EGL=1 path works from a fresh
+# checkout. The other shims stay prebuilt in build/.
+if [ ! -f "$BUILD/gz_es.so" ] && [ "$DRY_RUN" != "1" ]; then
+ mkdir -p "$BUILD"
+ if gcc -shared -fPIC -O2 -o "$BUILD/gz_es.so" "$HERE/gz_es.c" \
+ -lEGL -lGLESv2 -ldl; then
+ echo "BUILD $BUILD/gz_es.so"
+ else
+ echo "BUILD-FAIL gz_es.so (EGL/GLESv2 dev headers needed)" >&2
+ fi
+fi
+
FIXED=(
"$BUILD/gl_frames"
"$BUILD/gz_pbuf.so"
+ "$BUILD/gz_es.so"
"$BUILD/sdl_cap.so"
"$BUILD/test_tri"
"$HERE/guest_mode.sh"
"$HERE/gzf2_video.py"
"$HERE/gzdoom_pbuf_run.sh"
"$HERE/mission-gz.sh"
+ "$HERE/10_nvidia.json"
)
if [ "$#" -gt 0 ]; then
@@ -72,4 +87,21 @@ for f in "${FILES[@]}"; do
fi
push_b64 "$f" "$DEST_DIR/$(basename "$f")" || rc=1
done
+
+# The EGL offscreen path (GZ_EGL=1) needs the NVIDIA EGL vendor ICD; some
+# guest images lack it. Create it only when missing (never overwrite the
+# driver's own file).
+EGL_JSON=/usr/share/glvnd/egl_vendor.d/10_nvidia.json
+if [ "$DRY_RUN" = "1" ]; then
+ echo "PUSH-DRY $EGL_JSON (if missing)"
+elif sudo "$VMEXEC" exec --timeout 30 "test -f $EGL_JSON" >/dev/null 2>&1; then
+ echo "PUSH-SKIP existing $EGL_JSON"
+elif sudo "$VMEXEC" exec --timeout 30 \
+ "mkdir -p /usr/share/glvnd/egl_vendor.d && cp '$DEST_DIR/10_nvidia.json' '$EGL_JSON'" \
+ >/dev/null 2>&1; then
+ echo "PUSHED $EGL_JSON"
+else
+ echo "PUSH-FAIL $EGL_JSON" >&2
+ rc=1
+fi
exit "$rc"