<DISCLAIMER>

This post was written at 1AM, after finally getting transcoding working properly on my Plex server. This was a moment of great triumph, and I felt it needed celebrating.

</DISCLAIMER>

What is Plex?

Plex is great. It’s a fantastic media-center server that allows you to share your library with friends and family.

Example of the Plex Dashboard

I happen to have an extensive media collection, and this has been shared with friends and family for a while now. I recently transferred the responsibility of hosting my Plex server to a Dell R620, running ESX.

The issue.

The only downside to this was that the processor used by the R620 (Intel Xeon E5-2620) doesn’t support Intel Quick Sync Video (QSV). This capability is what allowed my Plex instance to convert and stream video without requiring a dedicated graphics card.

Thinking that this was just a matter of brute processing power, I assigned my newly migrated Plex VM 12 Cores of CPU. I then fired up Plex and went to watch a normal 1080p film. And it started buffering…

And continued to buffer…

More Buffering

Then the film started. Two Seconds later, more buffering. Clearly this was not working as expected. It was obvious that brute force alone was not going to be enough to win the day.

Time to fix it!

Day 1

This is where I went rummaging around my parts drawer for a graphics card. The only thing I had spare was an Nvidia Quadro NVS 295. I tested it on a Windows box, and after a quick driver download, it worked! So, into the server it went! I assigned it to my Plex VM and….. Nothing.

For whatever reason, my Plex VM couldn’t see the card. Rather than taking ages trying to troubleshoot this pretty old card, I decided (like a normal human being) that I should upgrade the modest card currently in my Desktop PC (an Nvidia GT 710) and use my GT710 as my transcoding card.

Day 5

Once my new “Gaming” graphics card arrived, I swapped out the NVS 295 with my old GT710. And it registered in Plex! Finally!

Cowabunga!

Except that trying to play the same video resulted in buffering again!

Looking at the Nvidia Support Matrix, the GT710 is only capable of decoding a single specific H.264 codec. As Plex didn’t want to use this codec for its streams, it defaulted to CPU encoding.

At this point, I bit the bullet and bought an Nvidia Quadro P400. This was heralded online as the cheapest way of attaining the closest to across-the-board capability on the Compatibility Matrix.

Day 10

Once the P400 arrived, and had been installed and linked to the VM, I attempted the troublesome 1080p film.

AND IT STILL BUFFERED!

I ran nvidia-smi to see if my card was even being used, and was greeted with the following error:

Unable to determine the device handle for GPU 0000:0B:00.0: Unknown Error

This indicates that the Nvidia Driver has failed to load correctly, with the main cause being that it has detected that it is running in a virtual machine. This is Nvidia’s way of promoting their enterprise GPU offerings.

Luckily, this was easily fixed by changing an option in my Virtual Machine advanced settings:

hypervisor.cpuid.fv0 = TRUE <--> hypervisor.cpuid.fv0 = FALSE

The thrilling Conclusion

One reboot later, and I run nvidia-smi again:

+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.64.00    Driver Version: 440.64.00    CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Quadro P400         On   | 00000000:0B:00.0 Off |                  N/A |
| 34%   45C    P0    N/A /  N/A |     12MiB /  2000MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

And the Card appears!

With baited breath, I attempted to play the apparently cursed film. And Success!

Plex streams 1080p just fine. I was even able to transcode my 4K films down to SD quality with no issues.

This could all have been avoided if I had done some prior reading, so I feel a little silly about how long this was broken for.