Discussion HW transcoding from Docker - solution for Hetzner dedicated and info for other servers

turner123

Blitz 1st Class
Donor
83
31
Yes agreed, i set this up on the hetzner server today was supposed to get a 6700 but got a 7700 HW transcode 4k to 1080 hardly touched the system were as all 8 cores used to be at 100%

Thank you
 

mobo

Blitz 3rd Class
Donor
Donor
15
2
Just in case some people experience the same than me:
I followed the instructions of this post. It did not work. I already gave up.

But somehow over night it now works. Maybe plex or tautulli are delayed in recognizing HW transcoding availability. Maybe it can only switch to HW transcoding as soon as no single stream is running.
 
Last edited:

antigravity

Blitz 1st Class
54
6
Strange. I can't get HW transcoding to work with a i7-7700.

Installed via the PGBlitz menu

i915 driver is showing as active
Plex Pass active (I hardware transcode on other servers)
Hardware Transcoding ticked in Plex

I noticed the /dev/dri folder didn't have 777 permissions so I updated those also. No change.

Nevermind// Installed the Plex Pass container and it now works. Didn't realise the Plex Pass Container had different work done to it.
 
Last edited:

Porkie

Blitz Sergeant
Staff
123
50
Try adding /dev/dri to the container using portainer.



You also need to enable privileged mode as far as Im aware.
 

MrDoob

Administrator
Project Manager
Donor
1,218
324
Simple reading °!°


For Hetzner server users, the following is how to get the drivers and capability installed on the Linux host.

  • Comment out all line referencing i915 in this file: /etc/modprobe.d/blacklist-hetzner.conf
    • sudo nano /etc/modprobe.d/blacklist-hetzner.conf
    • Add a # in front of the lines "blacklist i915" and "blacklist i915_bdw"
    • # blacklist i915
    • # blacklist i915_bdw
  • Remove Hetzner's default grub config "nomodeset" which blocks loading of video card drivers:
    • Ubuntu 16 or earlier: nano /etc/default/grub.d/hetzner.cfg or
    • Ubuntu 18.04 or later: nano /etc/default/grub
    • comment out GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" (it's okay if it also has consoleblank=0 at the end."
    • # GRUB_CMDLINE_LINUX_DEFAULT="nomodeset consoleblank=0"
  • Update and Reload grub.
    • sudo update-grub
    • For older Ubuntu try sudo grub-mkconfig -o /boot/grub/grub.cfg
  • Add user root (or whoever is the user running the Plex service) to the video group:
    • sudo usermod -a -G video root
  • Reboot the server
  • Try ls -la /dev/dri now it should find the folder and list drivers
  • Type chmod -R 777 /dev/dri to change permissions (critical step for use in Docker!)
  • I recommend installing and running vainfo and ensure it gives you a positive readout on your driver
    • sudo apt update
    • sudo apt install vainfo
    • vainfo
      • You want a line similar to "vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Server - 1.7.0" somewhere in the 18-20 lines it puts out.
Note: If VAINFO works, it's almost a sure bet you'll be able to get the Docker Plex to work. However, as long as the /dev/dri folder with the two driver files are there, you're probably okay even if running VAINFO throws an error.
 
  • Sweat
Reactions: timekills

28061

Blitz 3rd Class
10
2
I completed the tutorial without error, but don't get the hardware encoding tag listed.
I'm a plex pass user. HW encoding is enabled in the plex settings.
I'm using a Hetzner dedicated server with an Intel® Core™ i7-6700 Quad-Core, which is Quick Sync Video enabled (source)
My output from ls -la /dev/dri is
Code:
drwxrwxrwx  3 root root       100 May  3 22:37 .
drwxr-xr-x 19 root root      4120 May  3 22:37 ..
drwxrwxrwx  2 root root        80 May  3 22:37 by-path
crwxrwxrwx  1 root video 226,   0 May  3 22:37 card0
crwxrwxrwx  1 root video 226, 128 May  3 22:37 renderD128
My output from vainfo is
Code:
error: can't connect to X server!
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Kaby Lake - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSlice
      VAProfileVP9Profile2            : VAEntrypointVLD
[email protected]:~$
Any ideas at all please?
 

MrDoob

Administrator
Project Manager
Donor
1,218
324
@28061

Getting it working (optimally) inside Docker.

The following updates to the Plex Docker container are not strictly necessary - but recommended.

You'll need to run the following commands from the HOST (to make it easier for you):

  • docker exec plex apt-get -y update
  • docker exec plex apt-get -y install i965-va-driver vainfo
  • docker restart plex
That updates the driver now that it can get to the files outside the container.

Additional tips/tricks:

The following command should give a succinct info read on your iGPU:

GPU=$(lspci | grep VGA | cut -d ":" -f3);RAM=$(cardid=$(lspci | grep VGA |cut -d " " -f1);lspci -v -s $cardid | grep " prefetchable"| cut -d "=" -f2);echo $GPU $RAM
 

timekills

Blitz Samurai
Original poster
Staff
Donor
397
167
I completed the tutorial without error, but don't get the hardware encoding tag listed.
I'm a plex pass user. HW encoding is enabled in the plex settings.
I'm using a Hetzner dedicated server with an Intel® Core™ i7-6700 Quad-Core, which is Quick Sync Video enabled (source)
My output from ls -la /dev/dri is
Code:
drwxrwxrwx  3 root root       100 May  3 22:37 .
drwxr-xr-x 19 root root      4120 May  3 22:37 ..
drwxrwxrwx  2 root root        80 May  3 22:37 by-path
crwxrwxrwx  1 root video 226,   0 May  3 22:37 card0
crwxrwxrwx  1 root video 226, 128 May  3 22:37 renderD128
My output from vainfo is
Code:
error: can't connect to X server!
libva info: VA-API version 1.1.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_1
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.1 (libva 2.1.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Kaby Lake - 2.1.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Simple            : VAEntrypointEncSlice
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointEncSliceLP
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      : VAEntrypointVLD
      VAProfileH264MultiviewHigh      : VAEntrypointEncSlice
      VAProfileH264StereoHigh         : VAEntrypointVLD
      VAProfileH264StereoHigh         : VAEntrypointEncSlice
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSlice
      VAProfileVP9Profile2            : VAEntrypointVLD
[email protected]:~$
Any ideas at all please?
I assume you've restarted the Plex Docker since you did the HW driver install?
The above looks good; correct folders, correct file size, correct permissions and VAInfo showing good to go.

I'd confirm that the video you're trying to transcode is one that need.transcoding. I.E. try a 1080p h264 video from a web browser and force it to play at a 720p or lower resolution
 

astroshare

Blitz Sergeant
Donor
122
35
I couldn't get this to work either on my EX-52NVME box, until I added the setting mentioned by @Porkie in post #85, to the plex container in portainer.
 
Last edited:

timekills

Blitz Samurai
Original poster
Staff
Donor
397
167
I couldn't get this to work either on my EX-52NVME box, until I added the setting mentioned by @Porkie in post #85, to the plex container in portainer.
I believe that's in the main instructions, although if you use the built into PGB menu script that @MrDoob created it does it for you.

Technically you shouldn't have to add the /dev/dri folder as it's done by default now in the Plex install script, but if it isn't for some reason, you can either run the script from the menu, add it through Portainer, or edit the Plex install files to include it (again - as per the instructions in the first post for more detail.)
 
  • Love
Reactions: Admin9705

astroshare

Blitz Sergeant
Donor
122
35
I believe that's in the main instructions, although if you use the built into PGB menu script that @MrDoob created it does it for you.

Technically you shouldn't have to add the /dev/dri folder as it's done by default now in the Plex install script, but if it isn't for some reason, you can either run the script from the menu, add it through Portainer, or edit the Plex install files to include it (again - as per the instructions in the first post for more detail.)
Setting was not in the container, and it was a fresh install with latest version.
 

kamos69

Blitz 1st Class
Donor
96
53
I couldn't get this to work either on my EX-52NVME box, until I added the setting mentioned by @Porkie in post #85, to the plex container in portainer.
This happens if you install Plex before you make the config changes to the server. The Plex recipe does a check to see if the /dev/dri folder is accessible, if it isn't, then it doesn't add the path to the container.

If you redeploy Plex the path will be added to the container.
 
  • Like
Reactions: timekills

kamos69

Blitz 1st Class
Donor
96
53
On a different note, is there anyone that has actually load tested igpu? How many concurrent transcodes can it handle? On my server it couldn't do more than 25 1080p concurrent transcodes before it would crash.
 

MrDoob

Administrator
Project Manager
Donor
1,218
324
On a different note, is there anyone that has actually load tested igpu? How many concurrent transcodes can it handle? On my server it couldn't do more than 25 1080p concurrent transcodes before it would crash.

Why you want 25 transcode

Normal is 4 - 8 as best option

All more is pain
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.


Development Donations

 

Trending