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 / build.sh

34 lines · 1307 bytes Raw Blame History
1#!/bin/sh
2# build.sh -- birth the pinned omc (tools/getomc.sh) and compile w0.om into build/w0 and the firmware
3# input tool (gsp/sha2.om gsp/inflate.om gsp/fw.om gsp/bindata.om fwprep.om) into build/fwprep.
4# With OGKM=<open-gpu-kernel-modules-580.173.02 checkout>, it then runs build/fwprep on the installed
5# GSP firmware into build/fw (checked by window/d2-pre.sh against build/fw/fw.manifest).
6# A failed step leaves no output behind.
7set -eu
8R=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
9cd "$R"
10sh tools/getomc.sh
11# compile OUT SRC... : concatenate the units and compile them into build/OUT
12compile() {
13 out=build/$1; shift
14 rm -f "$out" "$out.tmp"
15 if ! cat "$@" | build/omc > "$out.tmp"; then rm -f "$out.tmp"; exit 1; fi
16 chmod +x "$out.tmp"
17 mv "$out.tmp" "$out"
18 echo "$out"
19}
20compile w0 w0.om
21compile fwprep gsp/sha2.om gsp/inflate.om gsp/fw.om gsp/bindata.om fwprep.om
22sh tools/buildogd.sh
23FW=${FW:-/lib/firmware/nvidia/580.173.02/gsp_ga10x.bin}
24if [ -n "${OGKM:-}" ]; then
25 rm -rf build/fw build/fw.tmp
26 mkdir build/fw.tmp
27 if ! build/fwprep "$FW" "$OGKM" build/fw.tmp > build/fwprep.log; then
28 rm -rf build/fw.tmp; cat build/fwprep.log >&2; exit 1
29 fi
30 mv build/fw.tmp build/fw
31 echo build/fw
32else
33 echo "build/fw not built: set OGKM to an open-gpu-kernel-modules 580.173.02 checkout" >&2
34fi