Hardware-Accelerated Plex media server on Ubuntu?

Plex logoI have been using Plex media server on my AMD six core machine for a while and its good but cooling is a issue. About 9 months ago I installed a Nvidia graphics card hoping to take advantage of the new hardware acceleration option. However I realised its a non-starter as it required a Intel chipset not AMD.

Then over the last few months I got my hands on a secondhand HP Z800 workstation with 4x quad core 2.8 ghz processors (yes 16 cores in total). It came with 12 gig of memory which I was planning to upgrade if things work out. It came with a PCI-Express Nvida Geforce graphics card, so I was thinking everything is set. just install Ubuntu with Plex media server, install the proprietary Nvidia display drivers and sit back and enjoy?

I wish…

Here is Plex transcoding inception from 1080p with DTS (Blu-ray sourced) to something suitable for my Pixel 4 (I had to turn off play original, to force it to do the transcoding)transcoding with htop

You can see it much clearer in the htop terminal. Look at those cores running transcoding tasks.

Plex with transcoding

Here is Plex not transcoding inception from 1080p with DTS (Blu-ray sourced) to my Pixel 4

not transcoding with Htop

Quite different from the above, the machines is hardly doing anything over its 16 cores. But the bandwidth is a problem outside a local network environment

Plex not transcoding

If anyone has successfully got hardware-Accelerated Streaming working on a Ubuntu server, let me know!

This is not Plex on your GPU

https://www.flickr.com/photos/nvidia/30153594058/

I hadn’t really thought Plex Media Server could massively benefit from a GPU, to be fair its not really a thing you put in a headless server? But after reading about it, I gave it a try by borrowing a Nvida Quatro PCI-express card and after some small issues getting the propitery drivers working gave it a try.

I thrown together a shell script to log the CPU and GPU heat to a text file called heat.txt

while true; do date >> heat.txt ;
 nvidia-smi -q -d temperature |
 grep 'GPU Current Temp' >> heat.txt; sensors |
 grep -e 'CPU Temperature' -e 'CPU Fan Speed' 
-e 'MB Temperature' >> heat.txt; sleep 10; 
done

I know theres a better way but it was quick and dirty.

From the short tests I did, it seemed the CPU kicked into high gear for a minute or two before it hands off to, what I thought was the GPU. However… During a stream encode of 4k h.264 content to 1080p h.264, while directly streaming at the same time. I got these results.

Thu 20 Dec 20:23:51 GMT 2018;
> GPU Temperature: 33.0°C
> CPU Fan: 1650 RPM
> CPU Temperature: +71.0°C
> MB Temperature: +34.0°C
Thu 20 Dec 20:24:01 GMT 2018;
> GPU Temperature: 33.0°C
> CPU Fan:: 1599 RPM
> CPU Temperature: +68.0°C
> MB Temperature: +34.0°C
Thu 20 Dec 20:24:11 GMT 2018;
> GPU Temperature: 33.0°C
> CPU Fan: 1261 RPM
> CPU Temperature: +59.0°C
> MB Temperature: +34.0°C
Thu 20 Dec 20:24:21 GMT 2018;
> GPU Temperature: 33.0°C
> CPU Fan: 1167 RPM
> CPU Temperature: +54.0°C
> MB Temperature: +34.0°C

A while later once the transcoding stops

Thu 20 Dec 20:37:40 GMT 2018;
> GPU Temperature: 33.0°C
> CPU Fan: 725 RPM
> CPU Temperature: +37.0°C
> MB Temperature: +35.0°C
Thu 20 Dec 20:37:50 GMT 2018;
> GPU Temperature: 33.0°C
> CPU Fan: 724 RPM
> CPU Temperature: +37.0°C
> MB Temperature: +35.0°C
Thu 20 Dec 20:38:00 GMT 2018;
> GPU Temperature: 33.0°C
> CPU Fan: 725 RPM
> CPU Temperature: +37.0°C
> MB Temperature: +35.0°C

As you can see with proper testing it was clear the GPU isn’t being used for transcoding (unless the CPU magically is doing something else, but looking at Htop, its clearly Plex transcoding). This was confirmed when doing more research on the issue.

Seems the problem I got is the AMD processor and if I was to swich it to a Intel one it should work with the Nvidia GPU?

So this brings me to the idea of maybe changing parts of my server.

Si pointed me at PC part picker which is alright but I don’t really understand why some Linux operating systems are not listed under operating systems? I listed most of my parts here and to be fair changing the CPU, motherboard, case and of course getting my own GPU might be a good idea?