Jellyfin Forum
SOLVED: Hardware Transcoding - 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: SOLVED: Hardware Transcoding (/t-solved-hardware-transcoding)

Pages: 1 2 3


RE: Hardware Transcoding - PapaTrotsky - 2023-11-14

(2023-11-14, 08:50 PM)TheDreadPirate Wrote: Did you find any guides to help you ensure the container has access to the GPU?

https://www.reddit.com/r/unRAID/comments/wkchyv/requesting_help_with_jellyfin_nvenc_transcoding/

Just tried this, it turned my jellyfin into an orphan image... Gonna try restarting docker and hoping it didn't just destroy everything.


RE: Hardware Transcoding - PapaTrotsky - 2023-11-14

(2023-11-14, 10:21 PM)tmsrxzar Wrote: i would like to help more but that was just what i found that was related to your issue

i use debian, lscr.io/linuxserver/jellyfin:latest, intel graphics and portainer to manage docker

there are no parallels i can draw from that will help you

Ok, I tried a few more things. I tried adding the environmental variables again and running commands but I'm getting this output. I do have nvidia drivers and they should work, but maybe I'm just stupid.

Code:
root@HomeServer:~# docker exec -it jellyfin nvidia-smi
OCI runtime exec failed: exec failed: unable to start container process: exec: "nvidia-smi": executable file not found in $PATH: unknown



RE: Hardware Transcoding - tmsrxzar - 2023-11-14

well thats at least something new

i am trying to walk backwards on what /should/ have taken place when you installed and so far it's reminding me why im not an nvidia+linux fan
no matter, nobody cares what i am a fan of



you installed linuxserver.io docker
did you follow this - https://docs.linuxserver.io/images/docker-jellyfin/#nvidia
which takes you to installing nvidia-docker - https://github.com/NVIDIA/nvidia-docker
which takes you to a deprecated page but then you should install the container-toolkit - https://github.com/NVIDIA/nvidia-container-toolkit

so what should have taken place is the install instructions for container-toolkit - https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

is that correct and was the container-toolkit installed (successfully)?


RE: Hardware Transcoding - TheDreadPirate - 2023-11-14

https://forums.unraid.net/topic/98978-plugin-nvidia-driver/


RE: Hardware Transcoding - PapaTrotsky - 2023-11-14

(2023-11-14, 11:08 PM)TheDreadPirate Wrote: https://forums.unraid.net/topic/98978-plugin-nvidia-driver/

That worked properly, I do have the driver. Maybe Jellyfin is just looking in the wrong spot for the nvidia-smi executable, though I'm unsure of how to change it to the right place or where the right place would be.


RE: Hardware Transcoding - PapaTrotsky - 2023-11-14

(2023-11-14, 11:07 PM)tmsrxzar Wrote: well thats at least something new

i am trying to walk backwards on what /should/ have taken place when you installed and so far it's reminding me why im not an nvidia+linux fan
no matter, nobody cares what i am a fan of



you installed linuxserver.io docker
did you follow this - https://docs.linuxserver.io/images/docker-jellyfin/#nvidia
which takes you to installing nvidia-docker - https://github.com/NVIDIA/nvidia-docker
which takes you to a deprecated page but then you should install the container-toolkit - https://github.com/NVIDIA/nvidia-container-toolkit

so what should have taken place is the install instructions for container-toolkit - https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html

is that correct and was the container-toolkit installed (successfully)?

I hate NVIDIA on Linux, the NVIDIA driver on Linux Mint for the 4070 causes my laptop to run stupidly inefficiently. Talking 1/3 the battery life.
The container toolkit does work, I didn't install it because my server doesn't have apt, or yum/dnf, or Zypper but the sample workload works and basic nvidia-smi works correctly.

Code:
root@HomeServer:~# sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
aece8493d397: Pull complete
Digest: sha256:2b7412e6465c3c7fc5bb21d3e6f1917c167358449fecac8176c6e496e5c1f05f
Status: Downloaded newer image for ubuntu:latest
Tue Nov 14 23:18:46 2023     
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.02              Driver Version: 545.29.02    CUDA Version: 12.3    |
|-----------------------------------------+----------------------+----------------------+
| 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  NVIDIA GeForce GTX 1050 Ti    Off | 00000000:08:00.0 Off |                  N/A |
|  0%  44C    P0              N/A / 120W |      0MiB /  4096MiB |      2%      Default |
|                                        |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                       
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU  GI  CI        PID  Type  Process name                            GPU Memory |
|           ID  ID                                                            Usage      |
|=======================================================================================|
|  No running processes found                                                          |
+---------------------------------------------------------------------------------------+

I did also follow the LSIO guide, I believe I did that part correctly but it's hard to tell because unRaid uses a GUI for that part which makes it really confusing. I attached a few photos with pictures of my variables setup.


RE: Hardware Transcoding - TheDreadPirate - 2023-11-14

Have you tried enabling NVENC in jellyfin and transcoding since we've done all of this? Since nvidia-smi works in the container now.

Honestly, you should probably go to the UnRaid forum. Not a lot of Nvidia + UnRaid users that are also regulars here. IMO, this is an Unraid problem that just happens to be affecting Jellyfin.


RE: Hardware Transcoding - PapaTrotsky - 2023-11-14

(2023-11-14, 11:42 PM)TheDreadPirate Wrote: Have you tried enabling NVENC in jellyfin and transcoding since we've done all of this?  Since nvidia-smi works in the container now.

Yes, NVIDIA-SMI works in unRaid but if I do the 'docker exec -it jellyfin nvidia-smi' command it doesn't. If I open unRaid terminal, it gives an error for the docker exec command but not for the basic nvidia-smi command.

Code:
root@HomeServer:~# nvidia-smi
Tue Nov 14 18:44:37 2023     
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.02              Driver Version: 545.29.02    CUDA Version: 12.3    |
|-----------------------------------------+----------------------+----------------------+
| 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  NVIDIA GeForce GTX 1050 Ti    Off | 00000000:08:00.0 Off |                  N/A |
|  0%  43C    P0              N/A / 120W |      0MiB /  4096MiB |      0%      Default |
|                                        |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                       
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU  GI  CI        PID  Type  Process name                            GPU Memory |
|        ID  ID                                                            Usage      |
|=======================================================================================|
|  No running processes found                                                          |
+---------------------------------------------------------------------------------------+
root@HomeServer:~# docker exec -it jellyfin nvidia-smi
OCI runtime exec failed: exec failed: unable to start container process: exec: "nvidia-smi": executable file not found in $PATH: unknown

And when I turn back on transcoding in jellyfin I get the same error as when we started, but when I turn transcoding off it works fine. I think the issue lies with jellyfin seeing the driver. I'm guessing I have to add a path variable from jellyfin to the driver but I don't know where the driver is or what I'd have to call the path variable.


RE: Hardware Transcoding - TheDreadPirate - 2023-11-14

Yeah. This is definitely an Unraid forum question. There aren't many, if any, Unraid experts here. And this is an Unraid problem.


RE: Hardware Transcoding - PapaTrotsky - 2023-11-14

(2023-11-14, 11:51 PM)TheDreadPirate Wrote: Yeah.  This is definitely an Unraid forum question.  There aren't many, if any, Unraid experts here.  And this is an Unraid problem.

Ok, thanks for the effort, I'd still appreciate any help here if someone has it. I'll make sure to post my solution here when I find it.