plex docker HW transcode synology

Plex synology package is not compatible for hardware transcoding on intel synology NAS like DS916+ using intel quicksync

you cas see this post


Is the HW transcode enable in the plex for docker package on synology ?

No. The preview release of HW transcoding was not for Synology. Synology’s GPU is not accessible to PMS (proprietary / without DSM runtime libraries). To use HW transcoding in the other environments (Windows, Linux, and OS X), the appropriate software libraries have to be installed first by the user (such as installing the nVidia drivers on Windows would do)

@ChuckPA said:
No. The preview release of HW transcoding was not for Synology. Synology’s GPU is not accessible to PMS (proprietary / without DSM runtime libraries). To use HW transcoding in the other environments (Windows, Linux, and OS X), the appropriate software libraries have to be installed first by the user (such as installing the nVidia drivers on Windows would do)

DO you anticipate hardware transcoding for the SYnology NAS in the not too distant future? I just purchased a DS916+ thinking it could replace an old mac mini but the CPU is maxing out at 3 transcoding streams causing buffering on all devices. I may need to cry and return it if you say No…

I know hardware transcoding is a strong effort in engineering. We were all introduced to it with the ā€˜forum preview release’ with release 1.4.1. It stands to reason they’re working on it. Knowing how many are in need of HW assisted transcoding for NAS devices, I would expect it much sooner than later but I’m not part of that engineering-internal discussion. I, as an engineer in my own right, know the simple combinatorics of different ā€˜hardware configurations’ is staggering. How they address it is what we’ll learn when they’re in a position to tell us and, most likely, as they unveil the first supported processor types.

I do know, Synology-proprietary hardware transcoding will be on a different timetable if supported at all solely because Synology is the gating factor concerning basic accessibility and number of user who can benefit.

Intel GPU (built in) are much more viable for the majority of users, myself included, who happens to have a compatible GPU in my desktop’s CPU (i was quite surprised). My C2538 does not have a GPU so I wasn’t surprised there.

I’m using the hw-transcode preview under docker on a DS916+ without issue.

I did put together a Docker SPK based off the latest docker binaries as the synology docker has issues with with the --device switch, but even with the synology docker you can make it work by starting the container in privileged mode which passes through the /dev folder.

Inside the container you will have to chmod the /dev/dri/renderD128 file to that the device is accessible to docker.

@sn00p said:
I’m using the hw-transcode preview under docker on a DS916+ without issue.

I did put together a Docker SPK based off the latest docker binaries as the synology docker has issues with with the --device switch, but even with the synology docker you can make it work by starting the container in privileged mode which passes through the /dev folder.

** Inside the container you will have to chmod the /dev/dri/renderD128 file to that the device is accessible to docker** .

Can you elaborate on how you do this?

Maybe some pointers? :slight_smile:

Cheers

@lysin said:

@sn00p said:
I’m using the hw-transcode preview under docker on a DS916+ without issue.

I did put together a Docker SPK based off the latest docker binaries as the synology docker has issues with with the --device switch, but even with the synology docker you can make it work by starting the container in privileged mode which passes through the /dev folder.

** Inside the container you will have to chmod the /dev/dri/renderD128 file to that the device is accessible to docker** .

Can you elaborate on how you do this?

Maybe some pointers? :slight_smile:

Cheers

Brief instructions for The Synology docker:

  • create the docker container using the plex docker image, YOU MUST SELECT IT TO RUN IN PRIVILEGED MODE!
    You will need to set all your mounts etc in the container in the synology docker GUI

  • start the docker container

  • ssh to your DS916+ and then execute the command:

sudo docker exec -it {container name>} /bin/bash

You will then get an SSH terminal inside the container:

execute:

curl -J -L -o /tmp/plexmediaserver.deb {put the linux 64 bit url from the hw transcode thread in plex pass}.deb
dpkg -i /tmp/plexmediaserver.deb
echo 1.4.0.3173-04b80c8>/version.txt
chmod 777 /dev/dri/renderD128

  • then restart the container, connect to the plex server web interface and you should see that the plex version matches the one from the hardware transcode thread, if it doesn’t then your plex might have updated, disable auto update and retry installing the deb package from above. (If you miss out the echo command plex will replace the preview version with another one, it’s important)

  • Go to the server settings and enable the hardware transcoder.

Should then be working, play something that needs transcoding of video and you will see ā€œ(hw)ā€ in the whats playing info and your CPU won’t be melting.

I don’t use the synology docker, I use the latest docker binaries with a SPK I created so I do all my stuff either from the command line or using portainer which I have running in a docker container.

Edit:

Forum remove some bits in triangle braces, so now in curly braces

Thanks sn00p.

I managed to get it working fairly easy.

HW transcoding tested working fine on my DS916+, but I did have one problem with it. The transcoded stream only worked for about 2-3 mins at a time. After that, the stream would stop and appear as buffering.

It shows promise tough. Really glad us synology users have at least an option.

I don’t use the synology docker, I use the latest docker binaries with a SPK I created so I do all my stuff either from the command line or using portainer which I have running in a docker container.

I’m willing to test this out this weekend, but I’m wondering if you plan to keep this alternate SPK updated and if you have a post here (or in synology forums maybe) regarding that SPK where we could discuss it.

Anyway, really glad someone is having the same troubles as me and working on a way around them!

Cheers and thanks for the help. Much appreciated.

@lysin said:
Thanks sn00p.

I managed to get it working fairly easy.

HW transcoding tested working fine on my DS916+, but I did have one problem with it. The transcoded stream only worked for about 2-3 mins at a time. After that, the stream would stop and appear as buffering.

It shows promise tough. Really glad us synology users have at least an option.

I don’t use the synology docker, I use the latest docker binaries with a SPK I created so I do all my stuff either from the command line or using portainer which I have running in a docker container.

I’m willing to test this out this weekend, but I’m wondering if you plan to keep this alternate SPK updated and if you have a post here (or in synology forums maybe) regarding that SPK where we could discuss it.

Anyway, really glad someone is having the same troubles as me and working on a way around them!

Cheers and thanks for the help. Much appreciated.

Hi,

Glad you got it working!

I haven’t seen the issue that you have mentioned, I’m just running a transcoding video session here and it is working fine, maybe it’s an issue with the Plex client you are using?

The SPK is over at the synology forum (in the third party section) with some instructions, as you need to remove the synology docker you will lose the GUI - however I use portainer as a gui (which has the advantage you can map it to a domain name and just have it appear on a virtual server on your network).

Included instructions on how to install portainer, it installs as a docker container itself, so it’s all very neat!

Most important, you can then use the --device flag instead of running in privileged mode and when the 916 restarts the containers restart (start them with he restart flag).

I need to package up the script I use to build the SPK (just archives stuff in the correct way) so that it’s easy for anybody else to update, you could just drop the latest binaries into it when they’re updated and upgrade the docker installation.

My main motivation of using a non synology provider docker was so that containers restarted correctly which they don’t with the official synology docker.

@lysin said:
Thanks sn00p.

I managed to get it working fairly easy.

HW transcoding tested working fine on my DS916+, but I did have one problem with it. The transcoded stream only worked for about 2-3 mins at a time. After that, the stream would stop and appear as buffering.

It shows promise tough. Really glad us synology users have at least an option.

I don’t use the synology docker, I use the latest docker binaries with a SPK I created so I do all my stuff either from the command line or using portainer which I have running in a docker container.

I’m willing to test this out this weekend, but I’m wondering if you plan to keep this alternate SPK updated and if you have a post here (or in synology forums maybe) regarding that SPK where we could discuss it.

Anyway, really glad someone is having the same troubles as me and working on a way around them!

Cheers and thanks for the help. Much appreciated.

Hi @lysin,

You probably saw in the hw transcoding thread that I was able to replicate this. I hadn’t released there was a newer version of the server as they didn’t change the thread title, so I just assumed we were still on the same one.

Yes, with the latest one there are issues on playback either stopping or ā€œpausingā€ (tried with both iPhone client and Plex for Kodi).

Works perfectly with the previous version of the server as you said, something is slightly broken with the newer release though.

+1 for this!

@sn00p said:
I’m using the hw-transcode preview under docker on a DS916+ without issue.

I did put together a Docker SPK based off the latest docker binaries as the synology docker has issues with with the --device switch, but even with the synology docker you can make it work by starting the container in privileged mode which passes through the /dev folder.

Inside the container you will have to chmod the /dev/dri/renderD128 file to that the device is accessible to docker.

Hi @sn00p,

I’m wondering if you made your Docker SPK available and in that case where? I would love to update my docker version to the latest.

@ingemar.strandberg@gmail.com said:

@sn00p said:
I’m using the hw-transcode preview under docker on a DS916+ without issue.

I did put together a Docker SPK based off the latest docker binaries as the synology docker has issues with with the --device switch, but even with the synology docker you can make it work by starting the container in privileged mode which passes through the /dev folder.

Inside the container you will have to chmod the /dev/dri/renderD128 file to that the device is accessible to docker.

Hi @sn00p,

I’m wondering if you made your Docker SPK available and in that case where? I would love to update my docker version to the latest.

https://forum.synology.com/enu/viewtopic.php?f=190&t=128339

There’s a few people using this instead of the synology docker now! There’s an issue with after boot any containers using bridge networking can’t access the net because the iptables rule is wrong, but a restart (or manually setting) the rule fixes this. It’s only a problem after a restart of the NAS, not under any other circumstance. Works fine with host networking.

Been running this (and Plex, unifi controller, plexpy, portainer and a whole load of other containers) for months and months without any problems. Only thing is, it has to be installed on a volume which is ext4, cannot be btrfs. At some point the docker devs disabled the ability to use aufs on a btrfs volume because of data corruption…this is probably why the docker binary that synology use is an old one before this was disabled!

Think about what btrfs is. It’s a level of RAID on top of your existing RAID volume but entirely built into the file system itself. The simple question is Why?

Secondly, it’s new and has no established track record. As you’ve pointed out, there is corruption. Significant corruption reports. If you have a single-disk volume and that’s all you have, it’s better than nothing but when using a Synology who uses single-disk volumes?

Should anyone want to have absolute protection and recovery from bit rot? Raid 6 and monthly scrub. RAID 6 not only detects an error, it knows whether the parity is bad or the data and makes the appropriate correction.

I have a simple recommendation to anyone using RAID: Use ext4 formatting only.

@sn00p said:

@ingemar.strandberg@gmail.com said:

@sn00p said:
I’m using the hw-transcode preview under docker on a DS916+ without issue.

I did put together a Docker SPK based off the latest docker binaries as the synology docker has issues with with the --device switch, but even with the synology docker you can make it work by starting the container in privileged mode which passes through the /dev folder.

Inside the container you will have to chmod the /dev/dri/renderD128 file to that the device is accessible to docker.

Hi @sn00p,

I’m wondering if you made your Docker SPK available and in that case where? I would love to update my docker version to the latest.

https://forum.synology.com/enu/viewtopic.php?f=190&t=128339

There’s a few people using this instead of the synology docker now! There’s an issue with after boot any containers using bridge networking can’t access the net because the iptables rule is wrong, but a restart (or manually setting) the rule fixes this. It’s only a problem after a restart of the NAS, not under any other circumstance. Works fine with host networking.

Been running this (and Plex, unifi controller, plexpy, portainer and a whole load of other containers) for months and months without any problems. Only thing is, it has to be installed on a volume which is ext4, cannot be btrfs. At some point the docker devs disabled the ability to use aufs on a btrfs volume because of data corruption…this is probably why the docker binary that synology use is an old one before this was disabled!

Thanks for your detailed answer!

I’ve actually been testing that package a bit but I’ve been having problems with docker-compose and networking that I havn’t been able to solve.

@ingemar.strandberg@gmail.com said:

@sn00p said:

@ingemar.strandberg@gmail.com said:

@sn00p said:
I’m using the hw-transcode preview under docker on a DS916+ without issue.

I did put together a Docker SPK based off the latest docker binaries as the synology docker has issues with with the --device switch, but even with the synology docker you can make it work by starting the container in privileged mode which passes through the /dev folder.

Inside the container you will have to chmod the /dev/dri/renderD128 file to that the device is accessible to docker.

Hi @sn00p,

I’m wondering if you made your Docker SPK available and in that case where? I would love to update my docker version to the latest.

https://forum.synology.com/enu/viewtopic.php?f=190&t=128339

There’s a few people using this instead of the synology docker now! There’s an issue with after boot any containers using bridge networking can’t access the net because the iptables rule is wrong, but a restart (or manually setting) the rule fixes this. It’s only a problem after a restart of the NAS, not under any other circumstance. Works fine with host networking.

Been running this (and Plex, unifi controller, plexpy, portainer and a whole load of other containers) for months and months without any problems. Only thing is, it has to be installed on a volume which is ext4, cannot be btrfs. At some point the docker devs disabled the ability to use aufs on a btrfs volume because of data corruption…this is probably why the docker binary that synology use is an old one before this was disabled!

Thanks for your detailed answer!

I’ve actually been testing that package a bit but I’ve been having problems with docker-compose and networking that I havn’t been able to solve.

Ahh, I guess you’re the guy from the thread. Sorry, I don’t use docker-compose!

@ChuckPA said:
Think about what btrfs is. It’s a level of RAID on top of your existing RAID volume but entirely built into the file system itself. The simple question is Why?

Secondly, it’s new and has no established track record. As you’ve pointed out, there is corruption. Significant corruption reports. If you have a single-disk volume and that’s all you have, it’s better than nothing but when using a Synology who uses single-disk volumes?

Should anyone want to have absolute protection and recovery from bit rot? Raid 6 and monthly scrub. RAID 6 not only detects an error, it knows whether the parity is bad or the data and makes the appropriate correction.

I have a simple recommendation to anyone using RAID: Use ext4 formatting only.

Absolutely. I love the way that Synology haven’t pulled the package though, they must be aware theres a potential problem of it yet they can’t update because most peoples systems will be formatted as btrfs as that’s the default!

ext4 ftw!

curl -J -L -o /tmp/plexmediaserver.deb {put the linux 64 bit url from the hw transcode thread in plex pass}.deb

Hi @sn00p ! I would very much like to do this, but don’t know what you’re talking about here. Where’s that binary?

1 Like

Now that 1.4 is out, I was about the get this working with the Synology Docker based on guide from @sn00p

  1. sudo chmod 777 /dev/dri/renderD128
  2. Make sure your Plex Container is up to date (> 1.4)
  3. Export settings
  4. Add the following to the json file
    "devices": [{"CgroupPermissions": "rwm", "PathInContainer": "\/dev\/dri", "PathOnHost": "\/dev\/dri"}],
  5. Delete container
  6. Import edited settings file
  7. Start container, and enable Hardware Transcode in settings.

That is it!

3 Likes

i have the latest plex pass docker up and running with version 1.12.3.4973 that I download and installed according to @sn00p instructions.

As a test I try to sync a 720p hvec mkv file to my iPhone 8. The docker version was hovering at about 22% for 2.3x conversion average. The standard plex spk immediately shoots to 100% cpu.

When I play a 1080p 8bit HVEC file to an old Macbook Air the cpu usage drops to 7-9% as I play the file.
Using the SPK cpu usage spikes to 100%

When I play a 1080p 10bit HVEC file to an old Macbook Air the cpu usage I get 90% CPU usage I play the file.
Seems that 10bit hardware transcoding is not running well or not supported (yet)

For people that are new to docker: here is a good guide https://blog.rylander.io/2016/11/19/install-plex-on-synology-nas-using-docker/

  1. Pull the latest plex pass docker as described above and set it up
    make sure it is started before the next steps
  2. Get the url for the latest plex version from the download section: currently https://downloads.plex.tv/plex-media-server/1.12.3.4973-215c28d86/plexmediaserver_1.12.3.4973-215c28d86_amd64.deb
  3. ssh to your synology nas
  4. sudo -i
  5. docker exec -it /bin/bash
  6. curl -J -L -o /tmp/plexmediaserver.deb https://downloads.plex.tv/plex-media-server/1.12.3.4973-215c28d86/plexmediaserver_1.12.3.4973-215c28d86_amd64.deb
  7. echo 1.12.3.4973-215c28d86 >/version.txt
  8. dpkg -i /tmp/plexmediaserver.deb
  9. chmod 777 /dev/dri/renderD128
  10. restart the container