Metal Device Architecture on macOS versions before Sonoma

Hello, The latest version of Metal (on macOS 14) seems to have the instance property for the Metal device architecture.

I was curious how this could be achieved on versions of macOS prior to 14 programatically?

xcrun metal-arch 

The above command provides exactly what I need.

I was thinking that I could use Metal and IOKit to grab the architecture, but I am lead to believe that there is some kind of mapping in the metal-arch tool and it may not be that easy.

Any help would be greatly appreciated.

Thanks.

Replies

MTLDevice instance should have access to architecture: https://developer.apple.com/documentation/metal/mtldevice/4195341-architecture

  • The question is asking specifically how to access the same value on macOS versions lower than 14 (Sonoma). If you check the link you've shared you'll see that it says the property is available from macOS 14.0 upwards.

Add a Comment