first commit

This commit is contained in:
Daniel Bauer
2020-04-01 11:45:24 +02:00
commit 1872ef616f
5 changed files with 295 additions and 0 deletions

19
scripts/gpu.sh Executable file
View 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