Post not yet marked as solved
Post marked as unsolved with 4 replies, 1,900 views
I'm trying to run sample code for MPS graph, which I got here: https://developer.apple.com/documentation/metalperformanceshadersgraph/adding_custom_functions_to_a_shader_graph
And it's not working. Builds successfully, but after you press train (play button), program fails right after first training iteration with errors like these:
-[MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion `MTLResource 0x600001693940 (label: (null)), referenced in cmd buffer 0x124015800 (label: (null)) is in volatile or empty purgeable state at commit'
-[MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion `MTLResource 0x600001693940 (label: (null)), referenced in cmd buffer 0x124015800 (label: (null)) is in volatile or empty purgeable state at commit'
It is failing on commandBuffer.commit() in runTrainingIterationBatch() method.
Its like something already committed operation (I've checked and yeah, command buffer is already commited). But why such thing in EXAMPLE CODE?
I've tried to wrap commit operation with command buffer status check and it is helping to not fail, but program works wrong overall and not calculating loss well.
Everything is getting worse because documentation for MPS Graph is empty! It's contains only class and method names without any description D;
My env:
Xcode 13.4.1 (13F100)
macOS 12.4
MacBook Pro (m1 pro) 14' 2021 16gb
Tried to build on iPhone 12 Pro Max / iOS 15.5 and to Mac catalyst application. Got same error everywhere