It’s a Debian VM running on ESXi with a Tesla T4 card mapped in as vGPU (GRID drivers, no full PCIe passthrough). Regular HW transcoding works fine in this setup.
The „preferred transcoding device“ does only show Auto thought, so I assume PMS itself somehow might not detect the card, the transcoding agent/ffmpeg however utilized it perfectly fine.
When you pass the GPU through to the VM, it must be a physical passthrough of the raw device.
This is not true, because …
If PMS cannot see it on the PCIe bus, then the GPU will not work.
… for the VM and all software on this VM, the vGPU looks like a regular PCIe device.
As I said, x246 HW transcoding works perfectly fine with this setup for quite a while. The problem for HEVC is rooted in a check that PMS seems to do before it shows the corresponding transcoder settings. I can only guess, but most likely PMS enumerates the GPU devices and checks their capabilities.
NVIDIA transcode, compute, etc. in containers works without device mappings (because that’s transparently handled by the specialized nvidia container runtime and the corresponding drivers). Because of that fact, ffmpeg was perfectly fine with transcoding my streams. However, without device mappings, PMS does not see the GPU and can’t perform the capability check.
Long story short, the issue was not related to vGPU at all. After mapping card0/1, renderD128/9 to the container, I was able to activate the new HEVC transcoding option and the transcoding itself works fine too.
Probelmatic? Can you be more specific? There’s nothing wrong with them, CUDA/NVENC etc work without issues. Or do you mean they don’t work with Plex since you’ve made a bad design decision?
Plex is hard checking for renderD128 which is just incredibly stupid. I’m using nvidia-container-toolkit and my HW transcoding works perfectly - except that I was missing the new HEVC option.
The problem is the same. The way GPUs are passed through these containers work perfectly fine for HW Transcoding, CUDA, and other GPU-related tasks. However, the HEVC options are simply not visible, not that HEVC transcoding itself is failing. I suspect, as others have mentioned, that this is due to a design limitation in Plex that only shows these options if the GPUs can be listed in Hardware Transcoding Device even though that is not the central requirement to do HW Transcoding.
Regardless, if this is required, can you share a similar solution for Docker for Windows/WSL2 to passthrough the GPU in such a way that it allows to be seen by the way Plex is checking. Nothing I saw online is helping because the standard way of passing it through (as shared in my link) simply works for other usecases.
I just checked in WSL2 and it seems like Windows exposes “a” GPU device to the WSL subsystem. Not sure, if this is the correct GPU, but it’s worth a try.
Chris and I have been discussing this all morning.
We’d like to share info and then ask for your help with this Windows - WSL2 - Docker issue.
What we know:
Plex HW transcoding / GPU discovery requires the GPU be visible in the kernel DRM layer (How rendering is done on Linux).
PMS Docker is Ubuntu based
WSL2 is a LL VM (Linux based) from Microsoft
In order to make Docker-based HW transcoding work, we need to get the HW visible: Windows host → WSL2 VM → Docker container → PMS app.
To date, we have not been able to get the GPU into WSL2 LLVM
Our request is simple:
How do we get the GPU from the Windows host → the Docker container as a PHYSICAL device for the Nvidia drivers to identify and use it correctly ( render and cuda tone mapping )
Secondarily, this will have impact on other platforms. Since Windows is popular, it seems this is a good place to start
Hi @ChuckPa, I don’t have a concrete answer to this question, but want to share my observations:
Docker HW transcoding already works perfectly fine on Debian and Windows WSL2 without physical device mapping!
GPU discovery (which is used to conditionally show the HEVC option) does not work on Docker without mapping the physical cardX/renderDxxx devices (only tested on Debian) - Device dropdown always displays “Auto”, but HW transcoding still works and uses the correct GPU.
This tells me that the Nvidia Drivers (and runtime) do not require a physical device to be mapped into the container.
You should probably get away with just refactoring the GPU discovery / capability check. A very easy way would be to start a dummy transcoding and check the result/status code from the Nvidia API to determine if the GPU has the required capabilities.
Checking the ffmpeg source code might be another way to find out how this tool is able to do HW transcoding without a device being mapped into the container.
I tried doing this, but it still does not work. But as you mentioned, it should not be relevant. nvidia-smi and HW Transcoding and CUDA all work with just adding the below to your compose. I suspect this is purely because of the check being run to make the options even appear, not the actual capability of the environment to run HEVC transcoding.
Since the OP is actually a completely different environment w ith the same issue, I also agree that the better course of action is to reevaluate the logic on showing the options.
I use Docker for Windows/WSL2. The GPU Discovery is still failing with this version. I tried with below two compose options, neither worked. The difference is mapping the video card as a device, though HW Transcoding doesn’t even require that, the first compose works fine.
I tried to do some research on this, but to be honest, I’m not super comfortable doing this in my environment. I am not sure how a native fresh install will impact my existing database running through Docker, but my instinct is to not risk it. I am usually happy to help test, but this one feels like it could be a bit dicey