Mysteries of hardware transcoding & It still using large amounts of CPU

Server Version#: 4.12.3
Player Version#: Web player on Windows

So my question here.

I just started using hardware acceleration today, and I know that not EVERYTHING gets offloaded to GPU however there are instances where I’m seeing nothing offload.

My setup is as follows:

Dell R620 w/ Quadro p400 passed through to a Server 2016 VM in VMWare 6.5.
whatever is the most recent Quadro drivers for server 2016 are what is installed, I use GPU-Z to monitor GPU clock & GPU load, and when watching content I’ll go from the idle 139mhz to 1227.5mhz & see GPU load bounce between 5 and 15% if I’m “Converting” a 4k video.

I’ll also see about 30% CPU usage on the plex transcoder (4 cores allocated to the VM on an e5-2640)

I guess I’m just curious as to what all tweaks I may need to make or if there are conditions that I’m not meeting for whatever content i’m transcoding to be eligible to be transcoded on my GPU or something.

I’ve found a little bit of information here and there but nothing that is definitive regarding explaining why I’m seeing the behavior I am. the whole goal of doing this was reduce CPU load & be able to stream 2-3 high quality videos at the same time even if they happen to need to transcode or something.

Based on what I see in the logs it does look like it’s offloading. Unless i’m interpreting incorrectly.

an 25, 2020 23:09:07.974 [1984] Debug — Cleaning directory for session 5w8f4t6pnpfcafeps9njqo5p ()
Jan 25, 2020 23:09:07.974 [1984] Debug — Starting a transcode session 5w8f4t6pnpfcafeps9njqo5p at offset -1.0 (state=3)
Jan 25, 2020 23:09:07.974 [1984] Debug — TPU: hardware transcoding: using hardware decode accelerator nvdec
Jan 25, 2020 23:09:07.974 [1984] Debug — [Universal] Using local file path instead of URL: D:\Data\Video\Movies\Marvels Avengers - Infinity War\Avengers Infinity War 2018 REMUX 2160p (10bit) BluRay UHD HDR HEVC TrueHD DTS-HD MA 7 1-LEGi0N\Avengers.Infinity.War.2018.REMUX.2160p.(10bit).BluRay.UHD.HDR.HEVC.TrueHD.DTS-HD.MA.7.1-LEGi0N.mkv
Jan 25, 2020 23:09:07.974 [1984] Debug — TPU: hardware transcoding: zero-copy support not present
Jan 25, 2020 23:09:07.974 [1984] Debug — TPU: hardware transcoding: final decoder: nvdec, final encoder: nvenc
Jan 25, 2020 23:09:07.974 [1984] Debug — Job running: EAE_ROOT='\\?\C:\Users\Administrator\AppData\Local\Plex Media Server\Cache\Transcode\Sessions\EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='\\\\?\\C\:\\Users\\Administrator\\AppData\\Local\\Plex\ Media\ Server\\Codecs\\8bf330d-2818-windows-x86\\' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' C:\Program Files (x86)\Plex\Plex Media Server\Plex Transcoder.exe -codec:0 hevc -hwaccel:0 nvdec -hwaccel_fallback_threshold:0 10 -codec:1 dca -analyzeduration 20000000 -probesize 20000000 -i "D:\Data\Video\Movies\Marvels Avengers - Infinity War\Avengers Infinity War 2018 REMUX 2160p (10bit) BluRay UHD HDR HEVC TrueHD DTS-HD MA 7 1-LEGi0N\Avengers.Infinity.War.2018.REMUX.2160p.(10bit).BluRay.UHD.HDR.HEVC.TrueHD.DTS-HD.MA.7.1-LEGi0N.mkv" -filter_complex [0:0]scale=w=2276:h=1280[0];[0]format=pix_fmts=yuv420p|nv12[1] -filter_complex "[0:1] aresample=async=1:ocl='stereo':osr=48000[2]" -map [1] -metadata:s:0 language=eng -codec:0 h264_nvenc -b:0 54418k -maxrate:0 72558k -bufsize:0 145116k -preset:0 hp -forced-idr:0 1 -r:0 23.975999999999999 -force_key_frames:0 expr:gte(t,0+n_forced*1) -map [2] -metadata:s:1 language=eng -codec:1 aac_mf -b:1 256k -f dash -seg_duration 1 -init_seg_name init-stream$RepresentationID$.m4s -media_seg_name chunk-stream$RepresentationID$-$Number%05d$.m4s -window_size 5 -delete_removed false -skip_to_segment 1 -time_delta 0.0625 -manifest_name http://127.0.0.1:32400/video/:/transcode/session/5w8f4t6pnpfcafeps9njqo5p/bc3a8d80-fed6-4913-85ea-5209fffb8d70/manifest -avoid_negative_ts disabled -map_metadata -1 -map_chapters -1 dash -start_at_zero -copyts -vsync cfr -y -init_hw_device cuda=cuda: -hwaccel_device cuda -filter_hw_device cuda -nostats 

Any positive input would be appreciated. Thanks in advance!

Per your log pms is using hw nvenc and nvdec.

The cpu usage is still all the non video processing, disk and network io, all going through your virtualization.

Keeping up with high bitrate 4K is still not trivial even with gpu transcoding.

All you have to do is disable hw transcoding to see the difference.

FWIW I have a stack of 3 r610’s that were originally going to be my plex and other servers, but were too old, too slow, too hot, and too loud.

Like I said I was just more so curious if there was something missing or if it just works differently than I had anticipated it would. Like I said, I know it won’t move ALL transcode tasks to the GPU but I was still questioning why it was there seemed to be such a high load on CPU still. It’s not like i’m strapped for cores by any means I can always assign out more, just trying to keep the usage down which means lower power costs & still the ability to stream more than I was able to before.

I assume there was an audio trancode happening on the CPU as well. Add that to the demux,mux and other things happening to deliver it to your device.

Which there are other transcode operations which i do acknowledge can’t be offloaded to the GPU so it’s inevitable that it still may eat up the CPU some but if I recall there is a separate process for audio transcodes that isn’t the plextranscoder process. Would be cooler if there was just a pretty detailed guide that outlined what you should expect from enabling hardware acceleration that way people have expectations set on how it will work because there are some people that might go out and buy a few hundred dollars of hardware that perhaps they cannot return only to find out that it doesn’t work anything like they thought it would & there’s not a whole lot of information out there that helps you easily paint the picture when doing builds/planning.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.