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?

Post not yet marked as solved Up vote post of mattbierner Down vote post of mattbierner
2.1k views

Replies

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

  • There were improvements in the debugging tools made in macOS 13.3 / iOS 16.4 / Xcode 14.3 around this area.

Add a Comment

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.

  • Please see if this is still an issue in macOS 14 / iOS 17. There were more fixes regarding this error.

  • This was on macOS Version 14.0 Beta (23A5301h) with an iPhone running 17.0.3. What OS fixes this issue?

Add a Comment

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.

  • HI. Please see if the "Capture button" is still disabled on with Xcode 15.3 / macOS 14.4 / iOS 17.4. If you see a crash please use the Report button and mention the Feedback Assistant report ID here. Thanks.

Add a Comment

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

Add a Comment

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