{"id":2003,"date":"2022-07-11T20:56:00","date_gmt":"2022-07-12T01:56:00","guid":{"rendered":"https:\/\/lab.rapternet.us\/?p=2003"},"modified":"2022-06-06T20:57:06","modified_gmt":"2022-06-07T01:57:06","slug":"enabling-quick-sync-for-plex-on-unraid","status":"publish","type":"post","link":"https:\/\/lab.rapternet.us\/?p=2003","title":{"rendered":"Enabling Quick Sync For Plex on Unraid"},"content":{"rendered":"\n<p>Quick sync is a great way to handle hardware transcoding in plex, and also comes on most intel CPUs, so using it becomes more a why wouldn&#8217;t you question. In my plex installation, I hadn&#8217;t even realized that I was leaving this performance on the table, so here&#8217;s how I enabled it and got it to run.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>I have a Xeon E3-1245, with the specs below for the GPU on it. As can be seen, it does support Quick Sync video.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"472\" height=\"294\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-2.png\" alt=\"\" class=\"wp-image-2007\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-2.png 472w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-2-300x187.png 300w\" sizes=\"auto, (max-width: 472px) 100vw, 472px\" \/><figcaption>CPU Specifications<\/figcaption><\/figure>\n\n\n\n<p>The process to enable it is pretty simple. We first need to check if \/dev\/dri exists. If not, we need to run a modprobe i915 command, which will create the device and enable us to use it. We do need that \/dev\/dri to be accessible to everyone in order for our container to access it, so chmod 777 it is.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@ShadowOfIntent:~# cd \/dev\/dri\n-bash: cd: \/dev\/dri: No such file or directory\nroot@ShadowOfIntent:~# <strong>modprobe i915<\/strong>\nroot@ShadowOfIntent:~# cd \/dev\/dri\nroot@ShadowOfIntent:\/dev\/dri# ls\nby-path\/  card0  renderD128\nroot@ShadowOfIntent:\/dev\/dri# <strong>chmod -R 777 \/dev\/dri<\/strong>\nroot@ShadowOfIntent:\/dev\/dri# ls -lah\ntotal 0\ndrwxrwxrwx  3 root root       100 Jun  2 14:05 .\/\ndrwxr-xr-x 16 root root      3.6K Jun  2 14:05 ..\/\ndrwxrwxrwx  2 root root        80 Jun  2 14:05 by-path\/\ncrwxrwxrwx  1 root video 226,   0 Jun  2 14:05 card0\ncrwxrwxrwx  1 root video 226, 128 Jun  2 14:05 renderD128\n<\/pre>\n\n\n\n<p>Now that we have the quick sync device enabled and ready, we just need to add it to the docker container. Note this is a device type config, not a path type input (trust me, the path doesn&#8217;t work, I missed the device detail on my first attempt at enabling it).<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"916\" height=\"356\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image.png\" alt=\"\" class=\"wp-image-2004\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image.png 916w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-300x117.png 300w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-768x298.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><figcaption>Adding the Quick Sync Device<\/figcaption><\/figure>\n\n\n\n<p>The docker command below is how unraid ended up creating the container<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Command:\nroot@localhost:# \/usr\/local\/emhttp\/plugins\/dynamix.docker.manager\/scripts\/docker run -d --name='OfficialPlex' --net='bridge' -e TZ=\"America\/Chicago\" -e HOST_OS=\"Unraid\" -e 'ADVERTISE_IP'='http:\/\/192.168.1.211:32400\/' -e 'PLEX_CLAIM'='claim-XXXXXXXXXXXXXXXXXXXX' -e 'ADVERTISE_IP'='http:\/\/YYY.YYY.Y.YYY:32400' -p '32400:32400\/tcp' -p '3005:3005\/tcp' -v '\/mnt\/user\/Settings\/Plex\/temp\/':'\/transcode':'rw' -v '\/mnt\/user\/':'\/data':'ro' -v '\/mnt\/cache\/Settings\/PlexMediaDocker2\/':'\/config':'rw' --device='\/dev\/dri' 'plexinc\/pms-docker:1.24.5.5173-8dcc73a59'\n\nThe command finished successfully!<\/pre>\n\n\n\n<p>Now to keep the settings working over reboots, we do need to update the \/boot\/config\/go script to include the modprobe and chmod commands.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"645\" height=\"300\" src=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-1.png\" alt=\"\" class=\"wp-image-2005\" srcset=\"https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-1.png 645w, https:\/\/lab.rapternet.us\/wp-content\/uploads\/2022\/06\/image-1-300x140.png 300w\" sizes=\"auto, (max-width: 645px) 100vw, 645px\" \/><\/figure>\n\n\n\n<p>With my old CPU, I was able to hardware transcode h264 content, but not h265 4k content. This limits the usefulness of it, however its still extra performance for my primarily h264 library.<\/p>\n\n\n\n<p>Conclusion<\/p>\n\n\n\n<p>While I&#8217;m unable to currently use hardware transcoding for h265 content, having the infrastructure there for my next hardware upgrade will be useful. I will also be able to make use of the hardware transcoding for my current library which only has 2 4k \/ h265 videos in it.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Resources<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a rel=\"noreferrer noopener\" href=\"https:\/\/forums.unraid.net\/topic\/77943-guide-plex-hardware-acceleration-using-intel-quick-sync\/\" target=\"_blank\">Forum <\/a><a href=\"https:\/\/forums.unraid.net\/topic\/77943-guide-plex-hardware-acceleration-using-intel-quick-sync\/\" target=\"_blank\" rel=\"noreferrer noopener\">p<\/a><a rel=\"noreferrer noopener\" href=\"https:\/\/forums.unraid.net\/topic\/77943-guide-plex-hardware-acceleration-using-intel-quick-sync\/\" target=\"_blank\">osting about the setup<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Quick sync is a great way to handle hardware transcoding in plex, and also comes on most intel CPUs, so using it becomes more a why wouldn&#8217;t you question. In my plex installation, I hadn&#8217;t even realized that I was leaving this performance on the table, so here&#8217;s how I enabled it and got it &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/lab.rapternet.us\/?p=2003\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Enabling Quick Sync For Plex on Unraid&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[77,15],"class_list":["post-2003","post","type-post","status-publish","format-standard","hentry","category-how-to","tag-plex","tag-unraid"],"_links":{"self":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/2003","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2003"}],"version-history":[{"count":7,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/2003\/revisions"}],"predecessor-version":[{"id":2032,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=\/wp\/v2\/posts\/2003\/revisions\/2032"}],"wp:attachment":[{"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2003"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2003"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab.rapternet.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2003"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}