- Sep 12, 2018
- 385
- 199
NOTE: You MUST have Plex Pass to enable hardware transcoding in the Plex server. See Using Hardware-Accelerated Streaming from the Plex site.
NOTE 2: the default PlexGuide install for Plex now includes the pass through of the driver folders from the host server to the Docker container, making this process much simpler.
NOTE 3: Hetzner has also posted a short instruction page for their servers at https://community.hetzner.com/tutorials/howto-enable-igpu
-------------------------------------------------------------------------------------
Background/quick check:
This assumes your server has a CPU with iGPU or GPU that can do hardware transcoding. If you do, and the drivers are already installed, then the fix to get it working inside the Plex Docker container isn't too difficult.
Bottom line up front: If the hardware and drivers aren't installed on the host, it won't work inside the Docker container. If they are, I'll show you how to ensure they're available inside the Docker container as well.
You can do a quick check to see if the drivers are already installed by "ls -la /dev/dri"; you should see something for "card0" and "renderD128" if they are.
--If you have multiple GPUs, including an integrated (iGPU) and a discrete (i.e. nVidia or AMD) you'll probably see additional files labeled "card1" and "renderD129". This won't matter, but we also will only use one card.
If the driver files don't exist you'll likely get an error saying the directory doesn't exist, or maybe drivers for other non-GPU/iGPU devices. That's fine - the "Host Install" sections will show you how to "activate" them.
If they are, and you're sure, you can skip the next part in between the dashed lines and move to how to enable inside the Docker container.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does my Intel CPU include an iGPU capable of Quick Sync?
Most "desktop" class CPUs from Intel starting with the second series (i.e. "Sandy Bridge" or the 2500/2600 CPUs) have an iGPU that is capable of at least h264 hardware transcoding.
- The Sandy Bridge (2xxx series) through Haswell (4xxx) series don't have great quality when hardware transcoding h264 - but they do work.
- Skylake (6xxx) and higher will even do h265/HEVC.
- Kaby Lake (7xxx) and higher will do h265/HEVC with HDR/10bit video.
Skylake and higher look GREAT when using hardware encoding - virtually indistinguishable in quality from CPU encodes, but with 5% of the CPU usage.
I have a Xeon - will it work?
Some Xeons do have iGPUs. Notably those that end in a "5" or "6".
How can I confirm?
Fast check: https://ark.intel.com/content/www/u...ProcessorGraphics=19001&0_QuickSyncVideo=True
Search for your CPU.
or
https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video#Microsoft_Windows
For example, using a Xeon E5-1650v3.
Look for the E5-1650v3 series. This is a "Haswell" class CPU, but it was sold as a workstation CPU so note there is no "Graphics Clock Rate" column, because they didn't have iGPUs. (They also didn't come with heatsinks, as the users were expected to add discrete GPUs and their own heatsink.)
---------------------------------------------------------------------------
Host Install (for Hetzner - may be useful for others as a guide):
For Hetzner server users, the following is how to get the drivers and capability installed on the Linux host.
1) Comment out all line referencing i915 in this file: /etc/modprobe.d/blacklist-hetzner.conf
1a. sudo nano /etc/modprobe.d/blacklist-hetzner.conf
1b. Add a # in front of the lines "blacklist i915" and "blacklist i915_bdw"
2) Remove Hetzner's default grub config "nomodeset" which blocks loading of video card drivers:
2a. Ubuntu 16 or earlier: nano /etc/default/grub.d/hetzner.cfg or
2b. Ubuntu 18.04 or later: nano /etc/default/grub
and comment out GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" (i'ts okay if it also has consoleblank=0 at the end."
3) Update and Reload grub.
3a. sudo update-grub
3b. For older Ubuntu try "sudo grub-mkconfig -o /boot/grub/grub.cfg"
4) Add user root (or whoever is the user running the Plex service) to the video group:
4a. sudo usermod -a -G video root
5) Reboot the server
6) Try ls -la /dev/dri now it should find the folder and list drivers
7) chmod -R 777 /dev/dri to change permissions (critical step for use in Docker!
8) I recommend installing and running vainfo and ensure it gives you a positive readout on your driver
8a. sudo apt update
8b. sudo apt install vainfo
8c. 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.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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):
That updates the driver now that it can get to the files outside the container.
------------------------------------------------------------------------------------
Examples:
My Hetzner server CPU is an Intel Xeon E3-1246V3 so it can do x264 HW transcode, but not x265 (as far as my research can tell.) So no dice on the 4K in x265 video. But for x264...
Before the update:

After the update:

Notice the (hw) after the video transcoding. Hardware transcode!
-------------------------------------------------------------------------------------
Additional tips/tricks:
The following command should give a succinct info read on your iGPU:
For example, on one of the dedicated servers I use (the one in the examples above), the output is:
Intel Corporation Xeon E3-1200 v3 Processor Integrated Graphics Controller (rev 06) 256M]
However on a non-dedicated VPS I use the output is:
Cirrus Logic GD 5446 32M]
(Yeah...the emulated Cirrus Logic ain't going to work.)
Credits
PlexGuide Wiki Article on enabling hardware driver install for Hetzner servers: https://plexguide.com/wikis/plex-hw/: @The Creator and @WildWayz
Original Article
Desimaniac: https://github.com/desimaniac/docs/blob/master/enable_igpu_on_hetzner.md
NOTE 2: the default PlexGuide install for Plex now includes the pass through of the driver folders from the host server to the Docker container, making this process much simpler.
NOTE 3: Hetzner has also posted a short instruction page for their servers at https://community.hetzner.com/tutorials/howto-enable-igpu
-------------------------------------------------------------------------------------
Background/quick check:
This assumes your server has a CPU with iGPU or GPU that can do hardware transcoding. If you do, and the drivers are already installed, then the fix to get it working inside the Plex Docker container isn't too difficult.
Bottom line up front: If the hardware and drivers aren't installed on the host, it won't work inside the Docker container. If they are, I'll show you how to ensure they're available inside the Docker container as well.
You can do a quick check to see if the drivers are already installed by "ls -la /dev/dri"; you should see something for "card0" and "renderD128" if they are.
--If you have multiple GPUs, including an integrated (iGPU) and a discrete (i.e. nVidia or AMD) you'll probably see additional files labeled "card1" and "renderD129". This won't matter, but we also will only use one card.
If the driver files don't exist you'll likely get an error saying the directory doesn't exist, or maybe drivers for other non-GPU/iGPU devices. That's fine - the "Host Install" sections will show you how to "activate" them.
If they are, and you're sure, you can skip the next part in between the dashed lines and move to how to enable inside the Docker container.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Does my Intel CPU include an iGPU capable of Quick Sync?
Most "desktop" class CPUs from Intel starting with the second series (i.e. "Sandy Bridge" or the 2500/2600 CPUs) have an iGPU that is capable of at least h264 hardware transcoding.
- The Sandy Bridge (2xxx series) through Haswell (4xxx) series don't have great quality when hardware transcoding h264 - but they do work.
- Skylake (6xxx) and higher will even do h265/HEVC.
- Kaby Lake (7xxx) and higher will do h265/HEVC with HDR/10bit video.
Skylake and higher look GREAT when using hardware encoding - virtually indistinguishable in quality from CPU encodes, but with 5% of the CPU usage.
I have a Xeon - will it work?
Some Xeons do have iGPUs. Notably those that end in a "5" or "6".
How can I confirm?
Fast check: https://ark.intel.com/content/www/u...ProcessorGraphics=19001&0_QuickSyncVideo=True
Search for your CPU.
or
https://en.wikipedia.org/wiki/Intel_Quick_Sync_Video#Microsoft_Windows
For example, using a Xeon E5-1650v3.
Look for the E5-1650v3 series. This is a "Haswell" class CPU, but it was sold as a workstation CPU so note there is no "Graphics Clock Rate" column, because they didn't have iGPUs. (They also didn't come with heatsinks, as the users were expected to add discrete GPUs and their own heatsink.)
---------------------------------------------------------------------------
Host Install (for Hetzner - may be useful for others as a guide):
For Hetzner server users, the following is how to get the drivers and capability installed on the Linux host.
1) Comment out all line referencing i915 in this file: /etc/modprobe.d/blacklist-hetzner.conf
1a. sudo nano /etc/modprobe.d/blacklist-hetzner.conf
1b. Add a # in front of the lines "blacklist i915" and "blacklist i915_bdw"
# blacklist i915
# blacklist i915_bdw
2) Remove Hetzner's default grub config "nomodeset" which blocks loading of video card drivers:
2a. Ubuntu 16 or earlier: nano /etc/default/grub.d/hetzner.cfg or
2b. Ubuntu 18.04 or later: nano /etc/default/grub
and comment out GRUB_CMDLINE_LINUX_DEFAULT="nomodeset" (i'ts okay if it also has consoleblank=0 at the end."
# GRUB_CMDLINE_LINUX_DEFAULT="nomodeset consoleblank=0"
3) Update and Reload grub.
3a. sudo update-grub
3b. For older Ubuntu try "sudo grub-mkconfig -o /boot/grub/grub.cfg"
4) Add user root (or whoever is the user running the Plex service) to the video group:
4a. sudo usermod -a -G video root
5) Reboot the server
6) Try ls -la /dev/dri now it should find the folder and list drivers
7) chmod -R 777 /dev/dri to change permissions (critical step for use in Docker!
8) I recommend installing and running vainfo and ensure it gives you a positive readout on your driver
8a. sudo apt update
8b. sudo apt install vainfo
8c. 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.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
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.
------------------------------------------------------------------------------------
Examples:
My Hetzner server CPU is an Intel Xeon E3-1246V3 so it can do x264 HW transcode, but not x265 (as far as my research can tell.) So no dice on the 4K in x265 video. But for x264...
Before the update:

After the update:

Notice the (hw) after the video transcoding. Hardware transcode!
-------------------------------------------------------------------------------------
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
For example, on one of the dedicated servers I use (the one in the examples above), the output is:
Intel Corporation Xeon E3-1200 v3 Processor Integrated Graphics Controller (rev 06) 256M]
However on a non-dedicated VPS I use the output is:
Cirrus Logic GD 5446 32M]
(Yeah...the emulated Cirrus Logic ain't going to work.)
Credits
PlexGuide Wiki Article on enabling hardware driver install for Hetzner servers: https://plexguide.com/wikis/plex-hw/: @The Creator and @WildWayz
Original Article
Desimaniac: https://github.com/desimaniac/docs/blob/master/enable_igpu_on_hetzner.md
Last edited: