Reputation: 1644
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.
Upvotes: 12
Views: 15413
Reputation: 8118
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
Upvotes: 19