Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider add ldconfig before starting the jellyfin server #57

Closed
bingzhangdai opened this issue Aug 16, 2020 · 9 comments
Closed

Consider add ldconfig before starting the jellyfin server #57

bingzhangdai opened this issue Aug 16, 2020 · 9 comments

Comments

@bingzhangdai
Copy link

bingzhangdai commented Aug 16, 2020

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.

When using NVENC for hw acceleration, container does not automatically create symlink inside. Users should manually run docker exec -it jellyfin ldconfig. This makes auto updating running container base image somewhat not that elegant.


Expected Behavior

Directly start container and hw acceleration will work normally.

Current Behavior

Manually create symlink inside the container.

Steps to Reproduce

  1. docker run xxx
  2. enable NVENC.
  3. play any vedio that needs transcoding.

Environment

OS: Linux omv 5.6.0-0.bpo.2-amd64 #1 SMP Debian 5.6.14-2~bpo10+1 (2020-06-09) x86_64 GNU/Linux
CPU architecture: arm64
How docker service was installed: docker run

Command used to create docker container (run/create/compose/screenshot)

docker run -d \
  --name=jellyfin \
  -e NVIDIA_VISIBLE_DEVICES=all \
  -e NVIDIA_DRIVER_CAPABILITIES=all \
  --gpus all \
  --restart unless-stopped \
  linuxserver/jellyfin

Docker logs

[00:17:28] [INF] [4] MediaBrowser.Api.Playback.MediaInfoService: User policy for bingzhang. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[00:17:28] [INF] [4] MediaBrowser.Api.Playback.MediaInfoService: Not eligible for DirectPlay due to unsupported subtitles
[00:17:28] [INF] [4] MediaBrowser.Api.Playback.MediaInfoService: Not eligible for DirectStream due to unsupported subtitles
[00:17:28] [INF] [4] MediaBrowser.Api.Playback.MediaInfoService: Profile: Unknown Profile, Path: /data/AnimationMovies/天空之城 (1986)/天空之城 (1986) 1080p AC3.mkv, isEligibleForDirectPlay: False, isEligibleForDirectStream: False
[00:17:28] [INF] [36] MediaBrowser.Api.Playback.Hls.DynamicHlsService: Current HLS implementation doesn't support non-keyframe breaks but one is requested, ignoring that request
[00:17:28] [INF] [36] MediaBrowser.Api.Playback.Hls.DynamicHlsService: /usr/lib/jellyfin-ffmpeg/ffmpeg -c:v hevc_cuvid -resize 1920x1038 -i file:"/data/AnimationMovies/天空之城 (1986)/天空之城 (1986) 1080p AC3.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -codec:v:0 h264_nvenc -pix_fmt yuv420p -preset default -b:v 22238398 -maxrate 22238398 -bufsize 44476796 -profile:v high  -g 72 -keyint_min 72 -sc_threshold 0 -filter_complex "[0:7]scale=1920x1038[sub];[0:0][sub]overlay" -start_at_zero -vsync -1 -codec:a:0 libmp3lame -ac 2 -ab 320000  -copyts -avoid_negative_ts disabled -f hls -max_delay 5000000 -hls_time 3 -individual_header_trailer 0 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/data/transcodes/14ea7f4315c8b96678b86b1d1051a600%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/data/transcodes/14ea7f4315c8b96678b86b1d1051a600.m3u8"
[00:17:28] [ERR] [4] MediaBrowser.Api.Playback.Hls.DynamicHlsService: FFMpeg exited with code 1
[00:17:28] [WRN] [28] MediaBrowser.Api.Playback.Hls.DynamicHlsService: cannot serve /config/data/transcodes/14ea7f4315c8b96678b86b1d1051a6000.ts as transcoding quit before we got there
[00:17:28] [ERR] [28] Emby.Server.Implementations.HttpServer.HttpListenerHost: Error processing request: Could not find file '/config/data/transcodes/14ea7f4315c8b96678b86b1d1051a6000.ts'. URL: http://***.****.com/videos/8ebcb1db-79fc-61e3-e555-df28dd99743a/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzg0LjAuNDE0Ny44OSBTYWZhcmkvNTM3LjM2IEVkZy84NC4wLjUyMi40MHwxNTk1NjcyNTEzODcx&MediaSourceId=8ebcb1db79fc61e3e555df28dd99743a&VideoCodec=h264&AudioCodec=mp3,aac&AudioStreamIndex=1&SubtitleStreamIndex=7&VideoBitrate=139680000&AudioBitrate=320000&PlaySessionId=c3048a7ca5a44c7e9536403532087613&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&Tag=09b7203dd481cc98265a12b6d9606b14&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=51&h264-deinterlace=true&TranscodeReasons=SubtitleCodecNotSupported&allowVideoStreamCopy=false&allowAudioStreamCopy=false,false
[00:17:28] [INF] [4] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app Jellyfin Web 10.6.2 playing 天空之城. Stopped at 0 ms
@github-actions
Copy link

Thanks for opening your first issue here! Be sure to follow the issue template!

@tobbenb
Copy link
Member

tobbenb commented Aug 16, 2020

I'm not sure why you need ldconfig for and which symlinks you are referring to?

You haven't added any volume mounts for /config or movies/series, so not sure how you are able to play anything as you don't have a library.

Are you running arm or x86_64? Your info is conflicting.

@bingzhangdai
Copy link
Author

Oh, sorry that I ignored the volume mounts, because it is too long. Here is the full start.sh command to update the jellyfin docker.

docker pull linuxserver/jellyfin:latest
docker stop jellyfin
docker rm jellyfin
docker run -d \
  --name=jellyfin \
  -e PUID=0 \
  -e PGID=0 \
  -e TZ=Asia/Shanghai \
  -e NVIDIA_VISIBLE_DEVICES=all \
  -e NVIDIA_DRIVER_CAPABILITIES=all \
  --gpus all \
  --network homelabo \
  -v ~/.jellyfin:/config \
  -v /mnt/sata1/Movies:/data/Movies \
  -v /mnt/sata1/TVSeries:/data/TVSeries \
  -v /mnt/sata1/AnimationMovies:/data/AnimationMovies \
  -v /mnt/sata1/Documentary:/data/Documentary \
  -v /mnt/sata1/Animations:/data/Animations \
  -v /mnt/sata1/Music:/data/Music \
  -l traefik.enable=true \
  -l traefik.http.routers.jellyfin.entrypoints=websecure \
  -l traefik.http.routers.jellyfin.tls.certResolver=lets_encrypt \
  -l traefik.http.services.jellyfin.loadbalancer.server.port=8096 \
  --restart unless-stopped \
  linuxserver/jellyfin
docker exec -it jellyfin ldconfig && nvidia-smi

docker exec -it jellyfin ldconfig is needed, otherwise nvidia-smi will fail.

@tobbenb
Copy link
Member

tobbenb commented Aug 24, 2020

Run nvidia-smi on the host

@bingzhangdai
Copy link
Author

bingzhangdai commented Aug 25, 2020

Running nvidia-smi on the host is absolutely no problem.

root@omv:~# nvidia-smi
Tue Aug 25 12:02:59 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100      Driver Version: 440.100      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1650    Off  | 00000000:00:10.0 Off |                  N/A |
| 26%   42C    P0     1W /  75W |      0MiB /  3911MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

However, running in docker fails, if entrypoint does not contain ldconfig.

root@omv:~# docker run --rm -it --entrypoint=/bin/bash --gpus all linuxserver/jellyfin
root@9f1278c05fe3:/# nvidia-smi
NVIDIA-SMI couldn't find libnvidia-ml.so library in your system. Please make sure that the NVIDIA Display Driver is properly installed and present in your system.
Please also try adding directory that contains libnvidia-ml.so to your system PATH.
root@9f1278c05fe3:/# ldconfig
root@9f1278c05fe3:/# nvidia-smi
Tue Aug 25 04:13:15 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.100      Driver Version: 440.100      CUDA Version: 10.2     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 1650    Off  | 00000000:00:10.0 Off |                  N/A |
| 26%   42C    P0     1W /  75W |      0MiB /  3911MiB |      0%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@bingzhangdai
Copy link
Author

please do not close this issue. ldconfig is indeed needed for Nvidia docker 2.

@j0nnymoe
Copy link
Member

I'm not sure it is needed (unless I'm missing something)
No issues using jellyfin and trancoding with a 750ti here.

@bingzhangdai
Copy link
Author

After investigating for a while, I think this is actually nvidia-docker's issue (NVIDIA/nvidia-docker#1163 (comment)). When starting the nvidia-docker, the runtime will call host's ldconfig, however, the ldconfig's path is set not correct on debian. Manually changing the it to /sbin/ldconfig in /etc/nvidia-container-runtime/config.toml fix the problem.

Closing this issue because it is not good to call ldconfig inside container.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants