Jellyfin Forum
SOLVED: struggeling with Hardware acceleration in docker (Intel) - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: struggeling with Hardware acceleration in docker (Intel) (/t-solved-struggeling-with-hardware-acceleration-in-docker-intel)

Pages: 1 2


struggeling with Hardware acceleration in docker (Intel) - Tone - 2024-09-21

I'm using an Intel N5105, Ubuntu 24.04 (6.8.0-45-generic) and jellyfin 10.9.11 in docker.
I can't get hardware acceleration to working.

Intel_gpu_top always shows 0% everywhere, if I play an video with 720p 4 Mbit.

Code:
│$ getent group render | cut -d: -f3

109

docker compose
Code:
version: '3.5'
services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    user: 1000:1000
    group_add:
      - "109"
    devices:
      - /dev/dri/renderD128:/dev/dri/renderD128

Code:
│$ sudo docker exec -it jellyfin /usr/lib/jellyfin-ffmpeg/vainfo

Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.5 (12561f6)
vainfo: Supported profile and entrypoints
      VAProfileNone                  : VAEntrypointVideoProc
      VAProfileNone                  : VAEntrypointStats
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264Main              : VAEntrypointVLD
      VAProfileH264Main              : VAEntrypointEncSliceLP
      VAProfileH264High              : VAEntrypointVLD
      VAProfileH264High              : VAEntrypointEncSliceLP
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileJPEGBaseline          : VAEntrypointVLD
      VAProfileJPEGBaseline          : VAEntrypointEncPicture
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileHEVCMain              : VAEntrypointVLD
      VAProfileHEVCMain              : VAEntrypointEncSliceLP
      VAProfileHEVCMain10            : VAEntrypointVLD
      VAProfileHEVCMain10            : VAEntrypointEncSliceLP
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointEncSliceLP
      VAProfileVP9Profile1            : VAEntrypointVLD
      VAProfileVP9Profile1            : VAEntrypointEncSliceLP
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointEncSliceLP
      VAProfileVP9Profile3            : VAEntrypointVLD
      VAProfileVP9Profile3            : VAEntrypointEncSliceLP
      VAProfileHEVCMain422_10        : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointVLD
      VAProfileHEVCMain444            : VAEntrypointEncSliceLP
      VAProfileHEVCMain444_10        : VAEntrypointVLD
      VAProfileHEVCMain444_10        : VAEntrypointEncSliceLP

Code:
│$ sudo docker exec -it jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va -init_hw_device opencl@va

ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 12 (Debian 12.2.0-14)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec    60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter    9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample  4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[AVHWDeviceContext @ 0x6152f0e69480] Trying to use DRM render node for device 0.
[AVHWDeviceContext @ 0x6152f0e69480] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x6152f0e69480] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x6152f0e69480] libva: Found init function __vaDriverInit_1_22
[AVHWDeviceContext @ 0x6152f0e69480] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x6152f0e69480] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x6152f0e69480] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.5 (12561f6).
[AVHWDeviceContext @ 0x6152f0e69480] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x6152f0e8e300] 0.0: Intel(R) OpenCL Graphics / Intel(R) UHD Graphics
[AVHWDeviceContext @ 0x6152f0e8e300] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
[AVHWDeviceContext @ 0x6152f0e8e300] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
[AVHWDeviceContext @ 0x6152f0e8e300] Intel QSV in OpenCL release function found (clEnqueueReleaseVA_APIMediaSurfacesINTEL).
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

[Image: Screenshot-2024-09-22-005030.png]

Code:
│$ sudo dmesg | grep i915

[    4.880623] i915 0000:00:02.0: [drm] VT-d active for gfx access
[    4.880825] i915 0000:00:02.0: vgaarb: deactivate vga console
[    4.880973] i915 0000:00:02.0: [drm] Using Transparent Hugepages
[    4.882623] i915 0000:00:02.0: vgaarb: VGA decodes changed: olddecodes=io+mem,decodes=io+mem:owns=io+mem
[    4.884745] mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_ops [i915])
[    4.886504] i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/icl_dmc_ver1_09.bin (v1.9)
[    4.903960] i915 0000:00:02.0: [drm] GT0: GuC firmware i915/ehl_guc_70.1.1.bin version 70.1.1
[    4.903968] i915 0000:00:02.0: [drm] GT0: HuC firmware i915/ehl_huc_9.0.0.bin version 9.0.0
[    4.922975] i915 0000:00:02.0: [drm] GT0: HuC: authenticated for all workloads
[    4.922986] i915 0000:00:02.0: [drm] GT0: GUC: submission disabled
[    4.922989] i915 0000:00:02.0: [drm] GT0: GUC: SLPC disabled
[    4.936951] [drm] Initialized i915 1.6.0 20230929 for 0000:00:02.0 on minor 0
[    4.950045] i915 display info: display version: 11
[    4.950053] i915 display info: cursor_needs_physical: no
[    4.950055] i915 display info: has_cdclk_crawl: no
[    4.950057] i915 display info: has_cdclk_squash: no
[    4.950058] i915 display info: has_ddi: yes
[    4.950060] i915 display info: has_dp_mst: yes
[    4.950062] i915 display info: has_dsb: no
[    4.950063] i915 display info: has_fpga_dbg: yes
[    4.950065] i915 display info: has_gmch: no
[    4.950066] i915 display info: has_hotplug: yes
[    4.950068] i915 display info: has_hti: no
[    4.950069] i915 display info: has_ipc: yes
[    4.950070] i915 display info: has_overlay: no
[    4.950072] i915 display info: has_psr: yes
[    4.950073] i915 display info: has_psr_hw_tracking: yes
[    4.950074] i915 display info: overlay_needs_physical: no
[    4.950076] i915 display info: supports_tv: no
[    4.950077] i915 display info: has_hdcp: yes
[    4.950079] i915 display info: has_dmc: yes
[    4.950080] i915 display info: has_dsc: yes
[    4.950311] i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
[    4.950448] i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
[    4.950499] i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
[    4.951863] snd_hda_intel 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])

I noticed that my guc and huc paths are 
/sys/kernel/debug/dri/0/gt0/uc/huc_info instead of 
/sys/kernel/debug/dri/0/gt/uc/huc_info
dont know what that means.

Code:
│$ sudo cat /sys/kernel/debug/dri/0/gt0/uc/huc_info

HuC firmware: i915/ehl_huc_9.0.0.bin
        status: RUNNING
        version: found 9.0.0
        uCode: 498496 bytes
        RSA: 256 bytes
HuC status: 0x0007c001

Code:
│$ sudo cat /sys/kernel/debug/dri/0/gt0/uc/guc_info

GuC firmware: i915/ehl_guc_70.1.1.bin
        status: RUNNING
        version: found 70.1.1
        uCode: 274112 bytes
        RSA: 256 bytes
GuC status 0x8003f0ec:
        Bootrom status = 0x76
        uKernel status = 0xf0
        MIA Core status = 0x3
Scratch registers:
        0:    0x0
        1:    0x1773d7
        2:    0x44000
        3:    0x4000
        4:    0x40
        5:    0x514
        6:    0x4e610001
        7:    0x0
        8:    0x0
        9:    0x0
        10:    0x0
        11:    0x0
        12:    0x0
        13:    0x0
        14:    0x0
        15:    0x0

GuC logging stats:
        Relay full count: 0
        DEBUG:  flush count          0, overflow count          0
        CRASH:  flush count          0, overflow count          0
        CAPTURE:        flush count          0, overflow count          0

I only have 3 normal log files, but none ffmpeg log file.

what could be the problem?
Thanks!

Edit:
I noticed that my video had a very low bitrate, so it wasn't probably even transcoding.
If I test it with other videos or an even lower bitrate, the player immediately crashs. It even crashs if I disable hardware acceleration in the gui.


RE: struggeling with Hardware acceleration in docker (Intel) - TheDreadPirate - 2024-09-22

The GPU won't be used unless the video needs to be transcoded. 0% GPU usage is normal if the client is able to play the video as is.

Otherwise, your setup looks fine for when you do encounter a video that needs to be transcoded.

Didn't see your edit. What player are you using and what are the codecs in the original video?


RE: struggeling with Hardware acceleration in docker (Intel) - Tone - 2024-09-22

Good question!
I tested a bit and it looks like the problem is the browser!

I tested on Win11 with Edge. Here works nothing! No matter what format (h264 or h265), if I try to transcode, the player crashs.
Now I tested on iOS and webOS with the offical jellyfin app - here everything is working (with HA)!

Code:
intel-gpu-top: Intel Jasperlake (Gen11) @ /dev/dri/card0 -  674/ 797 MHz;  0% RC6;    3202 irqs/s

        ENGINES    BUSY                                                                                          MI_SEMA MI_WAIT
      Render/3D  31.74% |███████████████████████████▍                                                          |    11%      0%
        Blitter    0.00% |                                                                                      |      0%      0%
          Video  99.25% |█████████████████████████████████████████████████████████████████████████████████████▍      1%      0%
    VideoEnhance    0.00% |                                                                                      |      0%      0%

  PID          Render/3D                    Blitter                      Video                    VideoEnhance          NAME
180820 |██████▊                    ||                          ||██████████████████████████▌|                          | ffmpeg


However, I noticed that even with HA on, my Server uses around 30% on all cores, while the video is transcoding.
Would you consider this as normal?

But the real question is:
what's the problem with edge?
How could I debug this?


RE: struggeling with Hardware acceleration in docker (Intel) - TheDreadPirate - 2024-09-22

If there is CPU usage while transcoding that probably audio transcoding and/or subtitle burn in. Both of those will always happen on the CPU. The ffmpeg log would tell us what it is doing. Share that via pastebin.

Can you try with Chrome or Firefox?


RE: struggeling with Hardware acceleration in docker (Intel) - Tone - 2024-09-23

Ah ok, maybe audio is the reason.
Subtitles are off.
https://pastebin.com/JTieTFM5

I tested it on other Windows machines and in Edge and Chrome the player is always crashing (with transcoding enabled).
Firefox does work.


RE: struggeling with Hardware acceleration in docker (Intel) - fract - 2024-09-23

uncheck vaapi and low power options.
do you have VPP option checked?
...if not, check it, an try...


RE: struggeling with Hardware acceleration in docker (Intel) - TheDreadPirate - 2024-09-23

(2024-09-23, 12:05 PM)fract Wrote: uncheck vaapi and low power options.
do you have VPP option checked?
...if not, check it, an try...

Low power encoding is required for their CPU (Jasper Lake).  VAAPI for decoding allows for a proper Dolby Vision support.

Strange.  Not sure why it is crashing in your browser.  And what do you mean by "crashing"?  The entire browser crashes?  The tab crashes?  Or does it report an error message? Can you open the developer console and see if there are any error messages?


RE: struggeling with Hardware acceleration in docker (Intel) - Tone - 2024-09-23

Only the player is crashing:
[Image: Bildschirmfoto-2024-09-23-um-19-59-46.png]

These are the errors in the console:
[Image: Bildschirmfoto-2024-09-23-um-20-01-54.png]
[Image: Bildschirmfoto-2024-09-23-um-20-01-39.png]


RE: struggeling with Hardware acceleration in docker (Intel) - TheDreadPirate - 2024-09-24

Can you try recreating the container?

Code:
docker compose down jellyfin
docker compose up -d jellyfin --force-recreate



RE: struggeling with Hardware acceleration in docker (Intel) - Tone - 2024-09-25

Same issue after recreating.

However, I noticed another error:
Refused to load media from 'blob:https://DOMAIN/a78cda39-96cd-4596-b9a1-6a87e570e492' because it violates the following Content Security Policy directive: "default-src https: 'unsafe-eval' 'unsafe-inline'". Note that 'media-src' was not explicitly set, so 'default-src' is used as a fallback.

This is strange because my Jellyfin is accessible over https://DOMAIN/jellyfin, not the root-dir.
But I set "Veröffentlichte Server-URIs" to "https://DOMAIN/jellyfin/" and "base-url" to "/jellyfin" in the settings.

But I think if I messed up the settings, the other browsers (and edge without transcoding) wouldn't work as well.