Cannot get jellyfin docker container to use nvenc hardware acceleration
from ludicolo@lemmy.ml to selfhosted@lemmy.world on 13 Jan 16:38
https://lemmy.ml/post/24744114

cross-posted from: lemmy.ml/post/24722787

I am running ubuntu with casa os. I was previously running an intel apu (the name has slipped me I will update the post when I can with this info). Recently I got a 1650 that I installed for nvenc transcoding. It seems all the proper drivers are installed but my jellyfin container still fails playback anytime with it turned on.

I have reinstalled the container with the nvidia device variable and no dice. I have also tried installing the nvidia cintainer toolkit but that didn’t work either. I am at a loss for trying to get nvenc to work.

Any help is appreciated!

EDIT: here is the ffmpeg log file

gofile.io/d/9nsBFq

#selfhosted

threaded - newest

just_another_person@lemmy.world on 13 Jan 16:43 next collapse

You need to be running the Nvidia container toolkit and specify the container be launched with that runtime if you want direct hardware access to enc/dec hardware.

ludicolo@lemmy.ml on 13 Jan 16:51 collapse

I followed this guide and seemed to get it working.

docs.nvidia.com/datacenter/…/install-guide.html

However jellyfin transcoding sttill doesn’t work. I have tried adding the “nvidia devices= all” environment variable, it still didn’t work.

I tried using the docker conpose from here

jellyfin.org/docs/general/…/nvidia/#configure-wit…

But when I try and run this command: “docker exec -it jellyfin ldconfig sudo systemctl restart docker”

It says the container is restarting and to try again when the container has started.

plantsmakemehappy@lemmy.world on 13 Jan 16:57 next collapse

I have no guidance on your issue but just to make sure, this is two commands and not one:

docker exec -it jellyfin ldconfig
sudo systemctl restart docker

Do you get the restarting message with just the first command?

ludicolo@lemmy.ml on 13 Jan 18:24 collapse

I ran it as two commands instead of one before and still got that error message.

However, I tried again with a different jellyfin image and the command seems to have ran fine.

just_another_person@lemmy.world on 13 Jan 16:59 next collapse

‘docker exec -it jellyfin nvidia-smi’

ludicolo@lemmy.ml on 13 Jan 18:26 collapse

I tried this and it says:

OCI runtime exec failed: unable to start container process: exec: “nvidia-smi”: executable file not found im $PATH: unknown

just_another_person@lemmy.world on 13 Jan 21:11 collapse

Sure seems like you’re either sourcing these images wrong, or they’re missing something. The docs themselves even reference this command as it’s a good way to test the container is linked to the host hardware properly.

Maybe try starting a shell and finding if that executable exists in the image.

tacostrange@lemmy.ml on 13 Jan 17:43 collapse

I had the same issue a few weeks ago. Try this in your docker compose

deploy:
      resources:
        reservations:
          devices:
            - driver: cdi
              device_ids:
                - nvidia.com/gpu=all
ludicolo@lemmy.ml on 13 Jan 18:39 collapse

This is what thay compose looks like now:

 services:
  jellyfin:
    image: jellyfin/jellyfin
    user: 1000:1000
    network_mode: 'host'
    volumes:
      - /DATA/AppData/jellyfin/config:/config
      - /DATA/AppData/jellyfin/cache:/cache
      - /DATA/AppData/jellyfin/media:/media
      - /mnt/drive1/media:/mnt/drive1/media
      - /mnt/drive2/Jellyfin:/mnt/drive2/Jellyfin
      - /mnt/drive3:/mnt/drive3
      - /mnt/drive4/media:/mnt/drive4/media
      - /mnt/drive5/jellyfin:/mnt/drive5/jellyfin
      - /mnt/drive6/jellyfin:/mnt/drive6/jellyfin
    runtime: nvidia
    deploy:
      resources:
        reservations:
          devices:
            - driver: cdi
              device_ids:
               - nvidia.com/gpu=all
            - /dev/nvidia-caps:/dev/nvidia-caps
            - /dev/nvidia0:/dev/nvidia0
            - /dev/nvidiactl:/dev/nvidiactl
            - /dev/nvidia-modeset:/dev/nvidia-modeset
            - /dev/nvidia-uvm:/dev/nvidia-uvm
            - /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools
              count: all
              capabilities: [gpu]

Edit: when I try and compose up it says “yaml: lin 30 mapping values are not allowed in this context” when I remove line 30 and 31 the output is “validating /DATA/AppData/jellyfin/docker-compose.yml: services.jellyfin.deploy.resources.reservations.devices.1 must be a mapping”

ludicolo@lemmy.ml on 13 Jan 16:54 next collapse

Here is a pic of my nvidia-smi output:

<img alt="" src="https://lemmy.ml/pictrs/image/a3b9706f-e0ca-4dc0-926a-0ad1c47f6faf.jpeg">

ludicolo@lemmy.ml on 13 Jan 19:18 collapse

THANK YOU ALL!

It was a problem with my docker compose file! I didn’t list the needed devices from the jellyfin documentation. I thought the Container was detecting the gpu but it wasn’t. Docker exec <container-name> nvidia-smi is your friend!

Edit: so now it doesnt kick me out saying the playback failed but its just a black screen with 4k media

Edit 2: my bad forgot to enable some transcoding settings in jellyfin lol