12 lines
355 B
Nu
12 lines
355 B
Nu
def rocm-monitor [cacheFile: string = "/tmp/rocm-monitor.jsonl", timeout: duration = 1sec] {
|
|
if ($cacheFile | path exists) {
|
|
rm $cacheFile
|
|
}
|
|
loop {
|
|
clear
|
|
rocm-smi --showmemuse --showuse --json | save --append $cacheFile
|
|
tail -n1 $cacheFile | from json --objects | flatten | print
|
|
sleep $timeout
|
|
}
|
|
}
|