Jellyfin with working nvidia-docker2 transcoding

Hi,
I have been having a trouble with my own Jellyfin.json parameters with nvidia-docker2.
Whatever I have tried I had zero success to passtrough my gpu to the docker image.
Got cuda errors when trying hardware transcoding as seen in logs.
Reacently did a clean Leap15.2 install and slapped in a Quadro P400 to my hardware.
What I’m doing wrong and how can I add these additional parameters to .json file:

-e NVIDIA_DRIVER_CAPABILITIES=all \ (enviriomental variable?)
-e NVIDIA_VISIBLE_DEVICES=all \ (enviriomental variable?)
–gpus all \ (opts?)

Any help to point out where adding these lines to Rock-On structure would be highly appreciated :slight_smile:

Here is setup guide links: Jellyfin and Nvidia

My boring setup:
[OS: Rockstor Leap 15.2 install image, Docker Server Version: 20.10.9-ce, GPU: Quadro P400, Driver Version: 495.29.05, CUDA Version: 11.5].
Installed packages: nvidia-docker2, x11-video-nvidiaG05, nvidia-glG05
Image: jellyfin/jellyfin

1 Like

@nasrocket, happy new year. Can you post your json file as well as the configuration values you populate? Maybe that will provide some additional insights to what might be “missing”, if any.

I assume, the command from the nvidia setup link using a base cuda container, provides the “desired” output to indicate a successful install:
sudo docker run --rm --gpus all nvidia/cuda:11.0-base nvidia-smi

On the additional variables you asked for, one is an option variable (as you pointed out) and the others are the environment variables, so you can place them in the respective sections of the json file.
According to the linuxserver.io documentation you also seem to have to use the runtime option in the json file"
Docker.

I guess, it will also mean that you ensure that you “recreate” the container (in case it already exists) - and e.g. use the /opt/rockstor/bin/delete-rockon 'Jellyfin' option to ensure after uninstall before relaunching the installation.

Here’s an example (I omitted the other sections that are usually present as well):

            "opts": [
                [
                    "--net",
                    "host"
                ],
				[
					"--gpus",
					"all"
				],
                [
                    "--runtime",
                    "nvidia"
                ]
            ],                
			"environment": {
                "PUID": {
                    "description": "Enter a valid UID of an existing user with permission to media shares to run Jellyfin as.",
                    "label": "UID",
                    "index": 1,
                    "default":1000
                },
                "PGID": {
                    "description": "Enter a valid GID of an existing user with permission to media shares to run Jellyfin as.",
                    "label": "GID",
                    "index": 2,
                    "default":1000
                },
				"NVIDIA_DRIVER_CAPABILITIES": {
					"description": "Enter which NVIDIA driver capabilities should be enabled (default: all)",
					"label": "NVIDIA Driver Capabilities",
					"index": 3,
					"default": "all"
				},
				"NVIDIA_VISIBLE_DEVICES": {
					"description": "Select which visible devices should be selected (default: all)",
					"label": "NVIDIA Visible Devices",
					"index": 4,
					"default": "all"						
			}

Finally, looking at the config page you referenced above, there might be something that you need to do with the user that you specify as part of the linuxserver.io image:

3 Likes

Happy new year you too @Hooverdan. And thank you so much you for your help :clap:. I managed to h264_nvenc transcode ~600fps for the very first time.
Anyone else who is figuring this out here are some pointers.

  • brute-force with delete-rockon if you have any Rock-On database Jellyfin entries
  • nvidia-docker2 installed
  • drivers installed (I needed zypper install x11-video-nvidiaG05 nvidia-glG05)
  • .json –runtime “nvidia” is NOT needed on OpenSUSE, it will prevent Rock-On install
  • leave VAAPI entry empty
  • .json add env/enviriomental options all
  • permissions correct

TLDR: you only need to add to -json these lines:

and

On my Jellyfin transcode log:

Output #0, hls, to ‘/transcode/a7e4651191a41a8d519cb649c2176998.m3u8’:
Metadata:
encoder : Lavf58.45.100
Stream #0:0: Video: h264 (h264_nvenc) (High), cuda, 426x176 [SAR 352:355 DAR 12:5], q=-1–1, 292 kb/s, 23.98 fps, 90k tbn, 23.98 tbc (default)
Metadata:
encoder : Lavc58.91.100 h264_nvenc
Side data:
cpb: bitrate max/min/avg: 292000/0/292000 buffer size: 584000 vbv_delay: N/A
Stream #0:1: Audio: aac (LC), 48000 Hz, 5.1, fltp, 128 kb/s (default)
Metadata:
encoder : Lavc58.91.100 aac
[hls @ 0x56301d4875c0] Opening ***
frame= 201 fps=153 q=31.0 size=N/A time=00:00:08.48 bitrate=N/A speed=6.46x

3 Likes

Cool. Glad it works. And good to know that the runtime option is not needed under OpenSUSE.

3 Likes

Breaking change. Beware updating beyond Leap 15.4. I took the bait and now I’m struggling to get Nvidia driver installed with bunch of compiler errors.

make[1]: Leaving directory '/usr/src/kernel-modules/nvidia-570.124.06-default/src/nvidia'
make -C kernel-open modules_install
make[1]: Entering directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'
make[1]: command: Command not found
Makefile:63: WARNING: Unable to locate the compiler gcc from CONFIG_CC_VERSION_TEXT in the kernel configuration.
make[2]: Entering directory '/usr/src/linux-6.13.6-lp156.3.g19a5ae2'
make[3]: Entering directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'
  DEPMOD  /lib/modules/6.13.6-lp156.3.g19a5ae2-default
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[3]: Leaving directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'
make[2]: Leaving directory '/usr/src/linux-6.13.6-lp156.3.g19a5ae2'
make[1]: Leaving directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'
/
/usr/src/kernel-modules/nvidia-570.124.06-default /
make -C src/nvidia clean
make[1]: Entering directory '/usr/src/kernel-modules/nvidia-570.124.06-default/src/nvidia'
rm -f -rf _out/Linux_x86_64
make[1]: Leaving directory '/usr/src/kernel-modules/nvidia-570.124.06-default/src/nvidia'
make -C src/nvidia-modeset clean
make[1]: Entering directory '/usr/src/kernel-modules/nvidia-570.124.06-default/src/nvidia-modeset'
rm -f -rf _out/Linux_x86_64
make[1]: Leaving directory '/usr/src/kernel-modules/nvidia-570.124.06-default/src/nvidia-modeset'
make -C kernel-open clean
make[1]: Entering directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'
make[1]: command: Command not found
Makefile:63: WARNING: Unable to locate the compiler gcc from CONFIG_CC_VERSION_TEXT in the kernel configuration.
rm -f -r conftest
make[2]: Entering directory '/usr/src/linux-6.13.6-lp156.3.g19a5ae2'
make[3]: Entering directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'
make[3]: Leaving directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'
make[2]: Leaving directory '/usr/src/linux-6.13.6-lp156.3.g19a5ae2'
make[1]: Leaving directory '/usr/src/kernel-modules/nvidia-570.124.06-default/kernel-open'

did you uninstall the nvidia drivers before upgrading? Or did you do a clean Leap 15.x install and then this is happening upon trying to install?

2 Likes

Neither. I upgraded from Leap 15.4 to 15.6 (Rockstor 4.6) with previous nvidia drivers being installed. Now I have been trying to get it together by installing newer or previous driver packages. My guess is that the kernel (Linux: 6.13.6-lp156.3.g19a5ae2-default) is too new or uncompatible for nvidia-open drivers and should have tried a clean Leap install.

Did you uninstall the old ones? A brief perusal of a couple of online comments seemed to indicate that one needs to uninstall first. But you probably have done that.

Well I ended up reinstalling rockstor from fresh 5.1.0.11 image.

  • Add NVIDIA repository, change nvidia-container-toolkit vendor
    Opensuse NVIDA
    NVIDIA container-toolkit
  • Install latest G06-drivers and nvidia-docker2
  • service daemon-reload and service docker restart
  • remember to put video group id at rockon install

And I can happily tell everything is working again and transcoding.
Here is a ready copy-paste JSON.

3 Likes