Server can't reproduce fluently 4k files

Server Version#: 1.40.0.7998
Player Version#:1.007.000 (PS5 app)

Hi everyone! I’ve been experiencing some performance issues when trying to play 4k files.

I have a Plex server running on TrueNAS (as a Docker app), which works perfectly for most files. However, I’ve noticed problems with certain large files, particularly 4k movies, experiencing slow buffering times.

Upon checking the server status, I found that the CPU usage is around 30%, yet the buffering remains slow. What hardware upgrades do I need to better handle these files?

My current setup includes an i7-12700k CPU, 46GB of RAM, and the files are stored on the same server using RAIDZ1 (mechanical disk, however when attempting to play the same file directly from my computer (by double-clicking the SMB file), it plays smoothly)

This cannot be diagnosed from a screenshot which looks like it’s been made to analyze a whole bunch of files.

“maintenance_script” ? what’s this?

Is this what you’re doing with it ?

Server DEBUG log files ZIP will be needed to figure this out

Hi ChuckPa!.
hahaha, don’t worry about maintenance_script that is folder for another server I was working, nothing for this server, I don’t know why terminal show this on the top. :sweat_smile:

by the way, I here is the log, I capturing from start movie, no more than 30s and the reproduction has closed showing “error occurred” on player (ps5)
plex_log.txt.zip (11.1 KB)

While a lot of people like htop, it also gets them in trouble :stuck_out_tongue: :rofl:

Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: hardware transcoding: testing API nvenc for device '' ()
Feb 26, 2024 21:14:19.106 [139997403794232] Error — [Req#1e013b/Transcode] [FFMPEG] - Cannot load libcuda.so.1

Feb 26, 2024 21:14:19.106 [139997403794232] Error — [Req#1e013b/Transcode] [FFMPEG] - Could not dynamically load CUDA

Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Operation not permitted
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Could not create hardware context for h264_nvenc
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] MDE: Cannot direct stream video stream due to profile or setting limitations
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: testing hevc (decoder) with hwdevice vaapi
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: hardware transcoding: testing API vaapi for device '' ()
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Generic error in an external library
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Could not create hardware context for hevc
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: testing hevc (decoder) with hwdevice nvdec
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: hardware transcoding: testing API nvdec for device '' ()
Feb 26, 2024 21:14:19.106 [139997403794232] Error — [Req#1e013b/Transcode] [FFMPEG] - Cannot load libcuda.so.1

Feb 26, 2024 21:14:19.106 [139997403794232] Error — [Req#1e013b/Transcode] [FFMPEG] - Could not dynamically load CUDA

Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Codecs: hardware transcoding: opening hw device failed - probably not supported by this system, error: Operation not permitted
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] Could not create hardware context for hevc
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] MDE: MOVIEFILE: Audio Direct Streaming is disabled, so video's audio stream will be transcoded
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] MDE: Cannot direct stream audio stream due to profile or setting limitations
Feb 26, 2024 21:14:19.106 [139997403794232] Debug — [Req#1e013b/Transcode] MDE: MOVIEFILE: selected media 0 / 10999

are you doing a full passthrough of /dev/dri into the container as a device ?

“Operation not permitted” is not a common (nor a reasonable) error.
There’s something bigger afoot.

Whose image are you using?

em… I don’t know what do you mean abuth to passthrough for /dev/dri :thinking:
I use a shop container image

I don’t have truenas (or access to one) to know how it looks but you should have,
when you create the container,

Somewhere you should be able to pass through the GPU

This is Unraid.

Yes, I know very well what you’re being through. My setup relies on 2 Xeon E5-2698v3, 64 cores! And I can play only ONE 4K session at a time. I solved this installing a Nvidia GPU…

@ftrentini

I have a E5-2690v4 and even without the Nvidia GPU, I can still transcode 2 sessions.
Interesting you’re having trouble.

Granted, I have fewer cores and a slighltly higher overall performance (resulting in faster per-core speed) it shouldn’t be that bad.

If you’ve got subtitles being burned – that’ll be your nemesis

1 Like

o… I don’t have GPU now, Is a mandatory for this transcode? what is the best option? (and yes, I use subtitle burned because some subtitule failed on ps5 and TV :sweat_smile:

@ftrentini what GPU do you use? how many session do you can have using this?

@ChuckPa Never been a trouble, there are a lot of workarounds, like optimizing. And yes, subtitles are being burned all the time. But I noticed when I run my server on bare metal, it works better than when virtualized, which is the case.

@Clein I use a bypassed GTX1060, and I don’t really know how many sessions my server can transcode. What I know is I’m not having any more problems reported by my family members when they’re watching their TV shows. :sweat_smile:

@Clein

GPU is NOT required.
If you’re transcoding 4K → something lower resolution then it helps.
if you’re transcoding ANY resolution → lower bitrate then it helps.

Media curation (the contents of the file) is the most important part of this whole game.
– Don’t keep streams which you don’t need
– Avoid PGS subtitles wherever possible (for now – we’re working on this)

One of my development machines is a little JasperLake Beelink type.
It can transcode 4K to 1080p easily – 4 concurrent streams – with tonemapping.

Here’s where I showed a user

@ChuckPa What do you mean by “Don’t keep streams you don’t need”?

I’ve seen a lot of things folks download.

Some files contain dozens of subtitles and audio tracks.
Some files even contain multiple resolutions.

The ‘cleaner’ the file, the better.

I use MKVtoolnix / MKVmerge when I rip from BluRay to ensure I only keep what I know I’ll need for everyone.

I also finally got some decent upload speed (200 Mbps) which means, without PGS subtitles, everything is DirectPlay or DirectStream(audio conversion only)

1 Like

Checking plex configuration for docker, I find this settings, can this a problem?, how much CPU/Memory limit I need to added?

image

Right there – see the “Allocate x GPU” ?

The Intel QSV is “i915” GPU. allocate 1 and assign it to the container.

the 0 is only option :cold_sweat:

that can be a problem from truenas? :thinking:
image

— edit
Checking isolate GPU, I can’t isolate intel gpu if is only one :thinking: , I thinking is a TrueNas limitation? probably I need added a GPU here :cold_sweat:
image

TtrueNAS issue

You need to get on the command line,
See which GID has /dev/dri

QSV passthrough is native to Linux.
Drivers already exist in the kernel.

TrueNAS core supported QSV. It would really suck if they no longer include the i915 driver

the /dev/dir has only root access, probably docker can’t use this… this need access container? what job need and for what ?

And how could this affect the transcoding of big files?

show me the ls -lan. Normal UDEV operation will show owned by root with a GID assigned

something like this

[chuck@lizum ~.2000]$ ls -lan /dev/dri
total 0
drwxr-xr-x   3 0   0      140 Feb 27 08:18 ./
drwxr-xr-x  21 0   0     5400 Feb 27 08:18 ../
drwxr-xr-x   2 0   0      120 Feb 27 08:18 by-path/
crw-rw----+  1 0 109 226,   0 Feb 27 08:18 card0
crw-rw----+  1 0 109 226,   1 Feb 27 08:18 card1
crw-rw----+  1 0 109 226, 128 Feb 27 08:18 renderD128
crw-rw----+  1 0 109 226, 129 Feb 27 08:18 renderD129
[chuck@lizum ~.2001]$

Not having this means the CPU must do all the work.

All the CPUs, with exception of the “F” series, have GPU capability

nothing here (on truenas)

sturen@TrueNas:/dev/dri$ ls -lan /dev/dri
total 0
drwxr-xr-x  2 0 0   40 Feb  8 19:02 .
drwxr-xr-x 22 0 0 4280 Feb  8 19:02 ..

:thinking: on the docker, dri folder not exist