How to disable the message:
Select your scheme at the top of the window. Click Edit Scheme
in the drop-down, go to Diagnostics
and untick the Metal API Validation
checkbox.
Is Metal being used in my app?
Yes, even if your code isn't interacting directly with the GPU, many high-level frameworks do -- specifically Core Image
, SpriteKit
, and SceneKit
. For example, I narrowed the pesky "Metal API Validation Enabled" message in my app down to this line:
layer.backgroundColor = NSColor(patternImage: image).cgColor
Should I disable Metal API validation?
Enabling validation makes every Metal API call be checked, which causes a "small, but measurable, impact on CPU performance." The purpose of this validation is to
check for code that calls the Metal API incorrectly, including errors in resource creation, encoding Metal commands, and other common tasks.
There's a very low chance that Apple frameworks like Core Image are using the Metal API incorrectly, so if your app only uses those high-level Apple frameworks, then I'd say you should feel safe to disable API validation. Getting rid of that damn output message is worth the risk.