cagemaster Posted October 26, 2019 Share Posted October 26, 2019 Hi! When I'm optimizing a video in Plex, an MKV H264 (4GB) takes ~30 min to convert to the 'Phone 1080p' preset. But when I'm using Handbrake (docker container) it seems to never finish, I've let it run for 2h and it still didn't finish. I suspect Handbrake isn't using hardware acceleration (Intel quick sync?). I've read that it should be enabled by default (?). Is there something I need to do to enable it? Thank you! Quote Link to comment
Hoopster Posted October 26, 2019 Share Posted October 26, 2019 1 hour ago, cagemaster said: I suspect Handbrake isn't using hardware acceleration (Intel quick sync?). I've read that it should be enabled by default (?) No, you have to set up the container to use hardware acceleration. Assuming your CPU supports QSV and that you have configured unRAID to load the i915 drivers, you need to setup a container device that points to /dev/dri If you have QSV properly configured in unRAID and the container, Intel QSV will show up as a video codec you can select in Handbrake Create a custom preset using this codec and save it in HandBrake. If you want your custom preset to be the default for the container, go back to the HandBrake container and specify your preset as the Automatic Video Converter Preset. Quote Link to comment
cagemaster Posted October 26, 2019 Author Share Posted October 26, 2019 (edited) I don't think i have configured unRAID to load the i915 drivers because the container creation fails. Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory. Do you have a good guide on how to do that? I made it work by following a previous tutorial of yours! Thank you. Edited October 26, 2019 by cagemaster Quote Link to comment
Hoopster Posted October 26, 2019 Share Posted October 26, 2019 7 minutes ago, cagemaster said: I don't think i have configured unRAID to load the i915 drivers because the container creation fails. Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory. Do you have a good guide on how to do that? Start a terminal session from unRAID GUI and type modprobe i915 if you get no errors, type the following: cd /dev/dri ls If all is well you should see the files indicated in the /dev/dri folder. If it all looks good and the drivers are loading, you should modify your go file on the flash drive to load the i915 drivers when the server is booted. I have the following entries in my go file. I am using hardware transcoding in both Plex and HandBrake. #Setup drivers for hardware transcoding in Plex modprobe i915 sleep 4 chown -R nobody:users /dev/dri chmod -R 777 /dev/dri 1 Quote Link to comment
John_M Posted October 26, 2019 Share Posted October 26, 2019 2 hours ago, Hoopster said: I am using hardware transcoding in both Plex and HandBrake. Do you have to take any special precautions to make sure they never both transcode at the same time, or it is simply not an issue? Quote Link to comment
Hoopster Posted October 26, 2019 Share Posted October 26, 2019 (edited) 5 hours ago, John_M said: Do you have to take any special precautions to make sure they never both transcode at the same time, or it is simply not an issue? I don't think it would be an issue and, frankly, I do not even know if both have been transcoding at the same time. I have never seen any errors or problems. I have had up to six hardware transcodes going simultaneously in Plex and there was PLENTY of overhead left. so, I don' think a HandBrake job kicking off at the same would tax the capabilities of the CPU/iGPU Now I am curious and I will have to do some tests. 😁 Edited October 27, 2019 by Hoopster Quote Link to comment
Hoopster Posted October 27, 2019 Share Posted October 27, 2019 3 hours ago, John_M said: Do you have to take any special precautions to make sure they never both transcode at the same time, or it is simply not an issue? I started two Plex streams forcing a 1080p transcode on both. I confirmed both streams were being decoded and encoded in hardware (Quick Sync). I then started a 1080p transcode in HandBrake from .mkv to .mp4 using my Quick Sync Video preset. It started and ran without any issues even while the two Plex streams continued uninterrupted. I then started a third Plex stream transcoding 1080p to 720p. I let all the above run for about 20 minutes. I then cancelled the three Plex streams. QSV handled the three Plex streams in the iGPU and there was only a minor difference on the overall CPU load with or without the Plex streams running. Most of the load on the CPU (averaged about 74% which is typical for my HandBrake transcodes) was because HandBrake was transcoding subtitles as well as the audio and video tracks. That uses CPU and is not done in QSV. There are no issues in letting both Plex and HandBrake transcode via QSV simultaneously. 1 Quote Link to comment
John_M Posted October 27, 2019 Share Posted October 27, 2019 1 hour ago, Hoopster said: There are no issues in letting both Plex and HandBrake transcode via QSV simultaneously. Cool. Thank you so much. That's good to know. Quote Link to comment
Alvin Leong Posted January 11, 2023 Share Posted January 11, 2023 i have a similar issues and i am using unraid docker from https://hub.docker.com/r/jlesage/handbrake/ latest v1.5.1 revision. however intel quick sync is not showing up in video encoder list. i installed GPU top plugin, installed GPU statistic plugging, added /dev/dri/ to docker "device" parameter. also, if type cd /dev/dri>>ls in terminal can see card0/renderD128 means my intel quick sync activated. furthermore, I have my jellyfin running hardware transcoding with intel quick sync perfectly fine as tracked and shown in the GPU statistic whenever I run a transcoding media stream. then, docker privilege setting is set to enable, also using PUID & PGID of "0". tried both Umask of 000 and 022. However, handbrake just does not work and I am on Unraid Version: 6.11.5 Can anyone help to advise how am I going to get intel QSV encoder to show up? the only thing I do not dare to do yet is the following code which I am not sure what this is doing and worry it may mess up my system. i dont do plex hardware transcoding as i dont have the plex pass. the question is do i need this "modprobe i915" thing on my unraid v6.11.5? #Setup drivers for hardware transcoding in Plex modprobe i915 sleep 4 chown -R nobody:users /dev/dri chmod -R 777 /dev/dri Quote Link to comment
SRTG Posted May 19, 2023 Share Posted May 19, 2023 (edited) I'd like to bump this. I have the same issue as @Alvin Leong except I'm using Plex. HW transcoding works fine but I can't seem to enable quicksync on handbrake. I've added /dev/dri as a handbrake device parameter so if Quicksync works in Plex it should show up here. I added the below to the "go file" but no joy. modprobe i915 chown -R nobody:users /dev/dri chmod -R 777 /dev/dri If anyone could provide a steer it would be much appreciated! Edited May 19, 2023 by SRTG Quote Link to comment
Hoopster Posted May 19, 2023 Share Posted May 19, 2023 3 hours ago, SRTG said: If anyone could provide a steer it would be much appreciated! Have you created a preset in HandBrake that uses the QSV encoder? Do QSV encoder options appear in the video encoder list in HandBrake? If not, the container is not setup properly with /dev/dri Quote Link to comment
SRTG Posted May 20, 2023 Share Posted May 20, 2023 17 hours ago, Hoopster said: Have you created a preset in HandBrake that uses the QSV encoder? Do QSV encoder options appear in the video encoder list in HandBrake? If not, the container is not setup properly with /dev/dri The QSV options don't appear in the dropdown. Mine still look like this: I've already added /dev/dri device as below but still no luck. Quote Link to comment
Hoopster Posted May 20, 2023 Share Posted May 20, 2023 59 minutes ago, SRTG said: I've already added /dev/dri device as below but still no luck. Do you get any errors related to /dev/dri when your Handbrake container starts? Post your docker run command. In a terminal session, if you type the following commands what do you see? cd /dev/dri ls You should see the following (card1 does not need to be there). If you do not see this, your system is not loading the i915 /dev/dri drivers. You do not mention what version of Unraid you are running, but from version 6.9.0 and greater, go file entries for modprobe i915 are no longer recommended.; although, I suppose it may still work. I am using the "touch" method to load i915. See the release notes for more information. For example, here are the 6.9.0 release notes on GPU drivers: Quote Link to comment
SRTG Posted May 20, 2023 Share Posted May 20, 2023 52 minutes ago, Hoopster said: In a terminal session, if you type the following commands what do you see? cd /dev/dri ls You should see the following (card1 does not need to be there). If you do not see this, your system is not loading the i915 /dev/dri drivers. Yes, in terminal I see card0, render D128. I'm running UNRAID 6.11.5. I did notice something in handbrake_activity_logs.txt. It seems to confirm QSV is available but it can't locate the driver ? I'm a little confused on how Plex can see this but Handbrake can't. So a possible solution is terminal: touch /boot/config/modprobe.d/i915.conf ? Thanks for your help so far! Quote Link to comment
Hoopster Posted May 21, 2023 Share Posted May 21, 2023 On 5/20/2023 at 9:29 AM, SRTG said: So a possible solution is terminal: touch /boot/config/modprobe.d/i915.conf ? I just built a new server last week on which I installed Handbrake. I am running Unraid 6.11.5 on that server. I noticed I had no QSV Handbrake options on that server. I had no i915.conf file there either; however, I recall that in an Unraid release after 6.9.0 (I do not recall which one), it was mentioned that Unraid would now automatically load the i915 drivers if an iGPU was detected. As a test of that theory, I did not create an i915.conf file via the touch method on this server. The only thing I did to get the QSV encoder options to show up in Handbrake on this new server was to add the /dev/dri device. I am currently running a Fast 1080p30 H.265 QSV encode on that server. My /dev/dri device looks no different than yours, yet it works for me and not for you. Perhaps try posting in the Handbrake support thread? Quote Link to comment
Hoopster Posted May 22, 2023 Share Posted May 22, 2023 (edited) @SRTG Of course, you cannot even get the QSV encoding options to show up, but, when you do, here is another tip should you get encoding failures when attempting QSV encoding in Handbrake: I don't know what CPU you are using, but in examining my Handbrake QSV preset, I remembered a setting I needed to add to get QSV to work with the 11th Generation i5-11600 CPU in that system. Prior to adding this, I would get an "encoding failed" message on all encoding attempts with QSV. Rocket Lake/11th gen CPU/iGPUs had problems with low power QSV encoding which is the default for Handbrake. I had to turn off low power mode in the QSV presets by adding "lowpower=0' to the "More Settings" box in in the Video tab. So I did not have to add this each time, I made sure to resave the Preset with this setting. Edited May 22, 2023 by Hoopster Quote Link to comment
SRTG Posted May 22, 2023 Share Posted May 22, 2023 @Hoopster Interesting, I've added this setting. I have an i5-4590 so maybe the fact it's an older QSV processor is an issue in itself ! What I've tried so far: -Added "/dev/dri" as a device in handbrake -Go file modprobe i915 chown -R nobody:users /dev/dri chmod -R 777 -Tried "--device=/dev/dri/card0:/dev/dri/card0 --device=/dev/dri/renderD128:/dev/dri/renderD128" in extra parameters -Added blank config file to whitelist the driver "touch /boot/config/modprobe.d/i915.conf" -Added "i915.alpha_support=1" to syslinux boot Right now I can encode a 2-hour bluray in around 2hrs 15 mins but only in H264 (h265 is at least double this). Not the end of the world but CPU utilisation is a solid 100%. QSV should cut the time down and give me some headroom! I will try handbrake forums and post a solution if I ever find one. Quote Link to comment
Hoopster Posted May 22, 2023 Share Posted May 22, 2023 2 hours ago, SRTG said: I have an i5-4590 so maybe the fact it's an older QSV processor is an issue in itself ! Yes, that is the problem. According to the Handbrake documentation, at least a 6th generation CPU/iGPU is required for QSV support. From the documentation: Intel Quick Sync Video Supported Hardware and Configurations Intel Skylake (6th Generation Core) CPU or later with Intel HD, Iris Xe or Arc graphics. Quote Link to comment
SRTG Posted May 22, 2023 Share Posted May 22, 2023 🥴 ah no Thanks for confirming I'll just have to make do until I upgrade my board and CPU ! Quote Link to comment
mellow65 Posted July 7, 2023 Share Posted July 7, 2023 I'm going to drop some head pounding, time sucking, information that has taken me the better part of 2 days to figure out, and every time I went searching this thread kept coming up so I feel this may be the best place to drop it for any future poor soul that tries to figure it out. I have been trying to figure out why my 10th gen Intel Celeron Elkhart Lake J6413 would not show the QSV options. Even though in handbrakes activity screen it says "qsv is available on this system", I went down every rabbit hole, every random thread I could find. I followed all the things in this thread even though I'm running 6.11.5 and some of the things weren't needed. I think the main issue I was running into was the fact that my CPU/GPU only supports low power mode (according to the jellyfin documentation). Which when I was running my server off of an i7-8700T, I never had a single issue, and the QSV options just came up. When I was on the handbrake site looking at the QSV documentation, https://handbrake.fr/docs/en/latest/technical/video-qsv.html There was a link to a github "Known Issues and Limitations" for intel media drivers. https://github.com/intel/media-driver#known-issues-and-limitations This got me trying to put "options i915 enable_guc=2" in all the locations the "i915.conf" file may live. What ended up working for me was putting "options i915 enable_guc=2" in the /boot/config/modprobe.d/i915.conf. This does copy down to the /etc/modprobe.d/i915.conf on reboot. I hope this can help anyone in the future if you come upon this. Quote Link to comment
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.