GPU and VRAM usage and load from terminal on Mac

My work computers are all Mac, and I work for a visual effects studio so the GPU usage / load during and after rendering footage is important information to know, I’m also interested in the VRAM usage / load for the same reason. However, because I want to incorporate this information into our pipeline here and as part of a utility management system that I am building, I need to get this information through the command-line so that it can be put into log files and a database system where it can then be accessed and displayed in a graph that is easy for artists to see.

Any ideas where to get started? I have found a couple GUI tools to get GPU usage / load data, but those don’t really help much unless I can get the information they are pulling through terminal, and I can’t seem to find any CLI tools available for Mac (way to go Apple…), if there is a way to get this through the kernel or Mac registry then let me know, I’m open to any language that I can get the information through, but note that the pipeline is being built mainly with Python due to it’s flexibility, so anything I develop to get the information will need to be able to pass it off to a Python script.

I’m open to developing kext’s or to developing a script to specifically get the information I need directly from the graphics card, and I’m not trying to change any settings on the graphics card at this point, just information gathering. I would also like to know how the usage / load data is calculated if any scripts are suggested that I take a look into (I’m a DIYer, I get it from my Dad).


Extra note: try not to take any of my bashing on Apple too seriously, I work with a bunch of Apple freaks who are always bashing on PC, so I usually joke around and say that I have to balance things out by bashing on Macs all the time, they are good machines, but my experience is they have just as many problems as Windows machines, they just have different kinds of problems.