Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

blueshogun96

macrumors regular
Original poster
Nov 24, 2012
112
3
Okay, so one of the recent additions I added to my game engine was built in GPU monitoring for Windows. While not a critical feature, it is something I would like to add for macOS. The goal is to implement something similar to NVPerfHUD (for those who remember what that is) and show the dev how much of the GPU is currently being utilized. Essentially, I'm looking for similar functionality that GPU-Z has for Windows.

I'm sure this is possible since XCode does seem to have some GPU monitoring instruments, therefore it has to hook into an API of some sort. For Windows and Linux, I can just use NVAPI for the NVIDIA cards, and D3DKMT for Intel (also Windows). There's another library for AMD which has similar APIs but I haven't looked into it as of yet. I don't know what to do for Mac.

Any ideas? Thanks.

Shogun

EDIT: I found this link on stack overflow, but it only works for non-discreet GPUs it says: http://stackoverflow.com/questions/10110658/programmatically-get-gpu-percent-usage-in-os-x
 
Last edited:
I use the IORegistry stats in UE4 and they do exist for all GPU vendors. Which stats are available does depend on the OS version and GPU model but core utilisation should be available on all of them for recent (10.11+) versions of macOS.
 
I use the IORegistry stats in UE4 and they do exist for all GPU vendors. Which stats are available does depend on the OS version and GPU model but core utilisation should be available on all of them for recent (10.11+) versions of macOS.
As much as I hate the thought of borrowing code from a commercial engine, I might have to make one exception.

Part of the reason I wrote this engine is to get revenge on Epic (nothing personal, but still a long story that ended up costing me $75 to fix my then broken iPhone). The other reason was (at the time) to have a completely open source engine using open source components to make it portable to any platform desirable. And Ironically, someone already compared my engine to UE4.

Thanks for the insight either way. Much appreciated.

Shogun
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.