interplane.Get Omega
Read in your language

cuda-crack

I broke CUDA: GB10 sm_121 machine code without the CUDA toolkit - method, encoder tables, receipts

Brought by drakestapleton

branch main Branches Tags History

cuda-crack / gen / run.sh

24 lines · 1354 bytes Raw Blame History
1#!/bin/sh
2# Regenerate isa/sm121-forms.txt from gen/bw_enc_sm121.om with the pinned seeded omc.
3# Usage: OMC=/path/to/omc gen/run.sh (run from the repository root)
4set -eu
5OMC=${OMC:?set OMC to the pinned omega-mv seed compiler}
6PIN=3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194
7ENC=fe16b024c3242d12c7c8ef759d84c34a22c7d21cba676cd987f4f3a1ff56ba86
8got=$(sha256sum "$OMC" | cut -d' ' -f1)
9[ "$got" = "$PIN" ] || { echo "omc sha256 $got is not the pin $PIN" >&2; exit 1; }
10enc=$(sha256sum gen/bw_enc_sm121.om | cut -d' ' -f1)
11[ "$enc" = "$ENC" ] || { echo "encoder sha256 $enc is not CUDApp b774723f's $ENC" >&2; exit 1; }
12tmp=$(mktemp -d)
13trap 'rm -rf "$tmp"' EXIT
14cat gen/bw_enc_sm121.om gen/isa.om | "$OMC" > "$tmp/isa-gen"
15chmod +x "$tmp/isa-gen"
16{
17 echo "# sm_121 (GB10) instruction forms, generated by gen/isa.om probing gen/bw_enc_sm121.om"
18 echo "# encoder: CUDApp rad:z4RxD8vXigmWg61nM8miQ8DVPAXEP @ b774723f om/encoder/bw_enc_sm121.om sha256 $ENC"
19 echo "# compiler: omega-mv seed omc sha256 $PIN"
20 echo "# F id op sel fix0 fix1 fix2 msk0 msk1 msk2 ctl | D id field m0 m1 m2 start width (see isa/README.md)"
21 "$tmp/isa-gen"
22} > "$tmp/forms.txt"
23mv "$tmp/forms.txt" isa/sm121-forms.txt
24echo "isa/sm121-forms.txt: $(grep -c '^F' isa/sm121-forms.txt) forms, sha256 $(sha256sum isa/sm121-forms.txt | cut -d' ' -f1)"