richardoswald Posted February 13 Posted February 13 Hell Unraid community. I've had my setup for a few years now and am finally configuring my rig (or trying) to enable hardware transcoding (not just for Plex but for other apps like Photoprism as well), but I'm not getting anywhere so I'm asking for help. The problem I'm having is in /dev/dri/ I only see by-path/ and card0 nothing else. I also checked my bios and only have an 'onboard' or off board option, so I have 'onboard' selected. Not sure if this is the right choice since the mobo does have Matrox onboard graphics, but not sure if off board would work (there's also a jumper for vga on the motherboard that is set to on). If anybody had an idea, I'm all ears. Here are my diagnostics zuse-diagnostics-20240212-2148.zip, but in short my CPU is a Quick Sync supported Xeon E31260L 2.40GHz installed on a Supermicro X9SCM-F motherboard The supermicro has the latest bios (2.3a) and my Unraid is on 6.12.6. I also have intel-gpu-top and I blacklisted i915 via echo "blacklist i915" > /boot/config/modprobe.d/i915.conf and rebooted. Again I'm all ears for idea, thanks in advance! Quote
rickeames Posted March 30 Posted March 30 Hi there -- I have a Beelink SEi12 with an i5 12450H in it. I installed the Plex-Media-Server container and moved my plex data over from my Synology. So far, so good. What isn't good is that nothing I do will make the container use the iGPU. It is always using the CPU to transcode. I have a plex pass. I am passing /dev/dri as a device. Nothing. I am at wits end and about to abandon this unraid adventure as it shouldn't take a day to make something work. I could use some advice/help on what I can look at. If I can't solve it this weekend, I'm going to just buy a bigger synology and move on with my life. Quote
Hoopster Posted March 30 Posted March 30 (edited) 59 minutes ago, rickeames said: I am at wits end and about to abandon this unraid adventure as it shouldn't take a day to make something work You make the assumption this has something to do with Unraid. The only thing Unraid has to do with Plex transcoding is loading the i915 drivers. On some motherboard BIOS (I am not familiar with yours), the primary graphics adapter must be set to the iGPU. If set to Auto, the i915 drivers will not load. Every once in a while Plex breaks transcoding. I just tested it with Unraid 6.12.9 and Plex and transcoding is working properly for me. - It is unclear exactly which Plex docker container you have installed. There are several in Apps. Which one are you using? I assume much of this is setup correctly or you would not get CPU transcoding. - Have you verified that i915 drivers are active and that /dev/dri is being created with the proper contents? Should look similar to image below (don't worry if card1 is missing). Passing /dev/dri as a device does nothing if no /dev/dri and its contents exist. - What does your docker run command look like? Any errors? - Have you set up a transcode path in Plex docker config and are you using it in Plex configuration? Mine looks like this as I am transcoding in RAM In Plex config: if all of this is setup properly, Plex should hardware (iGPU) transcode media that is not in a format that can direct play in the client. Edited March 30 by Hoopster Quote
rickeames Posted March 30 Posted March 30 Thank you for responding. Here is my /dev/dri directory: I have tried both binhex-plexpass and Plex-Media-Server (official). Here is my setting for transcodes: All of this set, and when I play a file and downgrade it on purpose to transcode: Are there logs somewhere that would show me errors or what could possibly be going wrong? Everyone else seems to think this is solved by just doing --device='/dev/dri' yet that hasn't done anything for me. Again, thank you for the help. Quote
rickeames Posted March 30 Posted March 30 FWIW, I can get tdarr to use the iGPU, also via docker, by putting "device='/dev/dri'" just fine. It's plex, which is making me start to wonder if somehow my "plex pass" isn't granting the container the rights to use the hardware encoding. Not sure how to debug that. I moved my Plex folder over from my old install. Plex is supposed to look for your plex pass and grant the container permission...but how do you check it? Quote
Hoopster Posted March 30 Posted March 30 12 hours ago, rickeames said: Everyone else seems to think this is solved by just doing --device='/dev/dri' yet that hasn't done anything for me. How are you passing /dev/dri to Plex container? It appears from what you are saying that /dev/dri exists but is not being used by your Plex docker container. Are you putting ---device /dev/dri:/dev/dri in the Extra Parameters line of the container config? (may depend on Plex container you are using) Or are you adding it as a device like this? I have used both methods but I am currently using the second (device configuration) method. I am using the Linuxserver version of the Plex docker so, perhaps whatever you are using may have slightly different configuration options. Do you see these checkboxes in the Plex Transcoder configuration? if you see these and can select them, that usually means you have an active Plex Pass. Quote
betweenchaosandshape Posted March 30 Posted March 30 Hi all. I've read through most of this thread, but I'm still having trouble. I'm running the binhex-plex image of Plex 1.40.1.8227 on Unraid 6.12.9 running on Topton motherboard with Intel N5105. I have the INTEL-GPU-TOP and GPU Statistics plugins installed. The Unraid OS portion of my /boot/syslinux/syslinux.cfg file: label Unraid OS menu default kernel /bzimage append i915.enable_fbc=1 i915.enable_guc=2 append initrd=/bzroot The contents of my /boot/config/modprobe.d/i915.conf file: options i915 enable_fbc=1 enable_guc=2 After adding those, as specified in a previous post, I rebooted my server and I then had the /dev/dri directory. I added the device to my Plex config and when I loaded Plex, I was able to select my Jasper Lake GPU as the transcoder. I thought everything was going great until I found that media is buffering a lot whenever I have "Use hardware-accelerated video encoding" checked. - Without that box checked, media plays without issue, but is heavy on my CPU. Running intel-gpu-top shows that the "Video" engine is working heavily, but no other engines are active. Dashboard shows that hardware transcoding is only taking place on decoding. - With it checked, the CPU utilization goes down significantly, but I get a lot of buffering. Running intel-gpu-top shows that the "Video" and "VideoEnhance" engines are both active. Dashboard shows that hardware transcoding is taking place on both decoding and encoding Subtitle burn-in isn't an issue, as I've confirmed the same behavior when subtitles are used with external SRT and when they're off completely. I'm not sure what other info to provide. Any help would be much appreciated. Thanks! Quote
rickeames Posted March 30 Posted March 30 (edited) Yeah, I am seeing those...after a lot of dinking around last night, I finally saw this in the plex logs whenever I try to force a transcode. I am certain, at this point, that something inside the container is having issues getting to the drivers properly. I am, once again, going to try a fresh transfer and see what the problem is. Tdarr finds the iGPU just fine, so the problem isn't in unraid, it's in the plex container. [Req#6a7/Transcode] [FFMPEG] - Failed to initialise VAAPI connection: -1 (unknown libva error) Req#6a7/Transcode] [FFMPEG] - libva: /config/Library/Application Support/Plex Media Server/Cache/va-dri-linux-x86_64/i965_drv_video.so init failed When I cleared the cache and rebooted the container, I just get the "Failed to initialise VAAPI..." message. I suspect when I copied over my Plex Media Server folder, as they instruct you to do on the plex site when moving between machines, something messed up the install. As I tried the same folder with both binhex and the "official" container, that has to the be issue. I just wanted to preserve my playlists and "watched/unwatched." Update: tonight I started over and rescanned everything instead of moving the Plex folder from my old install. That solved the problem. I followed the plex directions entirely and it completely didn't work. Weird. Thanks for the help everyone...live and learn every single day with this. Edited March 31 by rickeames Quote
d4man Posted April 24 Posted April 24 Just wanted to say thanks, this thread saved me 200 bucks. I almost bought an Nvidia GPU for plex transcoding but it's not needed cuz my Intel CPU has quicksync, followed the instructions and it works perfectly! Quote
R0c1nante Posted July 11 Posted July 11 Thank you so much for posting this - fixed the awful slow speed on my external streaming immediately! Quote
skrumzy Posted July 12 Posted July 12 Just revisiting this randomly, sorry dont really check in here but is there anyone still struggling with this that needs help? Message me and hopefully i see it in my email, ill reach out to ya. Quote
Ash3000k Posted July 30 Posted July 30 what an absolute legend!! just wat i needed, cant thank you enough Quote
Novaliz Posted August 11 Posted August 11 (edited) On 2/13/2019 at 5:16 PM, lotetreemedia said: ***Update*** : Apologies, it seems like there was an update to the Unraid forums which removed the carriage returns in my code blocks. This was causing people to get errors when typing commands verbatim. I've fixed the code blocks below and all should be Plexing perfectly now Y =========== Granted this has been covered in a few other posts but I just wanted to have it with a little bit of layout and structure. Special thanks to [mention=9167]Hoopster[/mention] whose post(s) I took this from. What is Plex Hardware Acceleration? When streaming media from Plex, a few things are happening. Plex will check against the device trying to play the media: Media is stored in a compatible file container Media is encoded in a compatible bitrate Media is encoded with compatible codecs Media is a compatible resolution Bandwith is sufficient If all of the above is met, Plex will Direct Play or send the media directly to the client without being changed. This is great in most cases as there will be very little if any overhead on your CPU. This should be okay in most cases, but you may be accessing Plex remotely or on a device that is having difficulty with the source media. You could either manually convert each file or get Plex to transcode the file on the fly into another format to be played. A simple example: Your source file is stored in 1080p. You're away from home and you have a crappy internet connection. Playing the file in 1080p is taking up too much bandwith so to get a better experience you can watch your media in glorious 240p without stuttering / buffering on your little mobile device by getting Plex to transcode the file first. This is because a 240p file will require considerably less bandwith compared to a 1080p file. The issue is that depending on which format your transcoding from and to, this can absolutely pin all your CPU cores at 100% which means you're gonna have a bad time. Fortunately Intel CPUs have a little thing called Quick Sync which is their native hardware encoding and decoding core. This can dramatically reduce the CPU overhead required for transcoding and Plex can leverage this using their Hardware Acceleration feature. How Do I Know If I'm Transcoding? You're able to see how media is being served by playing a first something on a device. Log into Plex and go to Settings > Status > Now Playing As you can see this file is being direct played, so there's no transcoding happening. If you see (throttled) it's a good sign. It just means is that your Plex Media Server is able to perform the transcode faster than is necessary. To initiate some transcoding, go to where your media is playing. Click on Settings > Quality > Show All > Choose a Quality that isn't the Default one If you head back to the Now Playing section in Plex you will see that the stream is now being Transcoded. I have Quick Sync enabled hence the "(hw)" which stands for, you guessed it, Hardware. "(hw)" will not be shown if Quick Sync isn't being used in transcoding. PreRequisites 1. A Plex Pass - If you require Plex Hardware Acceleration Test to see if your system is capable before buying a Plex Pass. 2. Intel CPU that has Quick Sync Capability - Search for your CPU using Intel ARK 3. Compatible Motherboard You will need to enable iGPU on your motherboard BIOS In some cases this may require you to have the HDMI output plugged in and connected to a monitor in order for it to be active. If you find that this is the case on your setup you can buy a dummy HDMI doo-dad that tricks your unRAID box into thinking that something is plugged in. Some machines like the HP MicroServer Gen8 have iLO / IPMI which allows the server to be monitored / managed remotely. Unfortunately this means that the server has 2 GPUs and ALL GPU output from the server passed through the ancient Matrox GPU. So as far as any OS is concerned even though the Intel CPU supports Quick Sync, the Matrox one doesn't. =/ you'd have better luck using the new unRAID Nvidia Plugin. Check Your Setup If your config meets all of the above requirements, give these commands a shot, you should know straight away if you can use Hardware Acceleration. Login to your unRAID box using the GUI and open a terminal window. Or SSH into your box if that's your thing. Type: cd /dev/dri ls If you see an output like the one above your unRAID box has its Quick Sync enabled. The two items were interested in specifically are card0 and renderD128. If you can't see it not to worry type this: modprobe i915 There should be no return or errors in the output. Now again run: cd /dev/dri ls You should see the expected items ie. card0 and renderD128 Give your Container Access Lastly we need to give our container access to the Quick Sync device. I am going to passively aggressively mention that they are indeed called containers and not dockers. Dockers are manufacturers of boots and pants company and have nothing to do with virtualization or software development, yet. Okay rant over. We need to do this because the Docker host and its underlying containers don't have access to anything on unRAID unless you give it to them. This is done via Paths, Ports, Variables, Labels or in this case Devices. We want to provide our Plex container with access to one of the devices on our unRAID box. We need to change the relevant permissions on our Quick Sync Device which we do by typing into the terminal window: chmod -R 777 /dev/dri Once that's done Head over to the Docker Tab, click on the your Plex container. Scroll to the bottom click on Add another Path, Port, Variable Select Device from the drop down Enter the following: Name: /dev/dri Value: /dev/dri Click Save followed by Apply. Log Back into Plex and navigate to Settings > Transcoder. Click on the button to SHOW ADVANCED Enable "Use hardware acceleration where available". You can now do the same test we did above by playing a stream, changing it's Quality to something that isn't its original format and Checking the Now Playing section to see if Hardware Acceleration is enabled. If you see "(hw)" congrats! You're using Quick Sync and Hardware acceleration [emoji4] Persist your config On Reboot unRAID will not run those commands again unless we put it in our go file. So when ready type into terminal: nano /boot/config/go Add the following lines to the bottom of the go file modprobe i915 chmod -R 777 /dev/dri Press Ctrl X, followed by Y to save your go file. And you should be golden! Great. Thanks for the instructions. It finally worked Finally, don’t forget to enable the GPU in Plex: Edited August 11 by Novaliz Quote
friimaind Posted August 15 Posted August 15 I followed the guide, thank you very much, everything works perfectly! Quote
Pandemic Posted August 20 Posted August 20 I've been running plex on a quicsync proc for years now and never did this. I did notice 1-2 transcodes using a chunk of the proc so it was likely never utilizing quicsync. Thanks for putting this together! Quote
Lappen71 Posted October 22 Posted October 22 I think something is wrong with QuickSync for me. I only see one "hw" when I lower the quality and the CPU spikes. And I checked all settings and I can't see anything wrong. Does anyone have an idea what can be wrong? Quote
Taddeusz Posted October 22 Posted October 22 @Lappen71 Your Haswell CPU isn’t capable of decoding HEVC in hardware. Quote
Lappen71 Posted October 22 Posted October 22 46 minutes ago, Taddeusz said: @Lappen71 Your Haswell CPU isn’t capable of decoding HEVC in hardware. But why does it say hw in one place? Quote
Taddeusz Posted October 22 Posted October 22 1 hour ago, Lappen71 said: But why does it say hw in one place? Because it is only capable of decoding/encoding H.264. Ivy Bridge/Haswell does not have a new enough version of Intel Quick Sync to support any kind of hardware acceleration for H.265(HEVC) video. If you go to the “Intel Quick Sync” page on Wikipedia there is a handy table of decode/encode capabilities for each CPU generation. 1 Quote
Taddeusz Posted October 22 Posted October 22 (edited) 1 hour ago, Lappen71 said: But why does it say hw in one place? To better answer your question the video you’re playing in the first instance is encoded with H.265/HEVC which your CPU is not capable of decoding in hardware. You need a Skylake or better CPU to support H.265/HEVC hardware decoding. Edited October 22 by Taddeusz 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.