mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
fix(validation,tests,docs): live.log skip reason (#580), controls.tsv capture check (#579), Ampere/Turing parity docs (#578) (#582)
* fix(validation,tests,docs): record live.log skip reason (#580), verify controls.tsv (#579), update Ampere/Turing parity rows (#578) * docs(parity): attribute Turing live [O] results strictly to RTX 2060 (TU106) --------- Co-authored-by: morebrackets <19673572+morebrackets@users.noreply.github.com>
This commit is contained in:
@ -16,8 +16,8 @@ Comparison of all **43 discrete GPU chip tuples** in NVIDIA **580.178.04** (`src
|
||||
| **Maxwell 2** | `0x12` | GM200, GM204, GM206 (GTX 960–980 Ti, Titan X, Tesla M40/M60) | Pre-GSP | V1 | Supported | **HAL + Unicorn-verified offline** *(untested on physical silicon)* |
|
||||
| **Pascal** | `0x13` | GP100, GP102, GP104, GP106, GP107, GP108 (Tesla P100/P40/P4, GTX 1050–1080 Ti) | Pre-GSP | V2 | Supported | **HAL + Unicorn-verified offline** *(untested on physical silicon)* |
|
||||
| **Volta** | `0x14` | **GV100 (Tesla V100 PCIe / SXM2 16GB & 32GB, Quadro GV100, Titan V)** | Pre-GSP | V2 | Supported | **LIVE PHYSICAL SILICON VERIFIED (0-diff)** on 8× V100-SXM2-32GB |
|
||||
| **Turing** | `0x16` | TU102, TU104, TU106, TU116, TU117 (Tesla T4, RTX 2060–2080 Ti, GTX 1650–1660 Ti) | GSP-RM (`gsp_tu10x.bin`) | V2 | Supported | **GSP-RM loader + HALs wired & Unicorn-verified offline** *(untested on physical silicon)* |
|
||||
| **Ampere** | `0x17` | GA100 (`gsp_tu10x.bin`), GA102–GA107 (`gsp_ga10x.bin`) (A100, A10/A30/A40, RTX 3050–3090 Ti) | GSP-RM | V2 | Supported | **GSP-RM loader + HALs wired & Unicorn-verified offline** *(untested on physical silicon)* |
|
||||
| **Turing** | `0x16` | TU102, TU104, TU106, TU116, TU117 (Tesla T4, RTX 2060–2080 Ti, GTX 1650–1660 Ti) | GSP-RM (`gsp_tu10x.bin`) | V2 | Supported | **Community-reported `[O]` on RTX 2060 (TU106, [issue #436](https://github.com/nvdriver/nvdriver/issues/436))** — GSP-RM boot + `37/37` CUDA parity checks (`25/25` bit-identical digests vs stock); see the [README GPU Support Matrix](../README.md#gpu-support-matrix) for per-model status |
|
||||
| **Ampere** | `0x17` | GA100 (`gsp_tu10x.bin`), GA102–GA107 (`gsp_ga10x.bin`) (A100, A10/A30/A40, RTX A4500, RTX 3050–3090 Ti) | GSP-RM | V2 | Supported | **Community-reported `[O]` on RTX A4500 (`GA102GL`, [field report](FIELD-REPORT-rtx-a4500-ga102gl.md) / [issue #504](https://github.com/nvdriver/nvdriver/issues/504))** — GSP-RM boot/unload, `nvidia-smi`, `hwmon`, 4 MiB CUDA HtoD/DtoH round trip verified byte-for-byte, and `llama bench` throughput parity (plus RTX 3090 / 3080 Ti / 3050M reports); see the [README GPU Support Matrix](../README.md#gpu-support-matrix) for per-model status |
|
||||
| **Hopper** | `0x18` | GH100 (H100, H200) | GSP-RM (`gsp_ga10x.bin`) | V3 | Supported | **GSP-RM loader + MMU V3 + HALs wired & Unicorn-verified offline** *(untested on physical silicon)* |
|
||||
| **Ada Lovelace** | `0x19` | AD102–AD107 (L4, L40/L40S, RTX 4060–4090, RTX 6000 Ada) | GSP-RM (`gsp_ga10x.bin`) | V2 | Supported | **Community-reported `[O]` on RTX 4090 (AD102, [issue #236](https://github.com/nvdriver/nvdriver/issues/236) / [logs](https://github.com/nvdriver/nvdriver/issues/236#issuecomment-7347513418); not maintainer-verified)** — `nvidia-smi` + `37/37` CUDA parity checks (`25/25` bit-identical digests vs stock) with `ga10x_gsp=1`, manual prerequisite: Resizable BAR / BAR1 >= 512 MiB (`install.sh` does not configure this yet), and AD102 boot ucode extracted from the 580.x `open-gpu-kernel-modules` `kernel-open/nvidia/nv-kernel.o_binary` (not the proprietary `kernel/` object) |
|
||||
| **Blackwell 1** | `0x1a` | GB100, GB102, GB10B (B100, B200, GB200) | GSP-RM (`gsp_ga10x.bin`) | V3 | Supported | **GSP-RM loader + MMU V3 + HALs wired & Unicorn-verified offline** *(untested on physical silicon)* |
|
||||
|
||||
@ -11,6 +11,7 @@ import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from collections import Counter
|
||||
from contextlib import redirect_stderr, redirect_stdout
|
||||
from pathlib import Path
|
||||
|
||||
@ -20,6 +21,52 @@ sys.path.insert(0, str(ROOT / "tools" / "ioctl_capture"))
|
||||
import replay_diff # noqa: E402
|
||||
|
||||
|
||||
def _group_capture_controls(json_path: Path) -> Counter[tuple[int, int, int]]:
|
||||
data = json.loads(json_path.read_text(encoding="utf-8"))
|
||||
counts: Counter[tuple[int, int, int]] = Counter()
|
||||
for steps in data["workloads"].values():
|
||||
for step in steps:
|
||||
if step.get("kind") == "control":
|
||||
counts[(int(step["cmd"]), int(step["size"]), int(step["status"]))] += 1
|
||||
return counts
|
||||
|
||||
|
||||
def _diff_controls_tsv(json_path: Path, tsv_path: Path) -> list[str]:
|
||||
expected = _group_capture_controls(json_path)
|
||||
actual: dict[tuple[int, int, int], int] = {}
|
||||
mismatches: list[str] = []
|
||||
|
||||
for lineno, raw in enumerate(tsv_path.read_text(encoding="utf-8").splitlines(), start=1):
|
||||
line = raw.strip()
|
||||
if not line or line.startswith("#"):
|
||||
continue
|
||||
cols = line.split("\t")
|
||||
if len(cols) != 4:
|
||||
mismatches.append(f"line {lineno}: expected 4 tab-separated columns, got {len(cols)}: {raw!r}")
|
||||
continue
|
||||
cmd = int(cols[0], 0)
|
||||
size = int(cols[1], 0)
|
||||
status = int(cols[2], 0)
|
||||
count = int(cols[3], 0)
|
||||
key = (cmd, size, status)
|
||||
if key in actual:
|
||||
mismatches.append(
|
||||
f"duplicate row at line {lineno}: cmd=0x{cmd:x} size={size} status=0x{status:x}"
|
||||
)
|
||||
continue
|
||||
actual[key] = count
|
||||
|
||||
for key in sorted(set(expected) | set(actual)):
|
||||
exp_count = expected.get(key, 0)
|
||||
act_count = actual.get(key, 0)
|
||||
if exp_count != act_count:
|
||||
cmd, size, status = key
|
||||
mismatches.append(
|
||||
f"cmd=0x{cmd:x} size={size} status=0x{status:x}: expected count={exp_count}, actual count={act_count}"
|
||||
)
|
||||
return mismatches
|
||||
|
||||
|
||||
def _make_rm_control_record(dev: str, cmd: int, size: int, status: int) -> dict:
|
||||
# NVOS54_PARAMETERS: hClient(0), hObject(4), cmd(8), flags(12), params(16..24), paramsSize(24), status(28)
|
||||
buf = struct.pack("<IIIIQII", 1, 2, cmd, 0, 0, size, status)
|
||||
@ -198,6 +245,49 @@ int main(void) {
|
||||
subprocess.run([str(probe_bin)], env=env, check=True)
|
||||
self.assertFalse((root / "out.jsonl").exists())
|
||||
|
||||
def test_golden_controls_tsv_matches_stock_capture(self) -> None:
|
||||
capture = ROOT / "captures" / "golden" / "stock-620.73.04.json"
|
||||
tsv = ROOT / "captures" / "golden" / "controls.tsv"
|
||||
expected = _group_capture_controls(capture)
|
||||
self.assertGreater(len(expected), 0)
|
||||
mismatches = _diff_controls_tsv(capture, tsv)
|
||||
self.assertEqual(mismatches, [], "\n".join(mismatches))
|
||||
|
||||
def test_controls_tsv_detects_missing_or_altered_counts(self) -> None:
|
||||
capture = ROOT / "captures" / "golden" / "stock-620.73.04.json"
|
||||
tsv = ROOT / "captures" / "golden" / "controls.tsv"
|
||||
lines = tsv.read_text(encoding="utf-8").splitlines()
|
||||
first_data_idx = next(i for i, line in enumerate(lines) if line.strip() and not line.lstrip().startswith("#"))
|
||||
first_cols = lines[first_data_idx].split("\t")
|
||||
first_cmd = first_cols[0]
|
||||
|
||||
with tempfile.TemporaryDirectory() as td:
|
||||
root = Path(td)
|
||||
|
||||
# Dropping a row from controls.tsv must fail and identify the missing command.
|
||||
dropped = root / "dropped.tsv"
|
||||
dropped.write_text(
|
||||
"\n".join(lines[:first_data_idx] + lines[first_data_idx + 1 :]) + "\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
mismatches = _diff_controls_tsv(capture, dropped)
|
||||
self.assertEqual(len(mismatches), 1)
|
||||
self.assertIn(f"cmd={first_cmd}", mismatches[0])
|
||||
self.assertIn("actual count=0", mismatches[0])
|
||||
|
||||
# Changing a count by one must fail and report both expected and actual counts.
|
||||
altered = root / "altered.tsv"
|
||||
orig_count = int(first_cols[3], 0)
|
||||
altered_cols = [*first_cols[:3], str(orig_count + 1)]
|
||||
altered_lines = list(lines)
|
||||
altered_lines[first_data_idx] = "\t".join(altered_cols)
|
||||
altered.write_text("\n".join(altered_lines) + "\n", encoding="utf-8")
|
||||
mismatches = _diff_controls_tsv(capture, altered)
|
||||
self.assertEqual(len(mismatches), 1)
|
||||
self.assertIn(f"cmd={first_cmd}", mismatches[0])
|
||||
self.assertIn(f"expected count={orig_count}", mismatches[0])
|
||||
self.assertIn(f"actual count={orig_count + 1}", mismatches[0])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@ -38,12 +38,13 @@ sha256sum() { return 0; }
|
||||
|
||||
|
||||
class GuestStepTests(unittest.TestCase):
|
||||
def simulate(self, failed_step, extra_args=(), extra_env=None):
|
||||
work = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(work.cleanup)
|
||||
root = Path(work.name)
|
||||
def simulate(self, failed_step, extra_args=(), extra_env=None, root=None):
|
||||
if root is None:
|
||||
work = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(work.cleanup)
|
||||
root = Path(work.name)
|
||||
script = root / "tools/validate_all.sh"
|
||||
script.parent.mkdir()
|
||||
script.parent.mkdir(exist_ok=True)
|
||||
shutil.copyfile(SCRIPT, script)
|
||||
functions = root / "simulated_commands.sh"
|
||||
functions.write_text(STUBS, encoding="utf-8")
|
||||
@ -89,16 +90,45 @@ class GuestStepTests(unittest.TestCase):
|
||||
self.assertIn("PASS guest_iommu\n", result.stdout)
|
||||
|
||||
def test_offline_flag_skips_live_step(self):
|
||||
result, _ = self.simulate("", extra_args=("--offline",))
|
||||
result, root = self.simulate("", extra_args=("--offline",))
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertIn("SKIP live (--offline / NV_RS_SKIP_LIVE=1)\n", result.stdout)
|
||||
self.assertNotIn("PASS live\n", result.stdout)
|
||||
self.assertEqual(
|
||||
(root / "target/validate-logs/live.log").read_text(encoding="utf-8"),
|
||||
"--offline / NV_RS_SKIP_LIVE=1\n",
|
||||
)
|
||||
|
||||
def test_env_skip_live_skips_live_step(self):
|
||||
result, _ = self.simulate("", extra_env={"NV_RS_SKIP_LIVE": "1"})
|
||||
result, root = self.simulate("", extra_env={"NV_RS_SKIP_LIVE": "1"})
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertIn("SKIP live (--offline / NV_RS_SKIP_LIVE=1)\n", result.stdout)
|
||||
self.assertNotIn("PASS live\n", result.stdout)
|
||||
self.assertEqual(
|
||||
(root / "target/validate-logs/live.log").read_text(encoding="utf-8"),
|
||||
"--offline / NV_RS_SKIP_LIVE=1\n",
|
||||
)
|
||||
|
||||
def test_skip_live_overwrites_stale_live_log(self):
|
||||
for label, kwargs in (
|
||||
("--offline", {"extra_args": ("--offline",)}),
|
||||
("NV_RS_SKIP_LIVE=1", {"extra_env": {"NV_RS_SKIP_LIVE": "1"}}),
|
||||
):
|
||||
with self.subTest(mode=label):
|
||||
work = tempfile.TemporaryDirectory()
|
||||
self.addCleanup(work.cleanup)
|
||||
root = Path(work.name)
|
||||
live_log = root / "target/validate-logs/live.log"
|
||||
live_log.parent.mkdir(parents=True)
|
||||
live_log.write_text("old-live-marker\n", encoding="utf-8")
|
||||
|
||||
result, _ = self.simulate("", root=root, **kwargs)
|
||||
self.assertEqual(result.returncode, 0)
|
||||
self.assertIn("SKIP live (--offline / NV_RS_SKIP_LIVE=1)\n", result.stdout)
|
||||
self.assertEqual(
|
||||
live_log.read_text(encoding="utf-8"),
|
||||
"--offline / NV_RS_SKIP_LIVE=1\n",
|
||||
)
|
||||
|
||||
def test_default_runs_live_step(self):
|
||||
result, _ = self.simulate("")
|
||||
|
||||
@ -57,18 +57,18 @@ 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() {
|
||||
skip_step() {
|
||||
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"
|
||||
skip_step initramfs "guest build failed"
|
||||
skip_step guest "guest build failed"
|
||||
skip_step 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"
|
||||
skip_step guest "initramfs build failed"
|
||||
skip_step guest_iommu "initramfs build failed"
|
||||
else
|
||||
step guest python3 tools/vm/run_guest.py
|
||||
step guest_iommu python3 tools/vm/run_guest.py --iommu
|
||||
@ -76,7 +76,7 @@ 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)"
|
||||
skip_step 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
|
||||
|
||||
Reference in New Issue
Block a user