GPU devices and work submission
Find any available GPU, submit work to it with command buffers, suspend work, and coordinate between multiple GPUs.
Overview
You can use any available GPU’s MTLDevice instance in addition to the default instance that MTLCreateSystemDefaultDevice() returns. For each device instance, get its MTLCommandQueue instance, and create one or more 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 for more information.
Topics
Locating and inspecting a GPU device
Getting the default GPUDetecting GPU features and Metal software versionsMTLCreateSystemDefaultDevice()MTLDeviceMulti-GPU systems
Submitting work to a GPU with Metal 4
MTL4CommandQueueMTL4CommandQueueDescriptorMTL4CommandQueueErrorMTL4CommandQueueError.CodeMTL4CommandQueueErrorDomainMTL4CommandBufferMTL4CommandBufferOptionsMTL4CommandEncoderMTL4RenderEncoderOptionsMTL4ArgumentTableMTL4ArgumentTableDescriptorMTL4CommandAllocatorMTL4CommandAllocatorDescriptorMTL4CommitOptionsMTL4CommitFeedbackMTL4CommitFeedbackHandlerMTL4CounterHeapMTL4CounterHeapDescriptorMTL4CounterHeapTypeMTL4TimestampHeapEntryMTL4TimestampGranularity
Submitting work to a GPU with Metal
Setting up a command structureMTLCommandQueueMTLCommandQueueDescriptorMTLCommandBufferMTLCommandBufferDescriptorMTLCommandBufferErrorMTLCommandEncoder