kubectl top nodes command gives only CPU and Memory usage, how to get GPU usage information in Kubernetes cluster?

6/5/2018

I'm using Kubernetes 1.7 and I have a GPU machine in the cluster. The kubectl top nodes gives only CPU and Memory usage like this

NAME       CPU(cores)   CPU%      MEMORY(bytes)   MEMORY%
machine1   183m         1%        5284Mi          8%
machine2   181m         1%        5543Mi          8%
machine3   250m         1%        7682Mi          7%
machine4   328m         5%        1578Mi          16%

Is there a way to get GPU usage?

-- Abu Shoeb
gpu
kubectl
kubernetes
linux
shell

1 Answer

6/6/2018

I'm afraid that kubectl top does not provide GPU metrics, regardless if drivers are installed or not.

To inspect GPU statistics, I recommend using Heapster monitoring tool and Prometheus that provides the extension to get the accelerator metrics.

At last, you may be interested in Nvidia GPU works for Kubernetes and GCE concepts of using this kind of hardware.

-- d0bry
Source: StackOverflow