macOS get GPU history (usage) from terminal

Viewed 2256

In recent versions of Activity Monitor, one can press CMD+4 and get a graphical representation of GPU usage. However, I want to obtain this info from my native macOS app and therefore I'm searching for a way to get this data (shown in Activity Monitor) from macOS command line.

Activity Monitor GPU History Info on macOS

1 Answers

You can obtain information about the GPU usage using the built-in powermetrics command e.g to obtain one snapshot (-n1) over 0.5 sec (-i500 ms) of the GPU info (--samplers gpu_power):

sudo powermetrics --samplers gpu_power -i500 -n1

Note: You can check which samplers powermetrics supports by typing:

powermetrics -h
Related