mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-01-23 23:20:51 +01:00
[Issue]: Can't use the GPU in Jellyfin QNAP Docker image for hardware acceleration #4872
Labels
No labels
area:database
awaiting-feedback
backend
blocked
breaking change: web api
bug
build
ci
confirmed
discussion needed
dotnet future
downstream
duplicate
EFjellyfin.db
enhancement
feature
future
github-actions
good first issue
hdr
help wanted
invalid
investigation
librarydb
live-tv
lyrics
media playback
music
needs testing
nuget
performance
platform
pull-request
question
regression
release critical
requires-web
roadmap
security
security
stale
support
syncplay
ui & ux
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/jellyfin#4872
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @DrakeHamString on GitHub (May 24, 2023).
Please describe your bug
Hi there,
I'm having the issue that I can't get Jellyfin to use my GPU (Nvidia Quadro P400) on my QNAP TS-673A due to persistent Nvidia driver in the kernel.
I was following your guide here: https://jellyfin.org/docs/general/administration/hardware-acceleration/
and working on the command line inside of the docker image.
I'm already passing the GPU to the container and its recognized:
OS inside of the container:
Your guide also guided me to this site, where I followed the instructions to install the GPU driver for Debian 11 "Bullseye":
https://wiki.debian.org/NvidiaGraphicsDrivers
From that I used those commands:
Added this to
/etc/apt/sources.listWhile Installing I get this message:
(none of those suggested things worked)
When executing
nvidia-smiI get this:So I suspect that there is already a newer version of the Nvidia driver embedded in the kernel of this docker image, which I cant use.
Kernel info:
I already tried to purge everything (
apt purge nvidia* libnvidia*) and installed again. Same error.When installed:
(it outputs nothing when no driver installed)
And no, reboot did not help too (I can't do more than stopping and starting the container)
When trying to enable hardware encoding in the Jellyfin settings and start a video, then I get the iconic error message with incompatible media.
I hope you can help with with that issue.
Jellyfin Version
Other
if other:
10.8.10
Environment
Jellyfin logs
No response
FFmpeg logs
Please attach any browser or client logs here
No response
Please attach any screenshots here
No response
Code of Conduct
@nyanmisaka commented on GitHub (May 24, 2023):
I doubt you can’t use the standard NVIDIA driver package from the distro. Instead, you should install it according to QNAP’s documentation.
@DrakeHamString commented on GitHub (May 24, 2023):
On the QNAP Host there is already automatically installed a Nvidia driver and its working
@nyanmisaka commented on GitHub (May 24, 2023):
I see. So you don't need to install user mode driver from the repo since the versions are mismatched.
Remove them and check the extra docker cli from this doc - https://www.qnap.com/en-us/how-to/tutorial/article/how-to-use-tensorflow-with-container-station
@DrakeHamString commented on GitHub (May 24, 2023):
thanks, thats what I also tried
and I checked with the extra devices and mappings from the doc - everything is already there in my container:
@nyanmisaka commented on GitHub (May 24, 2023):
Maybe this one helps? https://gist.github.com/weshofmann/620b924cde5dd498880e9315e48e793b?permalink_comment_id=4487458#gistcomment-4487458
[/share/CACHEDEV1_DATA/.qpkg/NVIDIA_GPU_DRV/usr/bin] # ./nvidia-smishould give correct output.@prahal commented on GitHub (May 25, 2023):
@grossmaul there is no kernel in a container.
So the issue is with your host setup (though drivers could be in userspace so driver could have to be installed in the container).
On the contrary, the libraries that access the host kernel device files are loaded from the container.
So:
means you should have the same Nvidia library version inside the container as the kernel driver on the host.
Seems Nvidia is binding dependencies hard.
@DrakeHamString commented on GitHub (May 25, 2023):
yeah, yesterday I learned that I shall not edit anything inside of the container, so I reverted everything and went to the host instead.
The command by @nyanmisaka gives this output:
So I highly suspect that its a driver issue from QNAP. There is only one driver (plus Kernel driver) I can install and nothing else...
Now I opened a support case with QNAP
@DrakeHamString commented on GitHub (May 25, 2023):
Finally found the solution! Had to use this fix.
My solution works on a QNAP TS-673A (applicable for every TS-x76A, like TS-476A and TS-876A) with a Quadro P400 (but other cards should work too since the solution is independent from the GPU model).
I think that this solution might work on other QNAP NAS models too.
Problem I want to fix:
This causes that containers can't use the GPU for hardware acceleration (HWA)
Step One:
vi /etc/ld.so.conf/opt/NVIDIA_GPU_DRV/usr/lib(you may have to adjust it)ldconfigAfter this you get a proper output from
nvidia-smi:Step Two:
Now you have to do the same inside of the container, but swap the path with the linked path in your container's environmet.
In my case
/share/CACHEDEV1_DATA/.qpkg/NVIDIA_GPU_DRV/usris linked with/usr/local/nvidiain the container. So I did this:/bin/bashvi /etc/ld.so.conf(vim was not installed, so I had to doapt update && apt install -y vim)/usr/local/nvidia/libldconfigDone!
HWA works in Jellyfin now!
Just found out that Step One is not necessary for HWA to work inside of the container. But you are save for future applications if you did this I think.
@deejayexe commented on GitHub (Sep 28, 2023):
Hi!
This can be more easy if you add this to your enviroment compose, it is permantly in linuxserver/jellyfin docker
environment:
LD_LIBRARY_PATH: /share/CACHEDEV1_DATA/.qpkg/NVIDIA_GPU_DRV/usr:/usr/local/nvidia/lib
@Eniot666 commented on GitHub (Nov 21, 2023):
Good morning,
I am able to play step 1 but when I get to step 2 I get the error:
Failed to initialize NVML: Unknown Error
Could you share here the docker compose that you are using?
look at mine
Eniot
@deejayexe commented on GitHub (Nov 22, 2023):
hi @Eniot666 , this is my compose:
version: '3'
services:
jellyfin:
container_name: jellyfin
network_mode: "dockernetwork"
restart: always
ports:
- 8096:8096
- 8619:8920
- 7359:7359
- 1900:1900
devices:
- /dev/nvidia0
- /dev/nvidiactl
- /dev/nvidia-uvm
volumes:
- /share/DockerVolumesMM2/jellyfin/:/config
- /share/Series:/tv
- /opt/NVIDIA_GPU_DRV/usr:/usr/local/nvidia:ro
environment:
PUID: 1002
PGID: 1000
JELLYFIN_PublishedServerUrl: https://jellyfin.domain.com #optional
NVIDIA_VISIBLE_DEVICES: all
NVIDIA_DRIVER_CAPABILITIES: all
JELLYFIN_FFmpeg__probesize: 50000000
JELLYFIN_FFmpeg__analyzeduration: 50000000
LD_LIBRARY_PATH: /share/CACHEDEV1_DATA/.qpkg/NVIDIA_GPU_DRV/usr:/usr/local/nvidia/lib
image: lscr.io/linuxserver/jellyfin:latest
Check that u have MD0_DATA and i have CACHEDEV1_DATA
@Eniot666 commented on GitHub (Nov 22, 2023):
hi, @deejayexe,
Thanks. The devices were the wrong way
See my final yml compose :
result here :
@Eniot666 commented on GitHub (Nov 22, 2023):
This evening I'm trying to start the transcoding of a film and I get an error:
Do you know if you also need to put this container in place:
https://github.com/NVIDIA/nvidia-container-toolkit
Have you done anything else on QNAP that could explain why it doesn't work...
on my config: I have /dev/nvidia-caps instead of /dev/nvidia-uvm and I don't understand why...
@Eniot666 commented on GitHub (Nov 23, 2023):
Good morning,
I am answering myself, it is also necessary to follow:
https://www.qnap.com/en-us/how-to/tutorial/article/how-to-use-tensorflow-with-container-station
everything works fine now:
my new docker compose :
on the other hand, no use noted here:
tensorflow container once created can be deleted
Edit : you can delete it after but after a reboot you also have to create it again.
@DrakeHamString commented on GitHub (Jun 27, 2024):
Hi, unfortunately I have to open this case again...
My fix I've posted here stopped working at some point. The output of the commands is the same, the container can find the GPU and its addressible.
But at some time, one of the updates might have broken it. Hardware Acceleration is not working anymore, movies which need to be transcoded are not starting and throwing an error.
Any idea how to fix this?
This is the log I get when encountering the error: (trying to play the record of the movie "Archive")
@phifre commented on GitHub (Sep 8, 2024):
With the current Jellyfin version, for harware acceleration with Nvidia GPU you need Nvidia Driver version 545 minimum and current QNAP Nvidia drivers are 515. Following several requests from users, QNAP added a feature request for Nvidia driver App update but I don't know when it will be released.
@gnattu commented on GitHub (Sep 8, 2024):
We can do nothing if your device vendor does not provide software that meets our requirements.
@DrakeHamString commented on GitHub (Nov 14, 2024):
QNAP released an update and now the driver version is 550
With this HWA works again like nothing happened!
@Eniot666 commented on GitHub (Nov 29, 2024):
Hi all,
see here my new docker compose file for jellyfin with tensorflow :
It's work after qnap reboot find
@Eniot666 commented on GitHub (Sep 13, 2025):
Here My new compose after qnap QTS 5.2.6.3195 updated, nvkernelDriver reinstall with :
https://eu1.qnap.com/Storage/DriverQPKG/QTS_5.2.6/3195/NvKernelDriver_5.2.6.3195_TS-X73A_20250715.qpkg
and Nvidia GPU Driver reinstall too...