Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/tools/sm121dis/check_selftest.sh # CUDApp CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / tools / sm121dis / check_selftest.sh` 44 lines · 1944 bytes Raw Blame History 1 #!/bin/sh 2 # Host-only fixture: identical output cannot excuse a failed decoder process. 3 set -eu 4 HERE=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) 5 WORK=$(mktemp -d "${TMPDIR:-/tmp}/sm121dis-check-control.XXXXXX") 6 trap 'rm -rf "$WORK"' EXIT HUP INT TERM 7 mkdir "$WORK/kernels" 8 # The fixture decoders supply text, not real machine decoding or hardware evidence. 9 printf '\000' > "$WORK/kernels/a.bin" 10 printf '\000' > "$WORK/kernels/b.bin" 11 cat > "$WORK/oracle" <<'ORACLE' 12 #!/bin/sh 13 if [ "$1" = --version ]; then echo 'release 13.0, V13.0'; exit 0; fi 14 printf '/*0000*/ EXIT ; /* 0x0000000000000000 */\n/* 0x0000000000000000 */\n' 15 ORACLE 16 cat > "$WORK/decoder" <<'DECODER' 17 #!/bin/sh 18 printf '0000 `0000000000000000`\t0000000000000000 EXIT ;\n' 19 echo deliberate-decoder-diagnostic >&2 20 exit "${DECODER_RC:-0}" 21 DECODER 22 chmod +x "$WORK/oracle" "$WORK/decoder" 23 for jobs in 1 2; do 24 for decoder_rc in 0 7 127; do 25 rc=0 26 NVDISASM="$WORK/oracle" SM121DIS_JOBS=$jobs DECODER_RC=$decoder_rc \ 27 sh "$HERE/check.sh" "$WORK/decoder" "$WORK/kernels" "$WORK/results" > "$WORK/log" 2>&1 || rc=$? 28 if [ "$decoder_rc" -eq 0 ]; then 29 [ "$rc" -eq 0 ] && grep -qx 'VERDICT PASS' "$WORK/log" && 30 grep -qx 'kernels: 2, words: 2, failed kernels: 0' "$WORK/log" || { 31 cat "$WORK/log"; echo 'FAIL: successful decoder refused'; exit 1; 32 } 33 else 34 [ "$rc" -eq 1 ] && grep -qx 'VERDICT FAIL' "$WORK/log" && 35 grep -qx 'kernels: 2, words: 2, failed kernels: 2' "$WORK/log" && 36 grep -q "decoder exited $decoder_rc" "$WORK/log" && 37 grep -q 'deliberate-decoder-diagnostic' "$WORK/log" && 38 ! grep -q '^\[PASS\]' "$WORK/log" || { 39 cat "$WORK/log"; echo 'FAIL: nonzero decoder exit accepted or not diagnosed'; exit 1; 40 } 41 fi 42 done 43 done 44 echo 'PASS: decoder exit controls (serial and parallel)'