interplane.Get Omega
Read in your language

omega-gpu-driver

aien-dev/omega-gpu-driver

Brought by drakestapleton

branch main Branches Tags History

omega-gpu-driver / tests / uvm_diff.sh

28 lines · 1064 bytes Raw Blame History
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.
5set -eu
6here=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
7repo=$(CDPATH= cd -- "$here/.." && pwd)
8omc=/home/drakestapleton/work/cudastack/omega-mv/seed/out/omc
9pin=2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f
10got=$(sha256sum "$omc" | cut -c1-64)
11if [ "$got" != "$pin" ]; then
12 echo "uvm_diff: omc pin mismatch" >&2
13 exit 1
14fi
15fmt=${FMT_OM:-$repo/uvm/fmt.om}
16pt=${PT_OM:-$repo/uvm/pt.om}
17fault=${FAULT_OM:-$repo/uvm/fault.om}
18trace=${TRACE_OM:-$repo/tests/uvm_trace.om}
19tmp=$(mktemp -d)
20trap 'rm -rf "$tmp"' EXIT
21cat "$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}
26chmod +x "$tmp/uvm.bin"
27taskset -c 10-14 nice -n 10 "$tmp/uvm.bin" > "$tmp/trace.txt"
28python3 "$here/uvm_check.py" "$tmp/trace.txt"