---
title: preferredVideoDecoderGPURegistryID
framework: avfoundation
role: symbol
role_heading: Instance Property
path: avfoundation/avplayer/preferredvideodecodergpuregistryid
---

# preferredVideoDecoderGPURegistryID

The registry identifier for the GPU used for video decoding.

## Declaration

```swift
nonisolated var preferredVideoDecoderGPURegistryID: UInt64 { get set }
```

## Discussion

Discussion By default, whenever possible, the GPU associated with the display presenting the CALayer performs the video decoding. Decode transitions to a new GPU, if appropriate, when the CALayer moves to a new display. This property overrides this default behavior, forcing decode to prefer an affinity to the GPU specified regardless of which GPU displays the associated CALayer. Obtain the GPU registry ID from the GPU MTLDevice using registryID or from OpenGL or OpenCL. important: You must specify an external GPU (or a slotted GPU in Mac Pro) with this property. You can’t switch decoding between the integrated graphics and the built-in discrete graphics.

## See Also

### Configuring audio and video devices

- [audioOutputDeviceUniqueID](avfoundation/avplayer/audiooutputdeviceuniqueid.md)
