linuxserver / docker-jellyfin

GNU General Public License v3.0
607 stars 91 forks source link

Ubuntu 22.04 - "/dev/dri": no such file or directory #165

Closed flyingnobita closed 1 year ago

flyingnobita commented 1 year ago

linuxserver.io


Expected Behavior

On a host machine with Ubuntu Budgie 20.04 on Intel i5-4200U with Intel HD Graphics 4400, the container was successfully loading devices /dev/dri:/dev/dri for HW acceleration.

Upgraded host to Ubuntu 22.04 and expected the same docker compose config to work.

Current Behavior

After the upgrade, starting the container generate the error:

Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory

Steps to Reproduce

  1. Start with Docker Desktop on Ubuntu 22.04
  2. Create a docker-compose.yml with:
    jellyfin:
    image: linuxserver/jellyfin:latest
    container_name: jellyfin
    restart: unless-stopped
    # user: ubuntu
    # group_add:
    #   - render
    #   - video
    environment:
      - PUID=1000
      - PGID=1000
      - JELLYFIN_PublishedServerUrl=192.168.0.5 #optional
    volumes:
      - /home/ubuntu/docker_apps/jellyfin/config:/config
      - /media/nas/Media/Video:/media
    ports:
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
      - 1900:1900/udp #optional
    devices:
      - /dev/dri:/dev/dri
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0
  3. Start Docker

Environment

OS: Ubuntu 22.04.1 CPU architecture: x86_64 - i5-4200U w/ Intel HD Graphics 4400 How docker service was installed:

With Docker Desktop for Ubuntu DEB as according to official Docker docs.

Command used to create docker container (run/create/compose/screenshot)

  jellyfin:
    image: linuxserver/jellyfin:latest
    container_name: jellyfin
    restart: unless-stopped
    # user: ubuntu
    # group_add:
    #   - render
    #   - video
    environment:
      - PUID=1000
      - PGID=1000
      - JELLYFIN_PublishedServerUrl=192.168.0.5 #optional
    volumes:
      - /home/ubuntu/docker_apps/jellyfin/config:/config
      - /media/nas/Media/Video:/media
    ports:
      - 8096:8096
      - 8920:8920 #optional
      - 7359:7359/udp #optional
      - 1900:1900/udp #optional
    devices:
      - /dev/dri:/dev/dri
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0

Docker logs

None as container was started.

Extra Note: jellyfin runs fine when none of the 3 /dev/dri lines are included in the docker compose file (albeit w/o HW)

Also tried each of the following but got the same error:

  1. running container with default user ubuntu that has render and video group added (by way of usermod in host and group_add in docker compose file.
  2. running 2 above and also changing owner of /dev/dri/* to ubuntu:ubuntu
  3. setting 777 to /dev/dri/*
  4. running official image jellyfin/jellyfin:latest with the documented user permission setup
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

j0nnymoe commented 1 year ago

Your issue is likely docker for desktop limiting the container access. We do not recommend/support the docker for desktop methods. Install docker correctly using the helper script at https://get.docker.com

flyingnobita commented 1 year ago

Thanks for the quick reply.

So you're saying I should install Docker Engine rather than Docker Desktop (makes sense as my prev Docker install was probably Docker Engine as Docker Desktop for linux wasn't available back then).

I see there're 3 methods listed Docker's docs. Are you aware of any differeces in terms of container functionalities between the 3 methods?

"In testing and development environments, some users choose to use automated convenience scripts to install Docker."

The above statement from the documentation kinda worries me.

aptalca commented 1 year ago

https://get.docker.com works great on ubuntu

flyingnobita commented 1 year ago

Thank you for all the help guys, Docker Engine works like a charm!