I am happy to announce that today I was able to successfully add a Graphics Processing Unit (GPU) to my Dell PowerEdge R330 server in order to use it for Plex transcoding on a VM under ESXi. After extensive research, I ended up settling on a NVIDIA Quadro P400 which can be found used for fairly cheap these days.
The initial process was pretty straightforward. Shut down your server and install the P400 on the riser card and power it back on. Unfortunately due to this new addition, your server will spin up its fans louder than usual since it does not recognize the card (take a look here in order to learn how to lower it back to default). After ESXi is finished booting, login to your ESXI UI and you should now see the card under Manage->Hardware.
Notice above that I already have mine in passthrough mode. You may now click on the card (don’t worry, both NVIDIA devices will be selected) and click on Toggle passthrough on the top left. Now you must reboot your host for changes to take effect.
Once done, log back into the ESXi UI and find your desired VM, in my case, an Ubuntu 20.04 running Plex Media Server. Shut it down and click edit. Now click on Add other device and select PCI device.
It should automatically populate with your NVIDIA Quadro P400. While on this screen, it would be a good time to reserve the memory assigned to this VM since for some reason it is a requirement for when using a passthrough device (the VM won’t start otherwise) so click on Memory and under Reservation you should see an option for the memory already allocated. Select it and click click Save. You may now start your VM.
The only thing left now is to install the correct drivers otherwise Plex will not use the newly added GPU. Since I am using Ubuntu I connected to my VM via SSH and issued the following command in order to see the best driver available:
You should see an output similar to this:
== /sys/devices/pci0000:00/0000:00:16.0/0000:0b:00.0 == modalias : pci:v000010DEd00001CB3sv000010DEsd000011BEbc03sc00i00 vendor : NVIDIA Corporation model : GP107GL [Quadro P400] driver : nvidia-driver-418-server - distro non-free driver : nvidia-driver-470 - distro non-free driver : nvidia-driver-515 - distro non-free recommended driver : nvidia-driver-510 - distro non-free driver : nvidia-driver-390 - distro non-free driver : nvidia-driver-515-server - distro non-free driver : nvidia-driver-450-server - distro non-free driver : nvidia-driver-510-server - distro non-free driver : nvidia-driver-470-server - distro non-free driver : xserver-xorg-video-nouveau - distro free builtin == /sys/devices/pci0000:00/0000:00:0f.0 == modalias : pci:v000015ADd00000405sv000015ADsd00000405bc03sc00i00 vendor : VMware model : SVGA II Adapter manual_install: True driver : open-vm-tools-desktop - distro free
In the output above, the recommended driver is nvidia-driver-515 which can be installed by issuing:
sudo apt install nvidia-driver-515
Once the installation is complete, you should reboot the VM. In order to verify if the installation was successful you may use a utility created by NVIDIA called nvidia-smi.
The NVIDIA System Management Interface (nvidia-smi) is a command line utility, based on top of the NVIDIA Management Library (NVML), intended to aid in the management and monitoring of NVIDIA GPU devices.https://developer.nvidia.com/nvidia-system-management-interface
To use it, simply type nvidia-smi on the prompt while connected to the VM and the output below should pop up displaying various information about the GPU.
A bonus of this utility is that it will let you know once Plex starts to use it for a transcode as it will show at the bottom under “running processes”.