Hi everyone,
I’m adding system information logging to my JUCE project, and I need to retrieve the info of the available GPUs on both macOS and Windows.
Is there a recommended way to get GPU information? I’m looking for something similar to juce::SystemStats methods, which are pretty straightforward. Does JUCE provide any built-in utilities for this, or would I need to use platform-specific APIs?
Any guidance would be appreciated.
Thank you!
There’s no standard way of doing this, not in JUCE or otherwise.
In this situation, because GPUs are greatly varied (onboard versus PCIe versus external, let alone all of the manufacturers and API variants), outlining what information you’re after would be helpful in narrowing down what you can try.
1 Like
Thank you very much for the reply!
I see the issue.. It would already be great to get the model names of all the available GPUs.
But of course I would need to get as many info as possible, since I’m collecting those info in a log file.
I’m not sure what this means: what information are you after specifically? Just the model or more?
Your options are:
- Use native APIs to list all graphics devices to gather the manufacturers and models.
- This is a lot of work to frame up in your code, especially cross-platform, and requires a lot of testing.
- You would need to research the APIs to know Intel UHD Graphics vs {proprietary Apple GPU} vs {Android GPU}.
- Consider using OpenGL where possible, and when it’s not possible leave the information blank.
- With OpenGL, the calls on the OpenGL thread look like this:
glGetString (GL_VENDOR)
glGetString (GL_VERSION)
- Feel free to copy from my SquarePine code here, as an example: squarepine_core/modules/squarepine_graphics/components/squarepine_HighPerformanceRendererConfigurator.cpp at 14bf564bfcbe5294f6835999f3bffdd660ed838d · SquarePine/squarepine_core · GitHub