kIOGPUCommandBufferCallbackErrorBackgroundExecutionNotPermitted

When I use metal to render, the application switch to the background resulting in metal rendering failure in iOS 15 sys. How can I do? Error: Execution of the command buffer was aborted due to an error during execution.Insufficient Permission (to submit GPU work from background) (00000006:kIOGPUCommandBufferCallbackErrorBackgroundExecutionNotPermitted)

Replies

Can you clarify how you are hitting this error? Are you trying to render while your app is in the background? Or are you trying to render while your app is running in the foreground and you are hitting this error unexpectedly?

  • Yes, I try to render while my app is in the picture in picture (The app is in the background).

  • In iOS 14 system, I can do it in the picture in picture. but when I do something in iOS 15.0 system, the render output the error (kIOGPUCommandBufferCallbackErrorBackgroundExecutionNotPermitted), how can i do?

Add a Comment

I also received this log,After testing, it is found that it only appears on ios15 devices, It seems that the app(metal) will be active after switching to the background in iOS15 (It used to freeze in a few seconds).

  • yes, i don't know why. but AVSampleBufferDisplayLayer can render in the background, i am very curious about this.

Add a Comment

I got the same problem recently, on iOS 16. And it also occurred in the PIP use case.

I've sent the feedback with the id: FB11709596

I'll update here once I receive a reply.

  • They replied that it will be fixed for a future OS update

  • I cannot access the feedback link -- it's private (even with the trailing 6). Do you have any updates? Have they specified which OS update?

Add a Comment

Same problem with XCode 15 Betas (up to 5 15A5209g) and iPadOS 17 Betas (up to 21A5291h)

[update] My CDDisplayLink kept firing when Scene was inactive. Here is the workaround:

class SceneDelegate: UIResponder, UIWindowSceneDelegate { 
    func sceneDidBecomeActive(_ scene: UIScene) {
        NextFrame.shared.pause = false
    }
    func sceneWillResignActive(_ scene: UIScene) {
        NextFrame.shared.pause = true
       // ...
    }
}
public class NextFrame { 
    public init() {
        link = CADisplayLink(target: self, selector: #selector(nextFrames))
      //  ...
    }
   @objc func nextFrames() -> Bool  {
        guard !pause else { return false }
       // ...
    }
}