Mike97
Mike97

Reputation: 605

GPU info through Metal framenwork's registryID instance property

I'm searching for GPU information through the IO matching "IOPCIDevice" and should be nice to have info about Metal, i.e if is supported or not (I still support some years old MacPro). I see that Metal 2 has a new property called registryID and I've tried to match the IOIteratorNext, but it didn't. The code I use is just the same described here by @rsharma (credits goes to @trojanfoe) with little modifications. So my question is: how can I use registryID to ensure is the same graphics card?

P.S. I already have an array of i/GPU that support Metal using MTLCopyAllDevices.

Upvotes: 2

Views: 474

Answers (1)

Ken Thomases
Ken Thomases

Reputation: 90521

Given a registry entry ID, you can use IORegistryEntryIDMatching() to create a matching dictionary. You would then pass that to IOServiceGetMatchingService() (on the assumption that there's only one) or IOServiceGetMatchingServices() to retrieve the object.

Upvotes: 2

Related Questions