...
- Libvirt Domain XML Transformer (libvirt-vm-xml-transformer.sh)
- VM Instance Start hook (libvirt-vm-state-change.sh)
- VM Instance Stop hook (libvirt-vm-state-change.sh)
...
Only the response for the transformer hook is used. The response for the start and stop hooks is ignored.
...
- service_offering
- vgpu_profile_id - The vGPU profile to be used for the guest VM Instance
- gpu_count - number of gpu devices to attach to the guest VM Instance
- gpu_display - Whether to use the gpu cards as display on the guest vm Instance
We have added the following new APIs:
...
Ensure the PCI Device is Not in Use by the Host
- Disable the nouveau kernel module and add the following line to the top of the
/etc/modprobe.d/50-denylist.conf file:
blacklist nouveau - Check if vfio-pci is loaded and used for the GPU devices:
$ lspci -k | grep -A3 -E "3D controller|VGA"
00:02.0 VGA compatible controller: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] (rev 0c)
Subsystem: Dell Device 0b19
Kernel driver in use: i915
Kernel modules: i915, xe
--
01:00.0 3D controller: NVIDIA Corporation GA107M [GeForce RTX 3050 Ti Mobile] (rev a1)
Subsystem: Dell Device 0b19
Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia - Prevent the GPU devices from being used by the host:
$ lspci -nn | grep -E "3D controller|VGA"
00:02.0 VGA compatible controller [0300]: Intel Corporation Alder Lake-P GT2 [Iris Xe Graphics] [8086:46a6] (rev 0c)
01:00.0 3D controller [0302]: NVIDIA Corporation GA107M [GeForce RTX 3050 Ti Mobile] [10de:25a0] (rev a1) - Update grub configuration file /etc/default/grub. In this example, we are preventing the NVIDIA GPU with "vendor ID:Device ID" 10de:25a0 from being used by the host:
GRUB_CMDLINE_LINUX_DEFAULT=".... pci-stub.ids=10de:25a0" - Update grub configuration file:
$ sudo update-grub
or
$ sudo grub2-mkconfig -o /boot/grub2/grub.cfg - Reboot the host:
$ sudo reboot
Install GPU drivers
- Download the GPU drivers from your vendor. For nvidia, login to https://www.nvidia.com/en-us/drivers/vgpu-software-driver/ and download the drivers for your host & GPU Card.
Note: This is only required to create vGPUs. If only full passthrough is required, this can be ignored.
2. Check if GPU Devices are Discovered on the Host
...