mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
- Updated tools/post_reboot.sh to check kernel oops taint bit and stuck driver tasks instead of <86400s uptime - Level 7 hardware regression passed on 0000:b3:00.0 (module 37e6fa430835eee2b426019db3ad70eeb7a9e9070c09c84bd9b973cf56cbe529, 107 inventory words, 0 static mismatches, CUDA baseline verified before and after) - Updated .gitignore to exclude build archives (*.a, *.rlib), __pycache__, and raw trace dumps
35 lines
1.6 KiB
Python
35 lines
1.6 KiB
Python
#!/usr/bin/env python3
|
|
"""Generate src/nvidia/src/rmapi/providers/class_db_gv100.rs.
|
|
|
|
Source: the "descriptors" line of target/rmapi/original-rmapi-gpu.txt (case gpu-slice3b),
|
|
which tools/check_rmapi_binary.py reads out of the GPU object after the original's own
|
|
attach: the class descriptor list its engine-table constructor built for a GV100 (GPU+0xd90,
|
|
count GPU+0xd98; public gpuConstructEngineTable: generic classes, the chip's engine-less
|
|
classes, then the chip's class-to-engine list). `--check` verifies the checked-in file.
|
|
"""
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
RECORD = ROOT / "target/rmapi/original-rmapi-gpu.txt"
|
|
TARGET = ROOT / "src/nvidia/src/rmapi/providers/class_db_gv100.rs"
|
|
|
|
line = next(line for line in RECORD.read_text().splitlines() if line.startswith("descriptors "))
|
|
records = [tuple(int(part, 16) for part in field.split(":")) for field in line.split()[1:]]
|
|
lines = [
|
|
"//! Class descriptor list of a GV100: (external class, engine descriptor) in the order of",
|
|
"//! the original's engine-table constructor (GPU+0xd90 after `gpumgrAttachGpu`).",
|
|
"//! Generated by tools/generate_rmapi_class_db.py from the oracle record; do not edit.",
|
|
"",
|
|
"#[rustfmt::skip]",
|
|
f"pub static DESCRIPTORS: [(u32, u32); {len(records)}] = [",
|
|
]
|
|
lines += [f" ({klass:#x}, {engine:#x})," for klass, engine in records]
|
|
lines += ["];", ""]
|
|
text = "\n".join(lines)
|
|
if "--check" in sys.argv:
|
|
assert TARGET.read_text() == text, "class descriptor table differs from the oracle record"
|
|
else:
|
|
TARGET.write_text(text)
|
|
print(f"{len(records)} class descriptors")
|