Server Version#: 1.29.2.6273
Player Version#: Apple TV 8.14
I’ve been having trouble getting transcoding fully working in my Ubuntu 22.10 LXC container. Started with the latest PMS version and once I eliminated passthrough issues, I tracked down some posts that matched what my logs were indicating and all those pointed toward downgrading to 1.29.2.
Once I did so, HW transcoding started working again except for any of my 4k content. I know Kaby Lake is capable of HW acceleration for HEVC 10-bit and I now know that my passthrough setup is correct. But I’m hitting a wall and haven’t been able to figure out what the logs are trying to tell me now.
Just attempted, same result and same output in the logs.
Edit: forgot to post errors
Jan 30, 2023 02:10:27.377 [0x7f08c9168b38] Error — [Req#211a86/Transcode/5eqmrig7z23g7vb79tevqrrn/d24aede5-b70e-4adf-8c6a-d2551c6a227f] [AVHWDeviceContext @ 0x7f481129e500] Failed to get number of OpenCL platforms: -1001.
Jan 30, 2023 02:10:27.378 [0x7f08ccca7b38] Error — [Req#211aa7/Transcode/5eqmrig7z23g7vb79tevqrrn/d24aede5-b70e-4adf-8c6a-d2551c6a227f] [AVHWDeviceContext @ 0x7f481129e500] Failed to get number of OpenCL platforms: -1001.
Jan 30, 2023 02:10:27.378 [0x7f08c956eb38] Error — [Req#211aa9/Transcode/5eqmrig7z23g7vb79tevqrrn/d24aede5-b70e-4adf-8c6a-d2551c6a227f] [Parsed_hwmap_2 @ 0x7f480dcdb340] Failed to created derived device context: -19.
Jan 30, 2023 02:10:27.378 [0x7f08c79dcb38] Error — [Req#211aad/Transcode/5eqmrig7z23g7vb79tevqrrn/d24aede5-b70e-4adf-8c6a-d2551c6a227f] [Parsed_hwmap_2 @ 0x7f480dcdb340] Failed to configure output pad on Parsed_hwmap_2
Jan 30, 2023 02:10:27.381 [0x7f08cd790b38] Error — [Req#211aaf/Transcode/5eqmrig7z23g7vb79tevqrrn/d24aede5-b70e-4adf-8c6a-d2551c6a227f] Error reinitializing filters!
Jan 30, 2023 02:10:27.381 [0x7f08c77d9b38] Error — [Req#211ab3/Transcode/5eqmrig7z23g7vb79tevqrrn/d24aede5-b70e-4adf-8c6a-d2551c6a227f] Failed to inject frame into filter network: No such device
Jan 30, 2023 02:10:27.381 [0x7f08c7022b38] Error — [Req#211ab4/Transcode/5eqmrig7z23g7vb79tevqrrn/d24aede5-b70e-4adf-8c6a-d2551c6a227f] Error while processing the decoded data for stream #0:0
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0 0
lxc.idmap: u 0 100000 65536
lxc.idmap: g 0 100000 999
lxc.idmap: g 999 103 1
lxc.idmap: g 1000 101000 64536
And ls -la gives me this inside the container:
total 0
drwxr-xr-x 2 root root 60 Jan 27 16:10 .
drwxr-xr-x 7 root root 500 Jan 27 16:10 ..
crw-rw---- 1 nobody plex 226, 128 Jan 25 20:15 renderD128
As far as I can tell, the GID mapping is correct. I did have to tweak the mapping originally to get HW transcoding working at all, and I’ve assumed it’s correct since then.
Okay, I wrestled with the config again to get full /dev/dri passthrough. Didn’t realize that I needed to change create=file to create=dir, but that seems to have cleaned it up.
Here’s the passthrough config:
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.mount.entry: /dev/dri dev/dri none bind,optional,create=dir 0 0
lxc.idmap: u 0 100000 65536
lxc.idmap: g 0 100000 999
lxc.idmap: g 999 103 1
lxc.idmap: g 1000 101000 64536
And my ls -la /dev/dri output in the container:
total 0
drwxr-xr-x 3 nobody plex 100 Jan 25 20:15 .
drwxr-xr-x 7 root root 500 Jan 30 03:01 ..
drwxr-xr-x 2 nobody plex 80 Jan 25 20:15 by-path
crw-rw---- 1 nobody plex 226, 0 Jan 25 20:15 card0
crw-rw---- 1 nobody plex 226, 128 Jan 25 20:15 renderD128
Additionally, I changed group ownership on /dev/dri in the host to render to simplify group mapping, so the ls -la /dev/dri on the host now produces:
total 0
drwxr-xr-x 3 root render 100 Jan 25 14:15 .
drwxr-xr-x 23 root root 4880 Jan 27 10:09 ..
drwxr-xr-x 2 root render 80 Jan 25 14:15 by-path
crw-rw---- 1 root render 226, 0 Jan 25 14:15 card0
crw-rw---- 1 root render 226, 128 Jan 25 14:15 renderD128
getent group render | cut -d : -f3 on the host gives me 103, and that is the GID I have mapped in the lxc.conf as shown above.
As far as I can tell that should have passthrough fully working, but unfortunately I’m running into the same problem and similar errors output. Logs attached below.
If you’re going to put PMS in a container (versus native on the host where installation setup is automatic ) then set yourself up for this heartburn you’re having now.
Also, PMS is sufficiently well behaved that you don’t need to containerize it and then manage with LXD .
If you’re using ZFS then you’re going to take a performance hit on I/O which will make the database bog down quickly.
Host OS is Proxmox, I’m using it to run several VMs and getting GPU passthrough and transcoding working in a VM was just not happening, so I opted for the LXC route.
As for 22.10, I chose it for no reason other than it was the first Ubuntu template in the list. I’m aware that support will end in July and wouldn’t say I’m married to the choice in any way. Certainly willing to try it on a 22.04 container if there’s a chance it would clear things up.
Lol that much is clear to me now. It works flawlessly for everything else in my stack so it’s been a bummer having to wrestle with Plex so much.
Previously, I had it in a docker container on my unraid server with no transcoding, which was a breeze. The hope was to get it on Proxmox and utilize quicksync with the Kaby Lake box I’ve got. Seems like it’s just on the threshold of 100% functionality and only failing at the OpenCL step with the tone mapping now. That’s my read of it, at least.
Only change I’ve made from that guide at this point is passing through /dev/dri in it’s entirety and adjusting the group permissions.
There were several guides I followed using a VM with GPU passthrough instead but that just never quite came together. And everything I was reading pointed to LXC being the easier option.
Well, happy to report that a brain fart has seemingly solved the problem.
After restoring my 22.10 container as unprivileged, I absentmindedly ran apt upgrade and it pulled PMS 1.30.2.6563. I know for sure that 1.30.2 wasn’t working for me before, because that’s what caused me to downgrade to 1.29.2 in the first place.
However, all of my files seem to be properly utilizing HW transcoding now. No idea what explains this, but it appears something in the process of downgrading to 1.29.2 and then upgrading to 1.30.2 again has solved all of the problems I was having. I’d wager passing through card0 properly was a part of it as well.
Thanks @ChuckPa for all the assistance up to this point!
I do still have my 22.04 container on 1.29.2 that still throws transcode errors if you’d like me to test the clips above and provide results. If not, I’ll probably switch to that one full time since 22.10 is facing end of support in a few months.