Jellyfin with working nvidia-docker2 transcoding

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 documentation you also seem to have to use the runtime option in the json file",jellyfin%20docker%20container.

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": [
			"environment": {
                "PUID": {
                    "description": "Enter a valid UID of an existing user with permission to media shares to run Jellyfin as.",
                    "label": "UID",
                    "index": 1,
                "PGID": {
                    "description": "Enter a valid GID of an existing user with permission to media shares to run Jellyfin as.",
                    "label": "GID",
                    "index": 2,
					"description": "Enter which NVIDIA driver capabilities should be enabled (default: all)",
					"label": "NVIDIA Driver Capabilities",
					"index": 3,
					"default": "all"
					"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 image:



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:


On my Jellyfin transcode log:

Output #0, hls, to ‘/transcode/a7e4651191a41a8d519cb649c2176998.m3u8’:
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)
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)
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


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