GPU Capability on a VM
Recently there’s been a lot of talk regarding Machine Learning, IoT, Big Data, AI, etc. All of these industry buzz words have been the talk of the industry. These technologies now are starting to creep into the world of Virtualization. About ten years ago, it was all about moving away from Physical to Virtual, but now the conversation is starting to shift to a new conversation, which is Virtualization of new and emerging workloads.
Years ago, if you told someone they needed a dedicated Graphics card for an ESXi host, they would probably look at you funny, but today it’s becoming more and more popular. The use first became popular with VDI environments. The graphics cards would help offload resolution and graphics tasks from the host, which in turn provided a better user experience. One may ask, why in the world would you need a dedicated graphics card for an ESXi host? Well, it’s got to do with the above mentioned, which is Virtualization of new and emerging technologies.
Why GPUs? Benefits?
Machine learning, IoT, Big Data, AI, (insert future fancy IT Buzz word) all require enormous amounts of compute, and as these workloads become more popular in today’s enterprises, the need for virtualization also changes. One of the key changes recently has been the adaptation of ESXi host with dedicated GPUs. These graphics cards aren’t your typical desktop graphics cards. Instead these are beefy enterprise class cards that have the hardware requirements required for satisfying the most demanding workloads. Additionally these workloads are best suited for GPUs. The architecture of the GPUs helps process these data sets quicker and faster than x86 compute nodes. It also frees up CPU cycles for other processing needs, which is an added benefit.
Graphics card use cases within ESXi continue to grow. The primary use cases are render farms, graphics intense image processing, machine learning, etc. These workloads, if optimized, can utilize graphics cards (GPUs) to offset the data processing of the workloads. However, the software should be written in a way to take advantage of these capabilities. These applications are specifically written to take advantage of the cores and memory of the GPU. For example: If you have an application written that takes advantage of the OpenGL library, then enabling GPU passthrough should provide a benefit.
- ESXi host with GPU Capabilities (GPU needs to be compatible with VMware)
- Application that can take advantage of the GPU capabilities
- Drivers loaded on to the Guest OS (Linux or Windows)
- VM Placement on ESXi host with GPU
Before starting, it’s important to note the above requirements before starting.
*NOTE* My test VM is already on a ESXi host with GPUs. This won’t work unless you have a compatible ESXi host with compatible GPUs. This is clearly from the perspective of enabling GPU passthrough on the VM once everything has been configured beforehand correctly.
*Additional configuration is required on the ESXi Side, so be sure to check your documentation from your HW Vendor*
Enabling GPU Passthrough on a VM
First, log into vCenter. Locate the VM you wish to configure and “shut down” the GuestOS.
Next, select “Add New Device”
The GPU is automatically detected as a new PCI Device.
Next, review the warning and select “Reserve all Memory”, and note the warning about vMotion/Snapshots. Some of these limitations are to be addressed with 6.7 U1
Once you have added the device, select “OK” and power on the VM.
Head over to device manager in the VM and you should see that the graphics card is being detected. Almost done, but first we need to download the GPU Driver.
In this particular instance, NVIDIA GPUs are being utilized. Head over to their website, downloads and drivers.
The file should now start downloading.
Once completed, extract the contents.
The contents will now extract.
Select, next, then agree.
The installation has now commenced.
Once completed, select “Restart Now” to restart the GuestOS.
After rebooting check the Device Manager to see if the installation was successful.
That completes the process of giving a VM GPU capability. Applications should now be able to pass through to the GPU and utilize it for computing purposes.