first commit
This commit is contained in:
19
scripts/gpu.sh
Executable file
19
scripts/gpu.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
print_gpu_usage() {
|
||||
function getGPUUsage() {
|
||||
gpuUsage=$(nvidia-smi -q -d UTILIZATION | grep Gpu | awk '{print $3}')
|
||||
}
|
||||
getGPUUsage
|
||||
if [ -z "$GpuUsage" ]; then
|
||||
echo "$gpuUsage%"
|
||||
else
|
||||
echo "-"
|
||||
fi
|
||||
}
|
||||
|
||||
main() {
|
||||
print_gpu_usage
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user