<!--
{
  "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" : "MetalKit",
  "identifier" : "/documentation/MetalKit/MTKView/preferredDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "MetalKit"
    ],
    "preciseIdentifier" : "c:objc(cs)MTKView(py)preferredDevice"
  },
  "title" : "preferredDevice"
}
-->

# preferredDevice

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

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

## Discussion

On systems with a single GPU, this method returns the default Metal system device; 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 view’s contents. This device object usually corresponds to the GPU associated with the screen that’s displaying the view. If you set the view’s [`device`](/documentation/MetalKit/MTKView/device) property to this device object, you reduce the number of cross-GPU texture copies that Core Animation must make to present the view’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)