• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions How to Specify QSV Device for Transcoding in Jellyfin on TrueNAS Scale with k3s?

     
    • 0 Vote(s) - 0 Average

    How to Specify QSV Device for Transcoding in Jellyfin on TrueNAS Scale with k3s?

    Jade
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #1
    2024-07-19, 05:01 PM (This post was last modified: 2024-07-19, 05:07 PM by Jade. Edited 2 times in total.)
    Hello everyone,
    I am running Jellyfin in a k3s environment on TrueNAS Scale and have set up two GPU devices within the container: an integrated GPU (iGPU) and an Arc A380 graphics card, both supporting QSV. These devices are recognized within the Jellyfin container as /dev/dri/renderD128 (iGPU) and /dev/dri/renderD129 (Arc A380). Currently, Jellyfin automatically selects the iGPU (renderD128) for video transcoding. I would like to configure Jellyfin to use the QSV on the Arc A380 (renderD129) instead.
    Could anyone guide me on how to configure Jellyfin or the container settings to force the use of the renderD129 device for hardware-accelerated transcoding? Are there specific environment variables or settings in the configuration files that I need to adjust?
    Additionally, here are the results of executing commands within the container to check the devices:

    Code:
    /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -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-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 @ 0x5564ed4e5480] libva: VA-API version 1.21.0
    [AVHWDeviceContext @ 0x5564ed4e5480] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
    [AVHWDeviceContext @ 0x5564ed4e5480] libva: Found init function __vaDriverInit_1_21
    [AVHWDeviceContext @ 0x5564ed4e5480] libva: va_openDriver() returns 0
    [AVHWDeviceContext @ 0x5564ed4e5480] Initialised VAAPI connection: version 1.21
    [AVHWDeviceContext @ 0x5564ed4e5480] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.3 (7c1c775).
    [AVHWDeviceContext @ 0x5564ed4e5480] Driver not found in known nonstandard list, using standard behaviour.
    [AVHWDeviceContext @ 0x5564ed517500] 1.0: Intel(R) OpenCL Graphics / Intel(R) UHD Graphics 730
    [AVHWDeviceContext @ 0x5564ed517500] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
    [AVHWDeviceContext @ 0x5564ed517500] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
    [AVHWDeviceContext @ 0x5564ed517500] 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'

    Code:
    I have no name!@jellyfin-868949cf78-ktmpn:/dev/dri$ /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD129 -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-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 @ 0x563508d7a480] libva: VA-API version 1.21.0
    [AVHWDeviceContext @ 0x563508d7a480] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
    [AVHWDeviceContext @ 0x563508d7a480] libva: Found init function __vaDriverInit_1_21
    [AVHWDeviceContext @ 0x563508d7a480] libva: va_openDriver() returns 0
    [AVHWDeviceContext @ 0x563508d7a480] Initialised VAAPI connection: version 1.21
    [AVHWDeviceContext @ 0x563508d7a480] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.3 (7c1c775).
    [AVHWDeviceContext @ 0x563508d7a480] Driver not found in known nonstandard list, using standard behaviour.
    [AVHWDeviceContext @ 0x563508dabbc0] 0.0: Intel(R) OpenCL Graphics / Intel(R) Arc(TM) A380 Graphics
    [AVHWDeviceContext @ 0x563508dabbc0] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
    [AVHWDeviceContext @ 0x563508dabbc0] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
    [AVHWDeviceContext @ 0x563508dabbc0] 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}...

    Thank you for any help or guidance you can provide!
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-07-19, 05:16 PM
    How are you passing in the GPUs? Are you just passing in /dev/dri in its entirety? If so, add renderD129 to the end of the pass-through path and it will only pass that device in.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Jade
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #3
    2024-07-20, 12:47 AM (This post was last modified: 2024-07-20, 01:05 AM by Jade. Edited 4 times in total.)
    Thank you for your response! In TrueNAS, the Web UI currently only allows us to pass through the GPU core numbers, not the render device path.
    Here's a video demonstrating the current GPU pass-through settings in the TrueNAS Web UI: https://files.catbox.moe/j0zt6g.mp4

    It would be incredibly helpful if Jellyfin could add a feature in the transcoding settings to input additional FFmpeg parameters or specifically allow for the selection of the QSV device, similar to the VAAPI device input option on the transcode settings page of jellyfin webui. This would provide a perfect solution for users like me who need more precise control over which GPU is used for transcoding.

    Just like this, copied from ffmpeg official document page: https://ffmpeg.org/ffmpeg.html
    Code:
    -init_hw_device qsv:hw,child_device=/dev/dri/renderD129
    Efficient_Good_5784
    Offline

    Community Moderator

    Posts: 1,167
    Threads: 3
    Joined: 2023 Jun
    Reputation: 50
    #4
    2024-07-20, 12:58 AM
    (2024-07-20, 12:47 AM)Jade Wrote:
    (2024-07-19, 05:16 PM)TheDreadPirate Wrote: How are you passing in the GPUs?  Are you just passing in /dev/dri in its entirety?  If so, add renderD129 to the end of the pass-through path and it will only pass that device in.

    Thank you for reply. But TrueNAS Web UI only allows to pass the GPU core numbers, not the render device path in the config page 😂
    https://files.catbox.moe/j0zt6g.mp4
    Due to how Linux works, Jellyfin cannot figure out which device is which GPU.

    And as of right now, Truenas Scale's Kubernetes app implementation doesn't allow for specifying which GPU to use ONLY if you have multiple from the same brand (in your case, both the CPU and GPU are from Intel).
    Your only choice right now is to either remove the GPU so you 100% know that the iGPU will be the one used, or switch the CPU to a different brand so you know the GPU will be used.

    If you wait for the next major Truenas Scale update to drop later this year, the app section will be reworked to not use Kubernetes and instead use Docker and compose files. You should be able to specify which GPU device is used there.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #5
    2024-07-20, 01:02 AM
    I did not know that about TrueNAS's kubernetes. If that is accurate, you would have to go into your BIOS and disable the iGPU.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    1
    Jade
    Offline

    Junior Member

    Posts: 3
    Threads: 1
    Joined: 2024 Jul
    Reputation: 0
    #6
    2024-07-20, 01:58 AM
    (2024-07-20, 01:02 AM)TheDreadPirate Wrote: I did not know that about TrueNAS's kubernetes.  If that is accurate, you would have to go into your BIOS and disable the iGPU.

    Thank you, disabled iGPU and transcoding works perfectly now!
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode