~dricottone/my-utils

ref: ef6d4cd1b378cc0ebbcb6e1460b3909f0cdd71b6 my-utils/hardware/gpu-ls -rwxr-xr-x 269 bytes
ef6d4cd1Dominic Ricottone Incomplete work on hardware/media utils 4 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
#!/bin/sh

header="Name:GPU:Memory
"
table="$(nvidia-smi --query-gpu name,utilization.gpu,utilization.memory --format=csv \
  | sed 's/ %/%/g' \
  | awk 'BEGIN{FS=", "; OFS=":"} {if(NR>1) print $1,$2,$3}')"

cat <<<"${header}${table}" | column --separator=":" --table