<!--
{
  "availability" : [
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreGraphics",
  "identifier" : "/documentation/CoreGraphics/CGDirectDisplayCopyCurrentMetalDevice(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Graphics"
    ],
    "preciseIdentifier" : "c:@F@CGDirectDisplayCopyCurrentMetalDevice"
  },
  "title" : "CGDirectDisplayCopyCurrentMetalDevice(_:)"
}
-->

# CGDirectDisplayCopyCurrentMetalDevice(_:)

Returns the GPU device instance that’s currently driving a display.

```
func CGDirectDisplayCopyCurrentMetalDevice(_ display: CGDirectDisplayID) -> (any MTLDevice)?
```

## Parameters

`display`

A unique identifier for a display.

## Return Value

A device that supports Metal framework commands.

## Discussion

> Note:
> This function can change its return value at any time for the built-in display when the system has automatic graphics switching enabled.

---

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)