<!--
{
  "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

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

An error code that represents the absence of any problems.

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

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

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

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

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

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

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

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

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

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

[`static var memoryless: MTLCommandBufferError.Code`](/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.

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

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

[`static var stackOverflow: MTLCommandBufferError.Code`](/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.

[`static var accessRevoked: MTLCommandBufferError.Code`](/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.

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

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

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

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

### Error domain

[`static var errorDomain: String`](/documentation/Metal/MTLCommandBufferError-swift.struct/errorDomain)

The current command buffer error domain.

[`let MTLCommandBufferErrorDomain: String`](/documentation/Metal/MTLCommandBufferErrorDomain)

The domain for Metal command buffer errors.

### Deprecated

[`static var blacklisted: MTLCommandBufferError.Code`](/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

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

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

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

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

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

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

---

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)