omega-gpu-driver
aien-dev/omega-gpu-driver
Brought by drakestapleton
omega-gpu-driver / tests / uvm_diff.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | # Build the UVM host trace with the pinned omc and check it against an |
| 4 | # independent Python walk. The checker never calls the Omega binary. |
| 5 | set -eu |
| 6 | here=$(CDPATH= cd -- "$(dirname "$0")" && pwd) |
| 7 | repo=$(CDPATH= cd -- "$here/.." && pwd) |
| 8 | omc=/home/drakestapleton/work/cudastack/omega-mv/seed/out/omc |
| 9 | pin=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f |
| 10 | got=$(sha256sum "$omc" | cut -c1-64) |
| 11 | if [ "$got" != "$pin" ]; then |
| 12 | echo "uvm_diff: omc pin mismatch" >&2 |
| 13 | exit 1 |
| 14 | fi |
| 15 | fmt=${FMT_OM:-$repo/uvm/fmt.om} |
| 16 | pt=${PT_OM:-$repo/uvm/pt.om} |
| 17 | fault=${FAULT_OM:-$repo/uvm/fault.om} |
| 18 | trace=${TRACE_OM:-$repo/tests/uvm_trace.om} |
| 19 | tmp=$(mktemp -d) |
| 20 | trap 'rm -rf "$tmp"' EXIT |
| 21 | cat "$fmt" "$pt" "$fault" "$trace" | taskset -c 10-14 nice -n 10 "$omc" > "$tmp/uvm.bin" 2>"$tmp/compile.log" || { |
| 22 | echo "uvm_diff: compile failed" >&2 |
| 23 | cat "$tmp/compile.log" >&2 |
| 24 | exit 1 |
| 25 | } |
| 26 | chmod +x "$tmp/uvm.bin" |
| 27 | taskset -c 10-14 nice -n 10 "$tmp/uvm.bin" > "$tmp/trace.txt" |
| 28 | python3 "$here/uvm_check.py" "$tmp/trace.txt" |