Can't capture metal GPU workload — Capturing MTLPipelineLibrary is not supported.

I'm trying to debug my metal shaders in Xcode 14.2. However clicking "Capture metal GPU" while debugging recently started showing the following error:

Capturing MTLPipelineLibrary is not supported.

Unsupported method: -[MTLDevice newPipelineLibraryWithFilePath:error:]

To enable capturing, disable calls to unsupported APIs and relaunch your application.

I can't find any info about MTLPipelineLibrary or how to disable it. I've also confirmed that Metal GPU Frame Capture is enabled in my build

What's causing this issue and how can I work around it so I can debug my shaders again?

Hi, please file a bug report for this if you haven't already. It looks like this is caused by your app using one of Apple's frameworks that is using this private API. Do you know which frameworks you are linking? I'm not sure if there is a workaround currently, hopefully another engineer can provide one if it exists.

Thanks. I've opened FB12077893

For graphics, my app is using Scenekit, ARKit, MetalKit, MetalPerformanceShaders. As far as I know, we don't intentionally try to access any internal API

Is there a way to figure out which framework is making this call? I tried adding a symbol breakpoint for the newPipelineLibraryWithFilePath function but it never gets hit

I'm not sure which framework it is, but I don't think it's SceneKit or ARKit. I know that QuartzCore/CoreAnimation uses this API, so perhaps you are indirectly linking that framework in as well.

As a possible workaround, you could try the MTLCaptureManager API to programmatically capture your specific command buffer instead of everything for that frame.

Some combination of updating to Xcode 14.3 and rebuilding my project (along with updating all packages) seems to have resolved this issue for me. It's still unclear how the reference to newPipelineLibraryWithFilePath was introduced or if it was simply a false positive

I still intermittently experience this issue when debugging Metal in Xcode 15 beta 7. Haven't figured out yet what makes it appear sometimes and other times not.

Heya all. As a heads up, this is occurring for me in my Xcode project as well:

  • XCODE VERSION: Xcode 15.0
  • OS VERSION: macOS 14.2
  • DEPLOYMENT TARGETING: macOS 14.0

The exact error is:

Error Domain=MTLCaptureError Code=1 "Unsupported API usage." UserInfo={NSLocalizedDescription=Unsupported API usage., NSLocalizedFailureReason=Metal Shader Validation API is not yet supported on this platform.}

I'm in Xcode 15.2 and the Metal Debugger is still very inconsistent. It'll work once or twice or sometimes even more, but then eventually it will actually cause Xcode to crash, the "Capture" button gets disabled and won't re-enable until re-booting the computer. Is there a background process that is failing that's causing "Capture" to being disabled? Is there a way I can reset the state of the Metal Debugger so that it works again without having to fully restart my machine? This is a real hindrance to our development process as our app makes extensive usage of Metal.

We've seen this too, we suspect it originates from SwiftUI, presumably the GraphicsContext API.

@mattbierner Any chance you were using a Lightning cable when experiencing the Metal capture failures?

Can't capture metal GPU workload — Capturing MTLPipelineLibrary is not supported.
 
 
Q