Jellyfin Forum
Hardware Acceleration and Docker - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Hardware Acceleration and Docker (/t-hardware-acceleration-and-docker)

Pages: 1 2 3


Hardware Acceleration and Docker - missmintygreen - 2024-06-12

Jellyfin version: 10.9.6
Install method: Docker Engine container
CPU: Intel i5 3470
GPU: Nvidia Quadro P400

New to Linux and I've managed to get a Docker install with Home Assistant and Jellyfin up and running. While video playback works just fine in Chrome, in the Jellyfin app, and on Swiftfin on my AppleTV, I picked up a GPU because I'd like to take some of the load off the CPU so that I can share access to my media library with some friends in the future. The majority of my movies and shows are just MKV files, and when I switch on hardware acceleration on the Dashboard, I'm not able to play back any of my media until it's switched off again.
I've tried to install the proper GPU driver for my P400, but I'm not sure that Jellyfin has proper access to it. I've been a bit confused by the directions on the Jellyfin website, considering my installation method. I'm relatively certain jellyfin-ffmpeg was installed when I created the container, so I think it's just a matter of configuring my GPU to work with Docker and Jellyfin.


RE: Hardware Acceleration and Docker - TheDreadPirate - 2024-06-12

How much of this guide did you read?

https://jellyfin.org/docs/general/administration/hardware-acceleration/nvidia/#official-docker


RE: Hardware Acceleration and Docker - missmintygreen - 2024-06-12

(2024-06-12, 01:34 AM)TheDreadPirate Wrote: How much of this guide did you read?

https://jellyfin.org/docs/general/administration/hardware-acceleration/nvidia/#official-docker

I'll be honest, I was trying to follow that guide, however, I mistakenly worked off the Linux host section. I believe I downloaded the driver on the host system. I tried installing a driver, but I'm not sure if it actually worked.

When I ran

Code:
sudo apt update && sudo apt install -y libnvidia-decode libnvidia-encode

I got this.

Code:
Package libnvidia-decode is a virtual package provided by:
  libnvidia-decode-550-server 550.54.15-0ubuntu0.22.04.2
  libnvidia-decode-550 550.67-0ubuntu1.22.04.2
  libnvidia-decode-545 545.29.06-0ubuntu0.22.04.2
  libnvidia-decode-535-server 535.161.08-0ubuntu2.22.04.1
  libnvidia-decode-535 535.171.04-0ubuntu0.22.04.1
  libnvidia-decode-470-server 470.239.06-0ubuntu0.22.04.1
  libnvidia-decode-470 470.239.06-0ubuntu0.22.04.1
  libnvidia-decode-450-server 450.248.02-0ubuntu0.22.04.1
  libnvidia-decode-418-server 418.226.00-0ubuntu5~0.22.04.1
  libnvidia-decode-390 390.157-0ubuntu0.22.04.2
You should explicitly select one to install.

Package libnvidia-encode is a virtual package provided by:
  libnvidia-encode-550-server 550.54.15-0ubuntu0.22.04.2
  libnvidia-encode-550 550.67-0ubuntu1.22.04.2
  libnvidia-encode-545 545.29.06-0ubuntu0.22.04.2
  libnvidia-encode-535-server 535.161.08-0ubuntu2.22.04.1
  libnvidia-encode-535 535.171.04-0ubuntu0.22.04.1
  libnvidia-encode-470-server 470.239.06-0ubuntu0.22.04.1
  libnvidia-encode-470 470.239.06-0ubuntu0.22.04.1
  libnvidia-encode-450-server 450.248.02-0ubuntu0.22.04.1
  libnvidia-encode-418-server 418.226.00-0ubuntu5~0.22.04.1
  libnvidia-encode-390 390.157-0ubuntu0.22.04.2
You should explicitly select one to install.

E: Package 'libnvidia-decode' has no installation candidate
E: Package 'libnvidia-encode' has no installation candidate

I'm not sure how to explicitly select one, or which is even the correct driver to use.

Do I just add a hyphen and the driver number?


RE: Hardware Acceleration and Docker - TheDreadPirate - 2024-06-12

You explicitly select one by typing it in.

sudo apt install libnvidia-encode-550 libnvidia-decode-550


RE: Hardware Acceleration and Docker - missmintygreen - 2024-06-12

(2024-06-12, 03:33 PM)TheDreadPirate Wrote: You explicitly select one by typing it in.

sudo apt install libnvidia-encode-550 libnvidia-decode-550

Okay, so I got all the way through this after installing the driver and the container toolkit, but on step 6, I input this

Code:
docker exec -it jellyfin nvidia-smi

and got this

Code:
OCI runtime exec failed: exec failed: unable to start container process: exec: "nvidia-smi": executable file not found in $PATH: unknown

I'm not sure where I went wrong. The rest of the process went pretty smoothly.


RE: Hardware Acceleration and Docker - TheDreadPirate - 2024-06-12

Step number 2. Did you install the Nvidia container toolkit? Because why would Nvidia make things simple for us?

Also, can you share your docker compose file with us?


RE: Hardware Acceleration and Docker - missmintygreen - 2024-06-12

(2024-06-12, 10:11 PM)TheDreadPirate Wrote: Step number 2.  Did you install the Nvidia container toolkit?  Because why would Nvidia make things simple for us?

Also, can you share your docker compose file with us?

Yes, I did install the container toolkit! Can't have it be too easy or everyone would be doing it.

Here's my compose file!

Code:
services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    network_mode: 'host'
    volumes:
      - /home/me/jellyfin:/config
      - /home/me/jellyfin:/cache
      - type: bind
        source: /media/me/library/Movies
        target: /Movies
      - type: bind
        source: /media/me/library/Shows
        target: /Shows
        read_only: true
    restart: 'unless-stopped'
    runtime: nvidia
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]



RE: Hardware Acceleration and Docker - TheDreadPirate - 2024-06-12

Does nvidia-smi work on the host system?

On the host what is the output "sudo apt list --installed | grep header"


RE: Hardware Acceleration and Docker - missmintygreen - 2024-06-12

(2024-06-12, 10:29 PM)TheDreadPirate Wrote: Does nvidia-smi work on the host system?

On the host what is the output "sudo apt list --installed | grep header"

nvidia-smi returned this

Code:
Wed Jun 12 18:34:10 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.171.04            Driver Version: 535.171.04  CUDA Version: 12.2    |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf          Pwr:Usage/Cap |        Memory-Usage | GPU-Util  Compute M. |
|                                        |                      |              MIG M. |
|=========================================+======================+======================|
|  0  Quadro P400                    Off | 00000000:01:00.0 Off |                  N/A |
| 34%  34C    P8              N/A /  N/A |    150MiB /  2048MiB |      0%      Default |
|                                        |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+

+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU  GI  CI        PID  Type  Process name                            GPU Memory |
|        ID  ID                                                            Usage      |
|=======================================================================================|
|    0  N/A  N/A      854      G  /usr/lib/xorg/Xorg                          64MiB |
|    0  N/A  N/A      1121      G  /usr/bin/gnome-shell                        59MiB |
+---------------------------------------------------------------------------------------+

I got this back from "sudo apt lost --installed | grep header"

Code:
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

linux-headers-6.5.0-28-generic/jammy-updates,jammy-security,now 6.5.0-28.29~22.04.1 amd64 [installed,automatic]
linux-headers-6.5.0-35-generic/jammy-updates,jammy-security,now 6.5.0-35.35~22.04.1 amd64 [installed,automatic]
linux-headers-generic-hwe-22.04/jammy-updates,jammy-security,now 6.5.0.35.35~22.04.1 amd64 [installed,automatic]
linux-hwe-6.5-headers-6.5.0-28/jammy-updates,jammy-updates,jammy-security,jammy-security,now 6.5.0-28.29~22.04.1 all [installed,automatic]
linux-hwe-6.5-headers-6.5.0-35/jammy-updates,jammy-updates,jammy-security,jammy-security,now 6.5.0-35.35~22.04.1 all [installed,automatic]



RE: Hardware Acceleration and Docker - TheDreadPirate - 2024-06-12

I'm wondering if there are mismatched drivers or something. Since you're using Ubuntu you can check out their documentation or Nvidia drivers. Ubuntu includes some tools to make things easier.

https://ubuntu.com/server/docs/nvidia-drivers-installation