<!--
{
  "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 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreML",
  "identifier" : "/documentation/CoreML/MLModelConfiguration/preferredMetalDevice",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Core ML",
      "CoreML"
    ],
    "preciseIdentifier" : "c:objc(cs)MLModelConfiguration(py)preferredMetalDevice"
  },
  "title" : "preferredMetalDevice"
}
-->

# preferredMetalDevice

The metal device you prefer this model use to make predictions (inference) and update the model.

```
var preferredMetalDevice: (any MTLDevice)? { get set }
```

## Discussion

If [`preferredMetalDevice`](/documentation/CoreML/MLModelConfiguration/preferredMetalDevice) is `nil`, the default value, Core ML chooses a metal device for you.

---

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)