---
title: device
framework: metal
role: symbol
role_heading: Instance Property
path: metal/mtlcommandbuffer/device
---

# device

The GPU device that indirectly owns the command buffer because you create it from a command queue the device also owns.

## Declaration

```swift
var device: any MTLDevice { get }
```

## Discussion

Discussion The command buffer can only work with other instances that device creates, directly or indirectly, such as buffers and textures.

## See Also

### Identifying the command buffer

- [label](metal/mtlcommandbuffer/label.md)
- [commandQueue](metal/mtlcommandbuffer/commandqueue.md)
