<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "QuartzCore",
  "identifier" : "/documentation/QuartzCore/CAMetalLayer/preferredDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core Animation"
    ],
    "preciseIdentifier" : "c:objc(cs)CAMetalLayer(py)preferredDevice"
  },
  "title" : "preferredDevice"
}
-->

# preferredDevice

The device object that the system recommends using for this layer.

```
var preferredDevice: (any MTLDevice)? { get }
```

## Discussion

On systems with a single GPU, this method returns the default device object; see <doc://com.apple.documentation/documentation/Metal/MTLCreateSystemDefaultDevice()>. On systems with more than one GPU, this method returns the <doc://com.apple.documentation/documentation/Metal/MTLDevice> that was last used to composite and present the [`CAMetalLayer`](/documentation/QuartzCore/CAMetalLayer). This device object usually corresponds to the GPU associated with the screen that’s displaying the layer. If you set the layer’s [`device`](/documentation/QuartzCore/CAMetalLayer/device) property to this device object, you reduce the number of cross-GPU texture copies that Core Animation must perform to present the layer’s contents onscreen.

---

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)