---
title: MTLCreateSystemDefaultDevice()
framework: metal
role: symbol
role_heading: Function
path: metal/mtlcreatesystemdefaultdevice()
---

# MTLCreateSystemDefaultDevice()

Returns the device instance Metal selects as the default.

## Declaration

```swift
func MTLCreateSystemDefaultDevice() -> (any MTLDevice)?
```

## Mentioned in

Developing Metal apps that run in Simulator Getting the default GPU

## Return Value

Return Value A device object.

## Discussion

Discussion In macOS, in order for the system to provide a default Metal device object, you need to link to the Core Graphics framework. You usually need to do this explicitly if you’re writing apps that don’t use graphics by default, such as command line tools.

## See Also

### Locating and inspecting a GPU device

- [Getting the default GPU](metal/getting-the-default-gpu.md)
- [Detecting GPU features and Metal software versions](metal/detecting-gpu-features-and-metal-software-versions.md)
- [MTLDevice](metal/mtldevice.md)
- [Multi-GPU systems](metal/multi-gpu-systems.md)
