I am trying to get gpu utilization by nvidia-smi with command “nvidia-smi --query-gpu=utilization.gpu --format=csv” in ubuntu but it writes out that it is not supported. is there any alternative way to get gpu utilization? i am using Tesla k10 graphics card. NVIDIA Driver Version is 367.57
I found some script that does the same job alternatively.
gpulist=`nvidia-settings -t -q gpus`
gpulist=`echo "$gpulist" | sed -e 's/^ *//'` # no leading spaces
gpulist=`echo "$gpulist" | grep -e '^\['`
echo $gpulist | while read LINE; do
gpuid=`echo "$LINE" | cut -d \ -f 2 | grep -E -o '\[.*\]'`
gpuname=`echo "$LINE" | cut -d \ -f 3-`
gpuutilstats=`nvidia-settings -t -q "$gpuid"/GPUUtilization | tr ',' '\n'`
gpuutilstats=`nvidia-settings -t -q "$gpuid"/GPUUtilization | tr ',' '\n'`
gputemp=`nvidia-settings -t -q "$gpuid"/GPUCoreTemp`
gputotalmem=`nvidia-settings -t -q "$gpuid"/TotalDedicatedGPUMemory`
gpuusedmem=`nvidia-settings -t -q "$gpuid"/UsedDedicatedGPUMemory`
gpuusage=`echo "$gpuutilstats"|grep graphics|sed 's/[^0-9]//g'`
memoryusage=`echo "$gpuutilstats"|grep memory|sed 's/[^0-9]//g'`
bandwidthusage=`echo "$gpuutilstats"|grep PCIe|sed 's/[^0-9]//g'`
echo "$gpuid $gpuname"
echo -e "\tRunning at : $gpuusage%"
echo -e "\tCurrent temperature : $gputemp°C"
echo -e "\tMemory usage : $gpuusedmem MB/$gputotalmem MB"
echo -e "\tMemory bandwidth usage : $memoryusage%"
echo -e "\tPCIe bandwidth usage : $bandwidthusage%"
echo -e "\tGPU usage : $gpuutilstats%"
done