Paravirtualized Graphics
Add graphics acceleration to your guest driver stack.
Overview
If you have an app that implements hardware-level virtualization, performance inside the virtual machine is critical, particularly for graphics. The ParavirtualizedGraphics framework implements hardware-accelerated graphics for macOS running in a virtual machine, hereafter known as the guest. The operating system provides a graphics driver that runs inside the guest, communicating with the framework in the host operating system to take advantage of Metal-accelerated graphics.
To implement accelerated graphics inside your virtualization solution, you need to take the following steps for each virtual machine:
Advertise the virtual graphics card in the virtual machine hardware so that macOS can install the correct driver.
Create a PGDeviceDescriptor, providing the necessary blocks to connect your virtual machine implementation to the ParavirtualizedGraphics framework. Use this descriptor to create a PGDevice object, which you keep alive as long as the virtual machine is still active. The ParavirtualizedGraphics framework calls your blocks when it needs to allocate memory or take other relevant actions.
Create a PGDisplayDescriptor for each virtual display that you want to connect to the device, specifying the display’s properties and blocks for the framework to call for display events. Use this descriptor to create a PGDisplay object. Handle the appropriate display events to display the graphics data that the framework provides.
Topics
PCI Device Characteristics
Devices
Displays
Reference
ParavirtualizedGraphics ConstantsParavirtualizedGraphics FunctionsParavirtualizedGraphics Data Types