• 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 Troubleshooting SOLVED: Can't access GPU in docker container

     
    • 0 Vote(s) - 0 Average

    SOLVED: Can't access GPU in docker container

    creylon
    Offline

    Junior Member

    Posts: 23
    Threads: 6
    Joined: 2023 Jul
    Reputation: 0
    Country:Germany
    #1
    2024-04-29, 11:41 AM (This post was last modified: 2024-04-29, 02:22 PM by creylon. Edited 4 times in total.)
    Hi,

    I am trying to run the unstable branch with hardware acceleration. I have an AMD GPU.

    Here is my docker config:

    Code:
      jellyfin-beta:
        container_name: jellyfin-beta
        image: ghcr.io/jellyfin/jellyfin:unstable
        group_add:
          - "989" # render group
          - "986" # video group
          - "993" # input group
        dns:
          - 1.1.1.1
        volumes:
          - "./config.beta:/config"
          - "./cache.beta:/cache"
          - "./config.json:/jellyfin/jellyfin-web/config.json"
          - "/home/media:/media:ro"
        devices:
          # VAAPI Devices
          - /dev/dri/renderD129:/dev/dri/renderD128
          - /dev/dri/card1:/dev/dri/card0
        restart: always

    When I run

    Code:
    docker exec -it jellyfin-beta /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128

    I get the following error:

    Code:
    Trying display: drm

    Failed to a DRM display for the given device

    This error occurs as of unstable build 2024032505. With previous builds everything works fine. I run another jellyfin instance with stable branch and same configuration without issues.

    Thanks
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-04-29, 12:01 PM
    Try swapping out /dev/dri/card0 with "/dev/kfd".
    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]
    creylon
    Offline

    Junior Member

    Posts: 23
    Threads: 6
    Joined: 2023 Jul
    Reputation: 0
    Country:Germany
    #3
    2024-04-29, 12:25 PM
    So I tried

    Code:
        devices:
          - /dev/dri/renderD129:/dev/dri/renderD128
          - /dev/dri/card1:/dev/kfd

    and

    Code:
        devices:
          - /dev/dri/renderD129:/dev/dri/renderD128
          - /dev/kfd:/dev/kfd

    neither worked, same error. I don't use OpenCL btw
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-04-29, 01:10 PM (This post was last modified: 2024-04-29, 01:10 PM by TheDreadPirate. Edited 1 time in total.)
    Just realized you're using a month old build. Can you re-pull the image and grab today's build? 2024042905
    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]
    creylon
    Offline

    Junior Member

    Posts: 23
    Threads: 6
    Joined: 2023 Jul
    Reputation: 0
    Country:Germany
    #5
    2024-04-29, 01:25 PM
    I am using unstable tag for the image, which has the latest build from today. The error occurs first with build 2024032505. So in build 2024031805 this config works fine.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2024-04-29, 02:07 PM (This post was last modified: 2024-04-29, 02:08 PM by TheDreadPirate. Edited 2 times in total.)
    What GPU is in your system? I spun up unstable on my desktop with an RX6800 and it appears to transcode as expected with vulkan.

    Code:
    /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -init_hw_device drm=dr:/dev/dri/renderD128 -init_hw_device vaapi=va@dr -init_hw_device vulkan=vk@dr -filter_hw_device vk -hwaccel vaapi -hwaccel_output_format vaapi -noautorotate -i file:"/media/library/Anime Movies/5 Centimeters per Second (2007)/5 Centimeters per Second.mkv" -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode VBR -b:v 17895107 -maxrate 17895107 -bufsize 35790214 -sei -a53_cc -force_key_frames:0 "expr:gte(t,n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12" -codec:a:0 libfdk_aac -ac 2 -ab 256000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type fmp4 -hls_fmp4_init_filename "64f6bedc7a7eec0752e5ac99bd812839-1.mp4" -start_number 0 -hls_segment_filename "/config/transcodes/64f6bedc7a7eec0752e5ac99bd812839%d.mp4" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcodes/64f6bedc7a7eec0752e5ac99bd812839.m3u8"

    Code:
    root@optimus-maximus:/docker/jellyfin/jellyfin-data/config/log# docker exec -it jellyfin /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128
    Trying display: drm
    libva info: VA-API version 1.21.0
    libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/radeonsi_drv_video.so
    libva info: Found init function __vaDriverInit_1_21
    amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
    If they do, bad things may happen!
    libva info: va_openDriver() returns 0
    vainfo: VA-API version: 1.21 (libva 2.21.0)
    vainfo: Driver version: Mesa Gallium driver 24.0.5 for AMD Radeon RX 6800 (radeonsi, navi21, LLVM 16.0.6, DRM 3.54, 6.5.0-28-generic)
    vainfo: Supported profile and entrypoints
          VAProfileMPEG2Simple            :    VAEntrypointVLD
          VAProfileMPEG2Main              :    VAEntrypointVLD
          VAProfileVC1Simple              :    VAEntrypointVLD
          VAProfileVC1Main                :    VAEntrypointVLD
          VAProfileVC1Advanced            :    VAEntrypointVLD
          VAProfileH264ConstrainedBaseline:    VAEntrypointVLD
          VAProfileH264ConstrainedBaseline:    VAEntrypointEncSlice
          VAProfileH264Main               :    VAEntrypointVLD
          VAProfileH264Main               :    VAEntrypointEncSlice
          VAProfileH264High               :    VAEntrypointVLD
          VAProfileH264High               :    VAEntrypointEncSlice
          VAProfileHEVCMain               :    VAEntrypointVLD
          VAProfileHEVCMain               :    VAEntrypointEncSlice
          VAProfileHEVCMain10             :    VAEntrypointVLD
          VAProfileHEVCMain10             :    VAEntrypointEncSlice
          VAProfileJPEGBaseline           :    VAEntrypointVLD
          VAProfileVP9Profile0            :    VAEntrypointVLD
          VAProfileVP9Profile2            :    VAEntrypointVLD
          VAProfileAV1Profile0            :    VAEntrypointVLD
          VAProfileNone                   :    VAEntrypointVideoProc

    My docker compose for reference.

    Code:
    services:
      jellyfin:
        image: jellyfin/jellyfin:unstable
        container_name: jellyfin
        user: 1000:1000
        group_add:
          - "44" #video
          - "105" #render
        network_mode: 'host'
        volumes:
          - ./jellyfin-data/config:/config
          - ./jellyfin-data/cache:/cache
          - /media:/media:ro
        restart: 'unless-stopped'
        environment:
          - ROC_ENABLE_PRE_VEGA=1
        devices:
          - /dev/dri:/dev/dri
          - /dev/kfd:/dev/kfd
        extra_hosts:
          - "host.docker.internal:host-gateway"

    I am not specifying the device, just providing the whole /dev/dri folder. I noticed you were using renderD129, do you have more than one device? Perhaps an Intel 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]
    creylon
    Offline

    Junior Member

    Posts: 23
    Threads: 6
    Joined: 2023 Jul
    Reputation: 0
    Country:Germany
    #7
    2024-04-29, 02:21 PM
    I've got a Ryzen 5 5600G which has builtin GPU and a dedicated Radeon RX 5500. As I want to use the dedicated GPU I map renderD129.

    I mapped the devices like you did:

    Code:
        devices:
          - /dev/dri:/dev/dri
          - /dev/kfd:/dev/kfd

    Now it works. I don't understand why that would make a difference, but thanks for the help
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #8
    2024-04-29, 02:51 PM
    Yep. Since you can specify the render device with VAAPI you can still tell it to use renderD129 that way. Why that makes a difference, IDK.
    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]
    « 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