Plex GPU transcoding appears to incur CPU usage


Recommended Posts

Does running binhex-plex + unraid nvidia with a dedicated patched GTX 1050 Ti cause cpu usage to increase with each stream?

 

Experiment: Streaming a 32GB 2160p movie to clients at 20Mbps 1080p. My binhex-plex is pinned to cpu 0,1 on a Ryzen 3 3200g.

 

Media file details:

image.png

 

 

Plex Transcode Setting:

image.png.bfd870ca9a3e836dcba074bc97eae711.png

 

At 2 steams, everything looks OK:

image.png.fc4b1b3a1e986b86534b3bd9cdc96a1f.png

image.png.05d477f496d79cdb468462856040e39c.png

 

However, at 3 streams the CPU usages gets heavy (70-90%), despite 'nvidia-smi' reporting GPU transcoding. No issues on client playback.

image.png.9266b0afbf613d9e556812c64a198e98.png

image.png.a5c36e6ba453957039fdefcc955f38e2.png

 

At 4 streams, CPU usage is pegged at 100% and the 4th stream experiences intermittent playback:

image.png.d7c93bd8db68a78bc340ba40162dad00.png

image.png.d7d8e1a2648fe0313eb49ae8434cf32d.png

 

Here is plex "now playing" at 4 streams:

image.png.181d6397d385209bde088d88cfd9b576.png

 

Observations:

-Despite all 4 streams being exactly the same movie streamed to the same device at the same settings, the last two are only 839MB of GPU memory compared to the first two at 949MB.

-GPU memory does not appear to be a constraint (3587/4038).

-Same issue occurs when using various clients around the house (laptops, iphones, ipads, etc..)

-System memory is 16GB (27% used)

-Docker tab correlates binhex-plex cpu usage.

 

Conclusion:

Although it appears that the GPU is doing the job of plex transcoding, there is still a CPU penalty incurred.

 

Thoughts:

Get rid of my Pontiac Aztek of a CPU and buy a Honda CR-V (Ryzen 5 3600)? 

 

 

 

Edited by bigbangus
forum rules
Link to comment
25 minutes ago, bigbangus said:

Does running binhex-plex + unraid nvidia with a dedicated patched GTX 1050 Ti cause cpu usage to increase with each stream?

By itself, this would not account for the CPU usage you are seeing, but, any audio transcoding or subtitles is handled by the CPU and not the GPU

 

It is not clear if audio transcoding/subtitles are involved in your scenario. 

 

By the way, as a general observation, it is recommended to keep CPU 0 and its associated thread available for use by unRAID for core NAS functions and system overhead.  unRAID can sometimes suffer performance wise if CPU 0 is not available.

Link to comment

It appears that only the first stream is being fully transcoded in hardware (both decode and encode). The second two are being decoded in hardware but encoded in software. I'm not familiar with using Plex hardware transcoding on Nvidia cards so I'm not sure if they are capable of encoding multiple streams simultaneously like I know my Intel Quick Sync can.

Link to comment

I suppose it depends how busy your server is but I personally don't pin Docker containers to CPUs.  My CPU is an i7-6950X though so I also don't know the per-core processing capabilities and whether the audio transcoding impacts this CPU much.  TL;DR I haven't noticed any CPU consumption even with hardware decoding using a GPU.
Also, most of my streaming is to devices that support direct audio and don't transcode, so I should probably monitor next time I'm streaming to a device like an Android phone etc.

Having said all that, the cores on my server are mostly idle unless I'm doing actual work on the server using VMs.  Even 50% CPU on a few cores wouldn't get my attention.
 

Edited by Kaldek
Link to comment
13 hours ago, Taddeusz said:

It appears that only the first stream is being fully transcoded in hardware (both decode and encode). The second two are being decoded in hardware but encoded in software. I'm not familiar with using Plex hardware transcoding on Nvidia cards so I'm not sure if they are capable of encoding multiple streams simultaneously like I know my Intel Quick Sync can.

Yes good eye I didn't notice the last two streams that appeared in the "now playing" didn't have a "(hw)" on the playback. This correlates with the sudden jump in cpu usage from the 2nd to the 3rd stream and the difference in GPU memory utilization (839 vs 949MB) for the last two streams.

 

(BTW plex doesn't order the "now playing" list chronologically, so it was in fact the last two streams that didn't have (hw) encoding)

 

So what's the limitation here? Is it hardware or software? Why won't the GPU take on a 3rd or 4th encoding task, despite doing the decoding just fine.

 

Link to comment

And just to confirm, the same issue happens when using a 1080p 16Mbps file and transcoding to 1080p 12Mbps (just for sake of experiment).

image.png.a27510f690f5f1457f49a67453c674c4.png

 

 

Really curious if any other Unraid Nvidia / binhex-plex users have this same issue, ie 3rd stream and on doesn't use gpu for encoding.

Edited by bigbangus
clarification
Link to comment
3 hours ago, bigbangus said:

Really curious if any other Unraid Nvidia / binhex-plex users have this same issue, ie 3rd stream and on doesn't use gpu for encoding.

Because typical gamer type nvidia cards are limited by the manufacturer to 2 streams. To decode more simultaneous streams, you need one of the pro level cards that sell for more money.

Link to comment
6 minutes ago, jonathanm said:

Because typical gamer type nvidia cards are limited by the manufacturer to 2 streams. To decode more simultaneous streams, you need one of the pro level cards that sell for more money.

Thank you for clarifying this is expected behavior. I'll have to go pro if need more streams handled by the GPU.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.