<!--
{
  "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/MTLDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "Metal"
    ],
    "preciseIdentifier" : "c:objc(pl)MTLDevice"
  },
  "title" : "MTLDevice"
}
-->

# MTLDevice

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

```
protocol MTLDevice : NSObjectProtocol, Sendable
```

## Overview

You can get the default [`MTLDevice`](/documentation/Metal/MTLDevice) at runtime by calling [`MTLCreateSystemDefaultDevice()`](/documentation/Metal/MTLCreateSystemDefaultDevice()) (see [Getting the default GPU](/documentation/Metal/getting-the-default-gpu)). Each Metal device instance represents a GPU and is the main starting point for your app’s interaction with it. With a Metal device instance, you can inspect a GPU’s features and capabilities (see [Device inspection](/documentation/Metal/device-inspection)) and create subsidiary type instances with its factory methods.

- Buffers, textures, and other resources store, synchronize, and pass data between the GPU and CPU (see [Resource fundamentals](/documentation/Metal/resource-fundamentals)).
- Input/Output command queues efficiently load resources from the file system (see [Resource loading](/documentation/Metal/resource-loading)).
- Command queues create command encoders and schedule work for the GPU, including rendering and compute commands (see [Render passes](/documentation/Metal/render-passes) and [Compute passes](/documentation/Metal/compute-passes)).
- Pipeline states store render or compute pipeline configurations — which can be expensive to create — so that you can reuse them, potentially many times.

If your app uses more than one GPU (see [Multi-GPU systems](/documentation/Metal/multi-gpu-systems)), ensure that instances of these types only interact with others from the same device. For example, your app can pass a texture to a command encoder that comes from the same Metal device, but not to another device.

## Topics

### Working with GPU devices

[Device inspection](/documentation/Metal/device-inspection)

Locate and identify a GPU and the features it supports, and sample its counters.

[Work submission](/documentation/Metal/work-submission)

Create queues that submit work to the GPU or load assets into GPU resources, and indirect command buffers that group your frequent commands together.

[Pipeline state creation](/documentation/Metal/pipeline-state-creation)

Create pipeline states for render and compute passes, samplers, depth and stencil states, and indirect command buffers.

[Resource creation](/documentation/Metal/resource-creation)

Load assets with input/output queues and make various resource instances, such as buffers, textures, acceleration structures, and memory heaps.

[Shader library and archive creation](/documentation/Metal/shader-library-and-archive-creation)

Create static and dynamic shader libraries, and binary shader archives.



---

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)