RetroFed Forum
Your home away from modern life.
GPU dri/by-path for Docker Compose how?
Post Reply
AuthorMessage
paydequeso piefed.social uuj8za@piefed.social
Joined: 2026-03-17
Quote

My Jellyfin config has some YAML like this.

# Sometimes work  
devices:  
- /dev/dri/renderD128:/dev/dri/renderD128  
- /dev/dri/card0:/dev/dri/card0  

Occasionally when I reboot my server, I end up with no card0 and instead I have /dev/dri/card1. This breaks my Jellyfin server...

I noticed there is also dri/by-path, which I'm guessing is a more stable path than a card index... however, doing this doesn't work for me.

# No work  
devices:  
- /dev/dri/by-path/pci-0000:00:02.0-render:/dev/dri/renderD128  
- /dev/dri/by-path/pci-0000:00:02.0-card:/dev/dri/card0  

I tried with and without quotes and the result is the same. Error to start. I'm guessing Docker is failing to correctly parse the string because of the colons in pci-0000:00:02.0-card...

How's everyone else handling this problem? I've been updating my compose.yaml every time the index switches, card0 to card1 to card0... but this is getting annoying now. (This is a worse problem now that I'm running Fedora IoT!)

Any thoughts?

16   Original
hperrin lemmy.ca hperrin@lemmy.ca
Joined: 2024-12-13
#2 · Quote Reply

Just mount /dev/dri.

17
ryannathans aussie.zone ryannathans@aussie.zone
Joined: 2023-09-20
#3 · Quote Reply

If you download hevc main 10 level 5.1 content or below you probably won't need to transcode and can skip the whole problem 🧠

-3
Appoxo lemmy.dbzer0.com Appoxo@lemmy.dbzer0.com
Joined: 2023-07-01
#4 · Quote Reply

  jellyfin:
    container_name: jellyfin
    image: linuxserver/jellyfin:amd64-version-12.1ubu2604
    expose:
      - 8096
    networks:
      - media
    volumes:
      - ${DIR_LOCALTIME}:/etc/localtime:ro
      - ${DIR_container}/jellyfin/config:/config
      - ${DIR_media}/data:/media/data
    devices:
      # IntelQuickSync für TigerLake GT2 [Iris Xe Graphics]
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0
    environment:
      PUID: 1200
      PGID: 1300
      #UMASK: 022
      TZ: ${TZ}
      DOCKER_MODS: linuxserver/mods:jellyfin-opencl-intel
      JELLYFIN_PublishedServerUrl: "https://jellyfin/.${DOMAIN_EXTERNAL}"
    deploy:
      resources:
        limits:
          memory: 10G
    group_add:
      - '44'
      - '992'
    labels:
      # Traefik:
      traefik.enable: true # Enable Traefik reverse proxy for the Traefik dashboard.
      traefik.http.services.jellyfin.loadbalancer.server.port: 8096
      traefik.http.routers.jellyfin-public.entrypoints: 'https'
      traefik.http.routers.jellyfin-public.rule: 'Host(`jellyfin.${DOMAIN_EXTERNAL}`)'
      # Secondary domain
      traefik.http.routers.jellyfin-public2.entrypoints: 'https'
      traefik.http.routers.jellyfin-public2.rule: 'Host(`jellyfin.${DOMAIN_EXTERNAL2}`)'
    restart: unless-stopped

Afaik the card0 is only used for rendering to a desktop/monitor and for this purpose you should actually use the renderD128 path.
But not sure either about this stuff. Sort of works for me. At least intel_gpu_top shows activity when transcoding :p

2
yaroto98 lemmy.world yaroto98@lemmy.world
Joined: 2025-08-10
#5 · Quote Reply

Just mount /dev/dri.

This is also good because if you have a newer cpu it has integrated graphics built in, and you have a dedicated gpu card, will give you two devices here, which this will auto mount both.

4
paydequeso piefed.social uuj8za@piefed.social
Joined: 2026-03-17
#6 · Quote Reply

Just mount /dev/dri.

Genius!

3
hperrin lemmy.ca hperrin@lemmy.ca
Joined: 2024-12-13
#7 · Quote Reply

Genius!

I had the same issue a while ago. :) I think the docs tell you to do it the way you had it, which is why it causes confusion.

3
robber lemmy.ml robber@lemmy.ml
Joined: 2022-11-25
#8 · Quote Reply

As an alternative to mounting full /dev/dri, there are symlinks under /dev/dri/by-path/ which you can use. IIUC they are linked by the used PCI slot, hence should be as stable as the physical order of the cards.

I use this pattern in a compose file:

...
devices:
  - source: /dev/dri/by-path/pci-XXX-render
    target: /dev/dri/renderD128
    permissions: rwm
2
Post Reply
Back to top