<!--
{
  "documentType" : "article",
  "framework" : "Metal",
  "identifier" : "/documentation/Metal/gpu-devices-and-work-submission",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "GPU devices and work submission"
}
-->

# GPU devices and work submission

Find any available GPU, submit work to it with command buffers, suspend work, and coordinate between multiple GPUs.

## Discussion

You can use any available GPU’s [`MTLDevice`](/documentation/Metal/MTLDevice) instance in addition to the default instance that [`MTLCreateSystemDefaultDevice()`](/documentation/Metal/MTLCreateSystemDefaultDevice()) returns. For each device instance, get its [`MTLCommandQueue`](/documentation/Metal/MTLCommandQueue) instance, and create one or more [`MTLCommandBuffer`](/documentation/Metal/MTLCommandBuffer) instances to send work to the GPU.

When the system suspends your app, use the command queue to finish command buffers already in progress. See [Preparing your Metal app to run in the background](/documentation/Metal/preparing-your-metal-app-to-run-in-the-background) for more information.

## Topics

### Locating and inspecting a GPU device

[Getting the default GPU](/documentation/Metal/getting-the-default-gpu)

Select the system’s default GPU device on which to run your Metal code.

[Detecting GPU features and Metal software versions](/documentation/Metal/detecting-gpu-features-and-metal-software-versions)

Use the device object’s properties to determine how you perform tasks in Metal.

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

Returns the device instance Metal selects as the default.

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

The main Metal interface to a GPU that apps use to draw graphics and run computations in parallel.

[Multi-GPU systems](/documentation/Metal/multi-gpu-systems)

Locate and work with internal and external GPUs and their displays, video memory, and performance tradeoffs.

### Submitting work to a GPU with Metal 4

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

An abstraction representing a command queue that you use commit and synchronize command buffers and to
perform other GPU operations.

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

Groups together parameters for the creation of a new command queue.

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

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

Enumeration of kinds of errors that committing an array of command buffers instances can produce.

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

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

Records a sequence of GPU commands.

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

Options to configure a command buffer before encoding work into it.

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

An encoder that writes GPU commands into a command buffer.

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

Custom render pass options you specify at encoder creation time.

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

Provides a mechanism to manage and provide resource bindings for buffers, textures, sampler states and other Metal resources.

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

Groups parameters for the creation of a Metal argument table.

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

Manages the memory backing the encoding of GPU commands into command buffers.

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

Groups together parameters for creating a command allocator.

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

Represents options to configure a commit operation on a command queue.

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

Describes an object containing debug information from Metal to your app after completing a workload.

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

Defines the block signature for a callback Metal invokes to provide your app feedback after completing a workload.

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

Represents an opaque, driver-controlled section of memory that can store GPU counter data.

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

Groups together parameters for configuring a counter heap object at creation time.

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

Defines the type of a [`MTL4CounterHeap`](/documentation/Metal/MTL4CounterHeap) and the contents of its entries.

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

Represents a timestamp data entry in a counter heap of type `MTL4CounterHeapTypeTimestamp`.

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

Provides a hint to the system about the desired accuracy when writing GPU counter timestamps.

### Submitting work to a GPU with Metal

[Setting up a command structure](/documentation/Metal/setting-up-a-command-structure)

Discover how Metal executes commands on a GPU.

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

An instance you use to create, submit, and schedule command buffers to a specific GPU device to run the commands within those buffers.

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

A configuration that customizes the behavior for a new command queue.

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

A container that stores a sequence of GPU commands that you encode into it.

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

A configuration that customizes the behavior for a new command buffer.

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

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

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

An encoder that writes GPU commands into a command buffer.

### Submitting work to a GPU

[Setting up a command structure](/documentation/Metal/setting-up-a-command-structure)

Discover how Metal executes commands on a GPU.

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

An instance you use to create, submit, and schedule command buffers to a specific GPU device to run the commands within those buffers.

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

A configuration that customizes the behavior for a new command queue.

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

A container that stores a sequence of GPU commands that you encode into it.

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

A configuration that customizes the behavior for a new command buffer.

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

The domain for Metal command buffer errors.

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

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

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

An encoder that writes GPU commands into a command buffer.

### Suspending work on a GPU

[Preparing your Metal app to run in the background](/documentation/Metal/preparing-your-metal-app-to-run-in-the-background)

Prepare your app to move into the background by pausing future GPU use and ensuring previous work is scheduled.



---

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)