Jump to content
  • [6.7.x] Intel iGPU Hardware Transcoding does not work with Plex + Docker


    switch
    • Solved Minor

    Hi,

     

    I've posted this already, but into an incorrect forum where it remained unnoticed. So sorry for the x-post.

     

    Symptoms:

     

    Plex HW transcoding does not work with Docker on unRAID 6.7.x (0 through 2), although it is working fine when downgrading to 6.6.7 without any change in unRAID or Docker container configuration.

     

    go file:

    #!/bin/bash
    #Setup drivers for hardware transcoding in Plex
    modprobe i915
    chmod -R 777 /dev/dri
    #Start the Management Utility
    /usr/local/sbin/emhttp &

     

    syslinux.cfg untouched as i915 support is included OOB for some time now, however during my troubleshooting attempts, I've tried to force i915 support by modifying the aforementioned config file like this (with no effect of course):

     

    label Unraid OS
      menu default
      kernel /bzimage
      append pci=realloc=off initrd=/bzroot i915.alpha_support=1

    /dev/dri is being passed to the Plex docker container as a device and is visible to the container:

     

    root@532cd6092721:/# ls -la /dev/dri
    total 0
    drwxr-xr-x 2 root root        80 Jun 19 11:05 .
    drwxr-xr-x 6 root root       360 Jun 19 11:05 ..
    crw-rw---- 1 root video 226,   0 Jun 19 11:05 card0
    crwxrwxrwx 1   99 users 226, 128 Jun 19 11:05 renderD128

     

    Plex transcoder does appear to see the iGPU device, Plex dashboard shows that a HW transcode session is ongoing, however video keeps buffering and playback is never initiated.

     

    image.png.69113bbeeac7beb273042ec6845c0e7a.png

     

    I've checked Plex log quite extensively and they do IMO confirm what I've stated above - the transcoder sees the iGPU, transcode session starts, but there is no video being output.

     

    Jun 19, 2019 15:38:32.248 [0x15102bbfd700] DEBUG - TPU: hardware transcoding: using hardware decode accelerator vaapi
    Jun 19, 2019 15:38:32.248 [0x15102bbfd700] DEBUG - [Universal] Using local file path instead of URL: /movies/Captain Marvel (2019)/Captain Marvel (2019) - Bluray-1080p.mkv
    Jun 19, 2019 15:38:32.249 [0x15102bbfd700] DEBUG - HTTP requesting GET http://127.0.0.1:32400/library/streams/181?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx
    Jun 19, 2019 15:38:32.249 [0x151093dfe700] DEBUG - Auth: authenticated user 1 as obfuscated
    Jun 19, 2019 15:38:32.249 [0x15102b1f8700] DEBUG - Request: [127.0.0.1:34844 (Loopback)] GET /library/streams/181 (14 live) GZIP Signed-in Token (obfuscated)
    Jun 19, 2019 15:38:32.252 [0x15102b1f8700] DEBUG - Content-Length of /movies/Captain Marvel (2019)/Captain Marvel (2019) - Bluray-1080p.en.srt is 91753.
    Jun 19, 2019 15:38:32.253 [0x151093dfe700] DEBUG - Completed: [127.0.0.1:34844] 200 GET /library/streams/181 (14 live) GZIP 3ms 91753 bytes
    Jun 19, 2019 15:38:32.253 [0x15102bbfd700] DEBUG - HTTP 200 response from GET http://127.0.0.1:32400/library/streams/181?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx
    Jun 19, 2019 15:38:32.253 [0x15102bbfd700] DEBUG - Detected character set of UTF-8.
    Jun 19, 2019 15:38:32.254 [0x15102bbfd700] DEBUG - Downloaded stream from [http://127.0.0.1:32400/library/streams/181?X-Plex-Token=xxxxxxxxxxxxxxxxxxxx] (codec: srt) to temporary file [/transcode/Transcode/Sessions/plex-transcode-jk19rtdgc5dtot7fu88d8gsy-ef1b128f-4370-4808-a01d-07825b462435/temp-0.srt]
    Jun 19, 2019 15:38:32.254 [0x15102bbfd700] DEBUG - TPU: hardware transcoding: zero-copy support present
    Jun 19, 2019 15:38:32.254 [0x15102bbfd700] DEBUG - TPU: hardware transcoding: using zero-copy transcoding
    Jun 19, 2019 15:38:32.254 [0x15102bbfd700] DEBUG - TPU: hardware transcoding: final decoder: vaapi, final encoder: vaapi
    Jun 19, 2019 15:38:32.255 [0x15102bbfd700] DEBUG - Job running: EAE_ROOT='/tmp/pms-85736070-8352-49fb-956e-d7be9ba4a099/EasyAudioEncoder' FFMPEG_EXTERNAL_LIBS='/config/Library/Application\ Support/Plex\ Media\ Server/Codecs/21b5515-2321-linux-x86_64/' XDG_CACHE_HOME='/config/Library/Application Support/Plex Media Server/Cache' XDG_DATA_HOME='/usr/lib/plexmediaserver/Resources' X_PLEX_TOKEN='xxxxxxxxxxxxxxxxxxxx' '/usr/lib/plexmediaserver/Plex Transcoder' '-codec:0' 'h264' '-hwaccel:0' 'vaapi' '-hwaccel_fallback_threshold:0' '10' '-hwaccel_output_format:0' 'vaapi' '-codec:1' 'dca' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/movies/Captain Marvel (2019)/Captain Marvel (2019) - Bluray-1080p.mkv' '-analyzeduration' '20000000' '-probesize' '20000000' '-i' '/transcode/Transcode/Sessions/plex-transcode-jk19rtdgc5dtot7fu88d8gsy-ef1b128f-4370-4808-a01d-07825b462435/temp-0.srt' '-filter_complex' '[0:0]hwupload[0];[0]scale_vaapi=w=1278:h=538:format=nv12[1];[1]hwupload[2]' '-filter_complex' '[0:1] aresample=async=1:ocl='\''stereo'\'':osr=48000[3]' '-map' '[2]' '-metadata:s:0' 'language=eng' '-codec:0' 'h264_vaapi' '-b:0' '2717k' '-maxrate:0' '3623k' '-bufsize:0' '7246k' '-r:0' '23.975999999999999' '-force_key_frames:0' 'expr:gte(t,0+n_forced*5)' '-map' '[3]' '-metadata:s:1' 'language=eng' '-codec:1' 'aac' '-b:1' '148k' '-f' 'dash' '-min_seg_duration' '5000000' '-skip_to_segment' '1' '-time_delta' '0.0625' '-manifest_name' 'http://127.0.0.1:32400/video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/manifest' '-avoid_negative_ts' 'disabled' '-map_metadata' '-1' '-map_chapters' '-1' 'dash' '-map' '1:s:0' '-metadata:s:0' 'language=eng' '-codec:0' 'ass' '-f' 'segment' '-segment_format' 'ass' '-segment_time' '1' '-segment_header_filename' 'sub-header' '-segment_start_number' '0' '-segment_list' 'http://127.0.0.1:32400/video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/seglist?stream=subtitles' '-segment_list_type' 'csv' '-segment_list_size' '2147483647' '-segment_list_separate_stream_times' '1' '-segment_format_options' 'ignore_readorder=1' 'sub-chunk-%05d' '-start_at_zero' '-copyts' '-vsync' 'cfr' '-y' '-vaapi_device' '/dev/dri/renderD128' '-nostats' '-loglevel' 'quiet' '-loglevel_plex' 'error' '-progressurl' 'http://127.0.0.1:32400/video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress'
    Jun 19, 2019 15:38:32.256 [0x15102bbfd700] DEBUG - Jobs: Starting child process with pid 586
    Jun 19, 2019 15:38:32.281 [0x15102adf6700] DEBUG - Request: [127.0.0.1:34846 (Loopback)] PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress?status=startup (15 live) Signed-in Token (obfuscated)
    Jun 19, 2019 15:38:32.282 [0x151093dfe700] DEBUG - Completed: [127.0.0.1:34846] 204 PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress?status=startup (15 live) 0ms 203 bytes (pipelined: 1) (range: bytes=0-) 
    Jun 19, 2019 15:38:32.282 [0x1510916b8700] DEBUG - Request: [127.0.0.1:34846 (Loopback)] PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress?status=opening (15 live) Signed-in Token (obfuscated)
    Jun 19, 2019 15:38:32.282 [0x151093dfe700] DEBUG - Completed: [127.0.0.1:34846] 204 PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress?status=opening (15 live) 0ms 203 bytes (pipelined: 2) (range: bytes=0-) 
    Jun 19, 2019 15:38:32.284 [0x15102aff7700] DEBUG - Request: [127.0.0.1:34846 (Loopback)] PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress?status=opened (15 live) Signed-in Token (obfuscated)
    Jun 19, 2019 15:38:32.284 [0x151093fff700] DEBUG - Completed: [127.0.0.1:34846] 204 PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress?status=opened (15 live) 0ms 203 bytes (pipelined: 3) (range: bytes=0-) 
    Jun 19, 2019 15:38:32.284 [0x15102b9fc700] DEBUG - Request: [127.0.0.1:34846 (Loopback)] PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress/stream?index=0&id=0&codec=h264&type=video (14 live) Signed-in Token (obfuscated)
    Jun 19, 2019 15:38:32.285 [0x151093fff700] DEBUG - Completed: [127.0.0.1:34846] 206 PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress/stream?index=0&id=0&codec=h264&type=video (14 live) 0ms 256 bytes (pipelined: 4) (range: bytes=0-) 
    Jun 19, 2019 15:38:32.285 [0x15102adf6700] DEBUG - Request: [127.0.0.1:34846 (Loopback)] PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress/stream?index=1&id=0&codec=dts&type=audio (14 live) Signed-in Token (obfuscated)
    Jun 19, 2019 15:38:32.285 [0x151093fff700] DEBUG - Completed: [127.0.0.1:34846] 206 PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress/stream?index=1&id=0&codec=dts&type=audio (14 live) 0ms 256 bytes (pipelined: 5) (range: bytes=0-) 
    Jun 19, 2019 15:38:32.340 [0x1510916b8700] DEBUG - Request: [127.0.0.1:34846 (Loopback)] PUT /video/:/transcode/session/jk19rtdgc5dtot7fu88d8gsy/ef1b128f-4370-4808-a01d-07825b462435/progress/streamDetail?index=0&id=0&codec=h264&type=video&profile=High&language=eng&width=1920&height=808&interlaced=0&level=41&frameRate=23.9

    Affected systems:

     

    As evidenced by other users, it appears only 7th gen Intel processors including UHD600 iGPU are affected, namely Celeron J4105 (Gemini Lake)

     

    Thanks in advance for looking into this.

    • Like 2


    User Feedback

    Recommended Comments



    9 hours ago, d3fault said:

    Have you i915.alpha_support=1 in the syslinux.cfg?

    Then please test to remove it.

    My syslinux.cfg is absolutely untouched, as stated in the first post. I did however try to add it during my troubleshooting attempts and in makes precisely zero difference.

    You mentioned HW transcoding works for you on a J3455, what version of unRAID are you on?

    Edited by switch

    Share this comment


    Link to comment
    Share on other sites
    On 7/27/2019 at 1:21 PM, saarg said:

    Did you try the 6.7.3 RC and see if one of the downgrades work for this?

    Can you please clarify what do you mean by "one of the downgrades"?

    • Like 1

    Share this comment


    Link to comment
    Share on other sites
    On 7/30/2019 at 11:16 PM, d3fault said:

    Have you i915.alpha_support=1 in the syslinux.cfg?

    Then please test to remove it.

     

    This was only only required on older Linux Kernels this is maybe the issue with the unraid update

    because a newer kernel is used.

     

    I use only the modprobe i915 in the go script and

    In my setup an Intel Asrock J3455 the hardware transcoding with absolute flawless.

     

    It is a different GPU but give it a try.

    I have not using i915.alpha_support=1 and i have modprobe i915 in go script, with permissions.
    It works good at version until unraid 6.6.7 and was broken in 6.7.x.

    If i downgrade unraid to 6.6.7 with same configs, it start working...

    Share this comment


    Link to comment
    Share on other sites
    On 7/31/2019 at 9:57 AM, switch said:

    Can you please clarify what do you mean by "one of the downgrades"?

    They are downgrading packages in the 6.7.3 RCs to find the cause of the sqlite corruption issue and was talking about going back to an earlier kernel.

    Share this comment


    Link to comment
    Share on other sites

    I have the similar issue with my Asrock J4105, the emby docker could not get HW transcoding works. I see 6.7.x upgrade the kernel while I see there is an issue with iommu: https://bugs.freedesktop.org/show_bug.cgi?id=108103. I wondering if that could be a possible root cause. 

    I don't have physical access with my machine right now while could someone try to disable vt-d in bios and see if it got fixed?

     

     

    --- Got it fixed with setting intel_iommu=off with syslinux.cfg. While with disable this option causes you cannot pass pci devices to VM. I don't have a need for passing devices to VM so I feel fine with current situation but hope future kernel could got this fix.

    Edited by seaeel

    Share this comment


    Link to comment
    Share on other sites
    On 9/17/2019 at 5:17 AM, seaeel said:

    --- Got it fixed with setting intel_iommu=off with syslinux.cfg. While with disable this option causes you cannot pass pci devices to VM. I don't have a need for passing devices to VM so I feel fine with current situation but hope future kernel could got this fix.

     

    This is excellent!

     

    I was moving towards this solution too, but I ended up downgrading to 6.6.7 because of the array speed issue and never tried it out (HW decoding works in 6.6.7, so that was a bonus!).   

     

    Like you, I would not need to pass through any PCIe devices, as the J4105 board I am using only has one slot, and that is in use for a SATA board.

     

    I was wondering if you tried 'intel_iommu=igfx_off'?   

     

    This is another setting that i found when searching for a solution.   It might allow other devices to be passed through to VMs, but removing the graphics from IOMMU might allow HW decoding to work.

     

    If/when I can upgrade again, I will be able to do some more testing on this issue.

    Share this comment


    Link to comment
    Share on other sites
    14 minutes ago, richsoft said:

    I was wondering if you tried 'intel_iommu=igfx_off'?   

    Hi guys, first of all thank you very, very much for all your effort!

     

    I'm also in the boat with the J4105 and just tried it with only igfx_off: It works!

    Share this comment


    Link to comment
    Share on other sites
    3 hours ago, Torben said:

    Hi guys, first of all thank you very, very much for all your effort!

     

    I'm also in the boat with the J4105 and just tried it with only igfx_off: It works!

    If there's someone that does need to do pass-through another option to try might be "iommu=pt". This option basically only enables IOMMU for devices you want to pass-through and disables it for everything else.

    Share this comment


    Link to comment
    Share on other sites
    On 9/17/2019 at 6:17 AM, seaeel said:

    --- Got it fixed with setting intel_iommu=off with syslinux.cfg. While with disable this option causes you cannot pass pci devices to VM. I don't have a need for passing devices to VM so I feel fine with current situation but hope future kernel could got this fix.

    This is perfect! Thanks a lot for your effort! Can confirm that "intel_iommu=igfx_off" is working for me as well on 6.7.3-rc3. Since this is clearly a bug in the Linux kernel and not within unRAID itself, I have now marked this bug report as resolved.

     

    @limetech, this appears to be fixed in the kernel v5.0 and up, will unRAID 6.8 include a v5.0+ kernel?

    Edited by switch

    Share this comment


    Link to comment
    Share on other sites
    On 9/19/2019 at 1:08 AM, switch said:

    This is perfect! Thanks a lot for your effort! Can confirm that "intel_iommu=igfx_off" is working for me as well on 6.7.3-rc3. Since this is clearly a bug in the Linux kernel and not within unRAID itself, I have now marked this bug report as resolved.

     

    @limetech, this appears to be fixed in the kernel v5.0 and up, will unRAID 6.8 include a v5.0+ kernel?

    Last we were told is atleast Kernel 5.2.x for Unraid 6.8

    Share this comment


    Link to comment
    Share on other sites

    Just wanna let everyone know that this issue is fully fixed on unRAID 6.8.0-rc1. Everything works as expected without disabling IOMMU or any other config edits, patches or hacks.

    • Thanks 2

    Share this comment


    Link to comment
    Share on other sites

    I can also confirm that this is working in 6.8-rc1 for me, without any config edits (I have removed them).

    Edited by richsoft

    Share this comment


    Link to comment
    Share on other sites

    Hi all, this looks an aweful lot like my issue (that has only started after upgrading to 6.8 RC4 from 6.7).

    I tried applying the syslinux line as follows:

    default menu.c32
    menu title UNRAID
    prompt 0
    timeout 50
    label Unraid OS
      menu default
      kernel /bzimage
      append intel_iommu=off initrd=/bzroot
    label Unraid OS GUI Mode
      kernel /bzimage
      append initrd=/bzroot,/bzroot-gui
    label Unraid OS Safe Mode (no plugins, no GUI)
      kernel /bzimage
      append initrd=/bzroot unraidsafemode
    label Unraid OS GUI Safe Mode (no plugins)
      kernel /bzimage
      append initrd=/bzroot,/bzroot-gui unraidsafemode
    label Memtest86+
      kernel /memtest

    Hardware transcoding is now starting again, as it did on 6.7.2, but the video is extremely glitched and blocky (unwatchable).

     

    Anyone else with a J4105 having the same issue on 6.8?

    Share this comment


    Link to comment
    Share on other sites

    @rix Are you using Plex to test this? I ask because there is currently a bug in their Quick Sync code that affects 8th Gen CPU’s. It’s supposed to be fixed in the latest beta but that version is not available on their Docker container and it’s not yet released.

    Share this comment


    Link to comment
    Share on other sites
    Just now, Taddeusz said:

    @rix Are you using Plex to test this? I ask because there is currently a bug in their Quick Sync code that affects 8th Gen CPU’s. It’s supposed to be fixed in the latest beta but that version is not available on their Docker container and it’s not yet released.

    Could you link me to their thread about this? This could likely be the remaining issue.

     

    Would love to close my bug report in this forum!

    Share this comment


    Link to comment
    Share on other sites

    I love this forum...thank, you so much for posting that!

    Just found out that HW transcoding stopped working again and already thought it was Plex this time. 

    • Like 1

    Share this comment


    Link to comment
    Share on other sites

    YES! intel_iommu=igfx_off fixed it for me on Gemini Lake aka j4105 with Unraid 6.8

    Share this comment


    Link to comment
    Share on other sites

    Is this problem still existing in 6.8.3 and J4105? I can't enable hardware acceleration in Emby at all...

    Share this comment


    Link to comment
    Share on other sites
    Hoopster

    Posted (edited)

    20 minutes ago, Civic1201 said:

    Is this problem still existing in 6.8.3 and J4105? I can't enable hardware acceleration in Emby at all...

    Obvious question, but it is not clear from your post; do you have an Emby Premiere subscription?  It is required for hardware transcoding.

     

    I don't use Emby, so, I do not know if Emby makes it clear in the settings that Premiere is required for hardware acceleration.

    Edited by Hoopster

    Share this comment


    Link to comment
    Share on other sites

    Yes, I have Emby Premiere lifetime.

    Maybe you can have a look in this thread:

    Thanks for help!

    Share this comment


    Link to comment
    Share on other sites



    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.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.