4.11. Installing a vGPU on a Virtual Machine
You can use a host with a compatible graphics processing unit (GPU) to run virtual machines with virtual GPUs (vGPUs). A virtual machine with a vGPU is better suited for graphics-intensive tasks than a virtual machine without a vGPU. A virtual machine with a vGPU can also run software that cannot run without a GPU, such as CAD.
vGPU Requirements
If you plan to configure a host to allow virtual machines on that host to install a vGPU, the following requirements must be met:
- vGPU-compatible GPU
- GPU-enabled host kernel
- Installed GPU with correct drivers
- Predefined mdev_type set to correspond with one of the mdev types supported by the device
- vGPU-capable drivers installed on each host in the cluster
- vGPU-supported virtual machine operating system with vGPU drivers installed
Preparing a Host for vGPU Installation
- Install vGPU-capable drivers onto your host. Consult the documentation for your GPU card for more information.
Install vdsm-hook-vfio-mdev:
# yum install vdsm-hook-vfio-mdev
You can now install vGPUs on the virtual machines running on this host.
Installing a vGPU on a Virtual Machine
Confirm the vGPU instance to use:
-
Click
, click the required host’s name to go to the details view, and click the Host Devices tab. Available vGPU instances appear in the Mdev Types column. Alternatively, run the following command on the host:
# vdsm-client Host hostdevListByCaps
Available vGPU instances appear in the mdev key available_instances.
-
Click
- Install the required virtual machine operating system. See ] or xref:chap-Installing_Windows_Virtual_Machines[.
- Shut down the virtual machine.
Add the vGPU instance to the virtual machine:
- Select the virtual machine and click .
- Click Custom Properties tab. , then click the
- Select mdev_type from the drop-down list and enter the vGPU instance in the text field.
- Click .
- Start the virtual machine and install the vGPU driver through the vendor’s installer. Consult the documentation for your GPU card for more information.
- Restart the virtual machine.
- Verify that the vGPU is recognized by checking the virtual machine operating system’s device manager.
You cannot migrate a virtual machine using a vGPU to a different host. When upgrading the virtual machine, verify the operating system and GPU vendor support in the vendor’s documentation.