Files
nvdriver/tools/validate_all.sh
Scottcjn 37a6e160ae tools: run the GP106 oracle areas from validate_all.sh
The 19 areas of tools/gp106/check.sh, which hold all 26 GP106 opt-in
(#[ignore]) comparisons against the 580.178.04 instructions, were run by
nothing: not by validate_all.sh, not by the Makefile. They only ran when
someone typed the loop from reports/gp106-core-validation.md, and that
loop left out pte-policy.

check.sh gains an `all` area that runs every area in order and stops at
the first failure. validate_all.sh runs it as the optional step
gp106_oracles, next to gsp_620_headers. Missing prerequisites follow the
existing optional-step rule (exit 2 is SKIP, as in test_native_compute.sh
and oracle_gsp_620.py): `all` exits 2 before running anything when the
interpreter cannot import Unicorn and pyelftools, or when
resolve_580_binary() finds no original object. A present object with the
wrong digest, a generator error or a Rust mismatch is still FAIL. The
interpreter default is the top-level Makefile's REA_PYTHON default.

The report now documents `check.sh all` in place of the hand-written
loop. The step count in AGENTS.md, CLAUDE.md and docs/GPU_BRINGUP_GUIDE.md
is set to 36, the number of PASS/FAIL/SKIP lines validate_all.sh prints
with this step; those files said 31, 30 and 31 while the script already
printed 35.

Tests: tests/gp106/test_check_all.py covers both exit-2 paths and the
usage line with stand-in interpreters; tests/vm/test_validate_guest_steps.py
covers PASS, SKIP and FAIL of the new step. All six fail on master.

No driver logic changes. On this host `check.sh all` passes all 19 areas
(90 Rust tests, 0 failed) in about 4 minutes cold, 3 minutes warm; BAR2
and the two framebuffer generators are most of it.
2026-12-03 11:24:34 -06:00

91 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
# The handoff's full validation list. Prints one PASS/FAIL/SKIP line per step; logs go
# to target/validate-logs/. Exit status is nonzero if any step failed.
# Pass --offline (or NV_RS_SKIP_LIVE=1) to skip the host-kernel `run_live_control.py` step.
cd "$(dirname "$0")/.." || exit 2
export PATH="$HOME/.cargo/bin:$PATH"
SKIP_LIVE=${NV_RS_SKIP_LIVE:-0}
for arg in "$@"; do
case "$arg" in
--offline) SKIP_LIVE=1 ;;
-h|--help)
echo "usage: $0 [--offline]"
exit 0
;;
*)
echo "unknown option: $arg" >&2
exit 2
;;
esac
done
LOGS=target/validate-logs; mkdir -p "$LOGS"; rc=0
step() {
local name=$1
shift
if "$@" >"$LOGS/$name.log" 2>&1; then
echo "PASS $name"
else
echo "FAIL $name (see $LOGS/$name.log)"
rc=1
return 1
fi
}
optional_step() {
local n=$1
shift
if "$@" >"$LOGS/$n.log" 2>&1; then
echo "PASS $n"
elif [ "$?" -eq 2 ]; then
echo "SKIP $n (see $LOGS/$n.log)"
else
echo "FAIL $n (see $LOGS/$n.log)"
rc=1
fi
}
step fmt cargo fmt --all -- --check
step clippy cargo clippy --workspace --all-targets -- -D warnings
step test cargo test --workspace
for t in device_software software_manager timeout_runtime pf_software dma_bridge clock_store file_cleanup gpu_arch_codegen gpu_registry pci_bridge registry_bridge rom_capture_bridge system_memory_bridge thread_state_bridge wpr_shadow_owner; do step test_$t sh tools/test_$t.sh; done
optional_step test_native_compute sh tools/test_native_compute.sh
step test_kernel_module_gate python3 tests/kernel-module-gate/test_gate_cases.py
step test_symbol_conformance python3 tests/kernel-module-gate/test_symbol_conformance.py
step test_kernel_archive python3 tests/kernel-module-gate/test_kernel_archive.py
step test_first_open_verdict python3 tests/first-open-verdict/test_runner.py
for t in gpu_firmware_owner lsf_image_owner; do step test_$t bash tools/test_$t.sh; done
step modules make modules
step audit make -C src/nvidia audit-codegen
step native_codegen python3 tools/check_native_codegen.py
optional_step gsp_620_headers python3 tools/oracle_gsp_620.py
optional_step gp106_oracles bash tools/gp106/check.sh all
guest_skip() {
local name=$1 reason=$2
echo "$reason" >"$LOGS/$name.log"
echo "SKIP $name ($reason)"
}
if ! step guest_build sh tools/vm/build_guest_test.sh; then
guest_skip initramfs "guest build failed"
guest_skip guest "guest build failed"
guest_skip guest_iommu "guest build failed"
elif ! step initramfs sh tools/vm/build_initramfs.sh; then
guest_skip guest "initramfs build failed"
guest_skip guest_iommu "initramfs build failed"
else
step guest python3 tools/vm/run_guest.py
step guest_iommu python3 tools/vm/run_guest.py --iommu
fi
step result_gate python3 tests/vm/test_result_gate.py
# The live step runs target/compat32-rust-driver; build it on a fresh tree (a failure shows up as FAIL live).
if [ "$SKIP_LIVE" = "1" ]; then
echo "SKIP live (--offline / NV_RS_SKIP_LIVE=1)"
else
[ -x target/compat32-rust-driver ] || python3 tools/build_compat32_probe.py --node /dev/nvidia-rsctl --out target/compat32-rust-driver >"$LOGS/compat32_build.log" 2>&1
step live sudo -n python3 tools/run_live_control.py
fi
grep -h "test result" "$LOGS/test.log" | awk '{p+=$4; f+=$6} END{print "tests passed",p,"failed",f}'
MODINFO=$(command -v modinfo 2>/dev/null || ([ -x /sbin/modinfo ] && echo /sbin/modinfo) || ([ -x /usr/sbin/modinfo ] && echo /usr/sbin/modinfo) || true)
if [ -n "$MODINFO" ]; then
"$MODINFO" -F vermagic kernel-open/nvidia_rs.ko
fi
sha256sum kernel-open/nvidia_rs.ko target/vm-module/nv_rs_edu_test.ko
exit $rc