omega-dnn
aien-dev/omega-dnn
Brought by drakestapleton
omega-dnn / evidence / STACK7-GPU-20261026 / gpu-bench / gpu_run.sh
| 1 | #!/bin/sh |
| 2 | # gpu_run.sh LABEL CMD...: BOARD start line, flock around CMD only, BOARD end line, compute-apps check. |
| 3 | # Output of CMD goes to stdout; summary line to stderr. |
| 4 | B=/home/drakestapleton/handoffs/BOARD.md |
| 5 | label=$1; shift |
| 6 | echo "$(date -u +%FT%TZ) OmegaDnn.GpuDnn: START $label 0 running (lock /tmp/aien-gb10.lock, driver 580.173.02)" >> $B |
| 7 | t0=$(date +%s) |
| 8 | flock -w 900 /tmp/aien-gb10.lock /tmp/OmegaDnn/gpu/bench/held.sh "$@" 2>/tmp/OmegaDnn/gpu/.held.$$; rc=$? |
| 9 | cat /tmp/OmegaDnn/gpu/.held.$$ >&2 |
| 10 | held=$(grep '^LOCK_HELD_S' /tmp/OmegaDnn/gpu/.held.$$ | tail -1 | cut -d' ' -f2); rm -f /tmp/OmegaDnn/gpu/.held.$$ |
| 11 | apps=$(nvidia-smi --query-compute-apps=pid --format=csv,noheader) |
| 12 | napps=$(printf '%s' "$apps" | grep -c .) |
| 13 | echo "$(date -u +%FT%TZ) OmegaDnn.GpuDnn: END $label lock_held_s=$held rc=$rc compute_apps_rows=$napps" >> $B |
| 14 | echo "GPU_RUN $label rc=$rc lock_held_s=$held compute_apps_rows=$napps apps=[$apps] date=$(date -u +%FT%TZ) load=$(cut -d' ' -f1-3 /proc/loadavg)" >&2 |
| 15 | exit $rc |