apiVersion: v1
kind: ConfigMap
metadata:
  name: matrix-mult-entrypoint
  namespace: default
data:
  entrypoint.sh: |-
    #!/bin/bash

    NUM_GPUS=$(nvidia-smi -L | wc -l)
    if [ $NUM_GPUS -eq 0 ]; then
      echo "ERROR: No GPUs found"
      exit 1
    fi

    echo "Running on ${NUM_GPUS} GPUs:"
    nvidia-smi -L
    echo ""
    time matrix-mult $MATRIX_MULT_TIME
