<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/MTLCommandBufferError-swift.struct/Code",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:@E@MTLCommandBufferError"
  },
  "title" : "MTLCommandBufferError.Code"
}
-->

# MTLCommandBufferError.Code

Error codes that indicate why a GPU is unable to finish running a command buffer.

```
enum Code
```

## Topics

### Error codes

[`MTLCommandBufferError.Code.none`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/none)

An error code that represents the absence of any problems.

[`MTLCommandBufferError.Code.timeout`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/timeout)

An error code that indicates the system interrupted and terminated the command buffer before it finished running.

[`MTLCommandBufferError.Code.pageFault`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/pageFault)

An error code that indicates the command buffer generated a page fault the GPU can’t service.

[`MTLCommandBufferError.Code.notPermitted`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/notPermitted)

An error code that indicates a process doesn’t have access to a GPU device.

[`MTLCommandBufferError.Code.outOfMemory`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/outOfMemory)

An error code that indicates the GPU device doesn’t have sufficient memory to execute a command buffer.

[`MTLCommandBufferError.Code.invalidResource`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/invalidResource)

An error code that indicates the command buffer has an invalid reference to resource.

[`MTLCommandBufferError.Code.memoryless`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/memoryless)

An error code that indicates the GPU ran out of one or more of its internal resources that support memoryless render pass attachments.

[`MTLCommandBufferError.Code.deviceRemoved`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/deviceRemoved)

An error code that indicates a person physically removed the GPU device before the command buffer finished running.

[`MTLCommandBufferError.Code.stackOverflow`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/stackOverflow)

An error code that indicates the GPU terminated the command buffer because a kernel function of tile shader used too many stack frames.

[`accessRevoked`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/accessRevoked)

An error code that indicates the system has revoked the Metal device’s access because it’s responsible for too many timeouts or hangs.

[`MTLCommandBufferError.Code.internal`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/internal)

An error code that indicates the Metal framework has an internal problem.

### Deprecated

[`MTLCommandBufferError.Code.blacklisted`](/documentation/Metal/MTLCommandBufferError-swift.struct/Code/blacklisted)

A former error code that indicates the system has revoked the Metal device’s access because it’s responsible for too many timeouts or hangs.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)