<!--
{
  "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",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "s:SC21MTLCommandBufferErrorLeV"
  },
  "title" : "MTLCommandBufferError"
}
-->

# MTLCommandBufferError

The command buffer error codes that indicate why the GPU doesn’t finish executing a command buffer.

```
struct MTLCommandBufferError
```

## Topics

### Errors codes

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

An error code that represents the absence of any problems.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[`stackOverflow`](/documentation/Metal/MTLCommandBufferError-swift.struct/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/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.

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

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

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

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

### Error domain

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

The current command buffer error domain.

[`MTLCommandBufferErrorDomain`](/documentation/Metal/MTLCommandBufferErrorDomain)

The domain for Metal command buffer errors.

### Deprecated

[`blacklisted`](/documentation/Metal/MTLCommandBufferError-swift.struct/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.

## Relationships

### Conforms To

[`Equatable`](/documentation/Swift/Equatable)

[`CustomNSError`](/documentation/Foundation/CustomNSError)

[`Error`](/documentation/Swift/Error)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)