2025-02-18, 06:11 PM
I've been trying to set up hardware acceleration for my jellyfin, with no luck. Below there are specs of the current system that appears to be working the most.
I'm not pasting the jellyfin codecs because I tried disabling all except supported ones, all except h264, enabling all, etc etc...
I've been following these 2 tutorials with their images:
https://jellyfin.org/docs/general/admini...ion/nvidia
https://github.com/linuxserver/docker-jellyfin
Here's my compose file (.env just sets puid and pgid to 1000 and some paths)
Here I verified that GPU is passed as ffmpeg parameter:
Here are some screenshots of the system. Surprisingly, ffmpeg is visible in nvidia-smi only on host, not in docker. GPU will draw around 30W once video is loaded, but it shows 0% usage, and cpu is almost 100% all the time
![[Image: JI2UbBq8HeTS.png]](https://pasteboard.co/JI2UbBq8HeTS.png)
![[Image: owho9YRE2s4J.png]](https://pasteboard.co/owho9YRE2s4J.png)
I'm not pasting the jellyfin codecs because I tried disabling all except supported ones, all except h264, enabling all, etc etc...
I've been following these 2 tutorials with their images:
https://jellyfin.org/docs/general/admini...ion/nvidia
https://github.com/linuxserver/docker-jellyfin
Here's my compose file (.env just sets puid and pgid to 1000 and some paths)
yml
jellyfin:
image: jellyfin/jellyfin:latest
container_name: jellyfin
restart: unless-stopped
env_file:
- .env
runtime: nvidia
environment:
- DOCKER_MODS=ghcr.io/themepark-dev/theme.park:jellyfin
- TP_THEME=${TP_THEME}
- NVIDIA_VISIBLE_DEVICES=all
volumes:
- ${CONFIG_DIR}/jellyfin
config
- ${MEDIA_DIR}/mediastack
data/media
devices:
- /dev/dri
dev/dri
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
Here I verified that GPU is passed as ffmpeg parameter:
sh
$ ps -Flww -p 340907
F S UID PID PPID C PRI NI ADDR SZ WCHAN RSS PSR STIME TTY TIME CMD
0 S root 340907 332122 98 80 0 - 2553902 - 204516 0 18:54 ? 00:05:07 /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -probesize 1G -ss 00:07:03.000 -f matroska -init_hw_device cuda=cu:0 -filter_hw_device cu -hwaccel cuda -hwaccel_output_format cuda -noautorotate -hwaccel_flags +unsafe_output -threads 1 -i file
data/media/movies/Despicable Me 3 (2017)/Despicable Me 3 (2017) 1080p BrRip x264 -VPPV.mkv -noautoscale -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_nvenc -preset p1 -b:v 336000 -maxrate 336000 -bufsize 672000 -profile:v:0 high -g:v:0 72 -keyint_min:v:0 72 -vf setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_cuda=w=960:h=402:format=yuv420p -codec:a:0 libfdk_aac -ac 2 -ab 256000 -af volume=2 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 141 -hls_segment_filename /cache/transcodes/ee1aad0dcfad553c0820bfe18ecac5ac%d.ts -hls_playlist_type vod -hls_list_size 0 -y /cache/transcodes/ee1aad0dcfad553c0820bfe18ecac5ac.m3u8
Here are some screenshots of the system. Surprisingly, ffmpeg is visible in nvidia-smi only on host, not in docker. GPU will draw around 30W once video is loaded, but it shows 0% usage, and cpu is almost 100% all the time
![[Image: JI2UbBq8HeTS.png]](https://pasteboard.co/JI2UbBq8HeTS.png)
![[Image: owho9YRE2s4J.png]](https://pasteboard.co/owho9YRE2s4J.png)
![[Image: li8JYaIPebmq.png]](https://pasteboard.co/li8JYaIPebmq.png)