In a VMware environment, GPU passthrough maps a VM to a Peripheral Component Interconnect (PCI) device physically installed in the host server. To make a GPU available to a VM, one or more PCI-based GPUs must be installed in the host, and VMware ESXi must be able to recognize the presence of the GPU devices.
GPU passthrough maps a physical GPU to a VM. The VM's operating system can then use the GPU just as it would if it were running on a physical machine equipped with a hardware GPU. Here’s a step-by-step guide on how to enable GPU passthrough:
GPU passthrough requires certain conditions to be met for successful implementation. The following are the main conditions:
Hardware Support: Ensure your CPU and motherboard support Intel VT-d or AMD IOMMU, as well as a dedicated GPU.
Virtualization software: Virtualization platforms that support GPU passthrough: e.g. KVM, Xen, VMware ESXi, etc. Ensure that the hypervisor used is capable of supporting GPU passthrough functionality.
Separate GPU for Host and VM: GPU pass-through requires that the GPU in the physical host can be used exclusively, usually requiring a dedicated GPU.
1.1 Download the ISO to your local computer. Upload the ISO needed to install VM in “Datastore browser”.
1.2 Click on "Create / Register VM".
1.3 Please name the VM. The appropriate OS family and OS version need to be selected.
1.4 Select the path to the ISO you just uploaded.
1.5 Select the ISO you uploaded. CPU, memory and disk size can be set by yourself.
1.6 Power on the VM, open the VM console, and select the “EFI VMware Virtual SATA CDROM Drive (0.0)” option when installing the system. Then install the system.
2.1 After logging into the ESXi web client, expand the list of hosts and select the Manage node. Then select the Hardware tab at the top of the screen to view a list of hardware devices installed in the host.
2.2 Next, check the checkboxes corresponding to the devices for which you want to enable GPU passthrough, and then click the Toggle Passthrough button, and the Passthrough column for the selected devices is set to Disabled.
2.3 If you see an error message stating that passthrough cannot be enabled until you reboot the host computer, you need to try rebooting the host computer and then click the Toggle Passthrough button.
3.1 The next step is to assign the GPU hardware to the VM. to do this, select the Virtual Machines node of the console and then select the VM in which you plan to use the GPU.
3.2 Click the Edit button to display the Edit Settings window for the VM. Click Add Add Other Device, and then select PCI Device. select your GPU from the list of available PCI devices, and then select the option to add a PCI device.
3.3 In addition to selecting a PCI device. you need to set up a memory reservation for the device. otherwise the VM will not start. click the Reserve All Memory button to create the necessary memory reservation.
Next, select the VM Options tab of the dialog box, expand the Advanced section, and click the Edit Configuration button to display the Configuration Parameters dialog box.
Click the Add Parameter button and create a new parameter called hypervisor.cpuid.v0. Set its value to FALSE, making sure to use all capital letters.
Through Nvidia's official website, simply download and install the appropriate GPU driver in the virtual machine.