Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Metal: What is a "_status < MTLCommandBufferStatusCommitted" assertion failure?

I’m using Metal to execute a compute kernel, but I’m receiving the following error:

failed assertion _status < MTLCommandBufferStatusCommitted at line 316 in -[IOGPUMetalCommandBuffer setCurrentCommandEncoder:]

What does this mean?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I’m not sure you are supposed to see this assertion because it seems internal to OS, but anyway.

I think what the assertion is trying to say is that you can’t add a compute command encoder to a command buffer if the command buffer is committed, scheduled or completed. You can only create a command encoder from a command buffer that has NotEnqueued or Enqueued status.

The other problem I see here, is that you are not using the Metal API Validation. If you were, you would get a much more meaningful and actionable assertion. You could enable it in Xcode in scheme settings under "Metal API validation" or you can pass an environment variable if you are running your app from CLI or using some other means. More information about validation can be found in man MetalValidation in Terminal.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading