interplane.Get Omega
Read in your language

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

branch main Branches Tags History

CUDApp / evidence / DECODE-KERNELS-20261027T0612Z / tools / hold.sh

22 lines · 1543 bytes Raw Blame History
1#!/usr/bin/env bash
2# DecodeKernels chip hold (Train/PROTOCOL.md rules 1-8): flock -w 900, <=15 min, 18091 /health before/after,
3# BOARD GPU-START/END, compute apps logged at start and end (must be 79557 only). Usage: hold.sh LABEL LOGDIR CMD...
4set -u
5label=$1; logdir=$2; shift 2
6mkdir -p "$logdir"
7B=/home/drakestapleton/handoffs/BOARD.md
8ts() { date -u +%FT%TZ; }
9exec 9>/tmp/aien-gb10.lock
10if ! flock -w 900 9; then echo "$(ts) DecodeKernels: NOT_RUN $label (lock not free in 900 s)" >> $B; exit 75; fi
11{ echo "head $(git -C "$PWD" rev-parse HEAD 2>/dev/null) dirty=$(git -C "$PWD" status --short 2>/dev/null | wc -l)"; echo "cwd $PWD"; echo "cmd $*"; } > "$logdir/hold.meta"
12curl -s -m 5 127.0.0.1:18091/health > "$logdir/health-before.json"; echo >> "$logdir/health-before.json"
13nvidia-smi --query-compute-apps=pid,process_name --format=csv,noheader > "$logdir/apps-before.txt" 2>&1
14echo "$(ts) DecodeKernels: GPU-START $label (flock /tmp/aien-gb10.lock, <=15 min, beside live 35B; log $logdir)" >> $B
15timeout 840 "$@" > "$logdir/run.log" 2>&1; rc=$?
16curl -s -m 5 127.0.0.1:18091/health > "$logdir/health-after.json"; echo >> "$logdir/health-after.json"
17nvidia-smi --query-compute-apps=pid,process_name --format=csv,noheader > "$logdir/apps-after.txt" 2>&1
18apps=$(cut -d, -f1 "$logdir/apps-after.txt" | tr -d ' ' | paste -sd' ')
19st=$(grep -o '"status":"[a-z]*"' "$logdir/health-after.json" | head -1)
20echo "$(ts) DecodeKernels: GPU-END $label exit $rc; compute apps after: $apps ; 18091 $st" >> $B
21echo "rc=$rc apps=$apps $st"
22exit $rc