linuxserver / docker-jellyfin

GNU General Public License v3.0
607 stars 91 forks source link

[BUG] issues using podman rootless with amd dockermod #184

Closed jmaris closed 1 year ago

jmaris commented 1 year ago

Is there an existing issue for this?

Current Behavior

I know this is likely an unsupported configuration, so feel free to ignore this post.

As it stands, I'm running jellyfin through rootless podman. This works flawlessly without hardware acceleration, but I wanted to make them most of my AMD APU, so I added the amd dockermod environment vars and started it up.

At first I had to fix permissions, but by tweaking the selinux settings, adding /dev/dri as a device as per instructions, and adding a special podman argument (keep-groups) which automatically passes device groups into the container, I managed to fix device permissions within the container.

However now I'm running into a new problem: transcoding fails with a strange error:

amdgpu: amdgpu_bo_cpu_map failed. (-13)
radeonsi: can't create radeon_winsys_ctx
radeonsi: Failed to create a context.
amdgpu: amdgpu_bo_cpu_map failed. (-13)
radeonsi: can't create radeon_winsys_ctx
radeonsi: Failed to create a context.
[AVHWDeviceContext @ 0x557cb9ee7dc0] libva: /usr/lib/jellyfin-ffmpeg/lib/dri/radeonsi_drv_video.so init failed
[AVHWDeviceContext @ 0x557cb9ee7dc0] Failed to initialise VAAPI connection: 2 (resource allocation failed).
Device creation failed: -5.
Failed to set value 'vaapi=va:/dev/dri/renderD128' for option 'init_hw_device': Input/output error
Error parsing global options: Input/output error

Expected Behavior

Video playback should continue

Steps To Reproduce

see docker compose below

Environment

- OS:
Fedora Silverblue 37
- How docker service was installed:
Using Podman, which comes installed by default, rootless

CPU architecture

x86-64

Docker creation

compose file extract:

services:
    jellyfin:
        image: lscr.io/linuxserver/jellyfin:latest
        container_name: jellyfin
        ports:
          - "10.0.0.3:9000:8096"
        environment:
            - TZ=Europe/Paris
            - PUID=1002
            - PGID=1002
            - DOCKER_MODS=linuxserver/mods:jellyfin-amd
        volumes:
            - /home/services/jellyfin:/config:Z
            - /mnt/downloads:/downloads:z
        devices:
            # GPU Passthrough
            - '/dev/dri:/dev/dri'

run command: podman-compose --pod-args='--infra=true --share=""' --podman-run-args='--group-add keep-groups' up -d


### Container logs

```bash
full log withheld for privacy.

STARTUP:
[custom-init] No custom services found, skipping...

[mod-init] Attempting to run Docker Modification Logic

[mod-init] Applying linuxserver/mods:jellyfin-amd files to container

[custom-init] No custom services found, skipping...

[mod-init] Attempting to run Docker Modification Logic

[mod-init] Applying linuxserver/mods:jellyfin-amd files to container

[mod-init] linuxserver/mods:jellyfin-amd at sha256:5aea5d284b7a39d01c3dc5e544258ae18d5ac4a2fcfc5152705c0b100c69e8a8 has been previously applied skipping

[migrations] started

[migrations] no migrations found

usermod: no changes

-------------------------------------

          _         ()

         | |  ___   _    __

         | | / __| | |  /  \

         | | \__ \ | | | () |

         |_| |___/ |_|  \__/

Brought to you by linuxserver.io

-------------------------------------

To support the app dev(s) visit:

Jellyfin: https://opencollective.com/jellyfin

To support LSIO projects visit:

https://www.linuxserver.io/donate/

-------------------------------------

GID/UID

-------------------------------------

User uid:    1002

User gid:    1002

-------------------------------------

[custom-init] No custom files found, skipping...

[22:11:57] [INF] [1] Main: Jellyfin version: 10.8.8

[22:11:57] [INF] [1] Main: Environment Variables: ["[JELLYFIN_DATA_DIR, /config/data]", "[JELLYFIN_CACHE_DIR, /config/cache]", "[JELLYFIN_CONFIG_DIR, /config]", "[JELLYFIN_LOG_DIR, /config/log]", "[JELLYFIN_WEB_DIR, /usr/share/jellyfin/web]"]

[22:11:57] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/bin/jellyfin.dll", "--ffmpeg=/usr/lib/jellyfin-ffmpeg/ffmpeg"]

[22:11:57] [INF] [1] Main: Operating system: Linux

[22:11:57] [INF] [1] Main: Architecture: X64

[22:11:57] [INF] [1] Main: 64-Bit Process: True

[22:11:57] [INF] [1] Main: User Interactive: True

[22:11:57] [INF] [1] Main: Processor count: 16

[22:11:57] [INF] [1] Main: Program data path: /config/data

[22:11:57] [INF] [1] Main: Web resources path: /usr/share/jellyfin/web

[22:11:57] [INF] [1] Main: Application directory: /usr/lib/jellyfin/bin/

[22:11:57] [INF] [1] Emby.Server.Implementations.AppBase.BaseConfigurationManager: Setting cache path: /config/cache

[22:11:57] [INF] [1] Emby.Server.Implementations.ApplicationHost: Loading assemblies

[22:11:57] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN addresses : [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]

[22:11:57] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Defined LAN exclusions : []

[22:11:57] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using LAN addresses: [10.0.0.0/8,172.16.0.0/12,192.168.0.0/16]

[22:11:57] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind addresses: []

[22:11:57] [INF] [1] Jellyfin.Networking.Manager.NetworkManager: Using bind exclusions: []

[22:11:58] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: TMDb 10.8.8.0

[22:11:58] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: Studio Images 10.8.8.0

[22:11:58] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: OMDb 10.8.8.0

[22:11:58] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: MusicBrainz 10.8.8.0

[22:11:58] [INF] [1] Emby.Server.Implementations.Plugins.PluginManager: Loaded plugin: AudioDB 10.8.8.0

[22:11:58] [INF] [1] Main: Kestrel listening on Any IP4 Address

[22:11:58] [WRN] [1] Microsoft.AspNetCore.DataProtection.Repositories.EphemeralXmlRepository: Using an in-memory repository. Keys will not be persisted to storage.

[22:11:58] [WRN] [1] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager: Neither user profile nor HKLM registry available. Using an ephemeral key repository. Protected data will be unavailable when application exits.

[22:11:59] [WRN] [1] Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager: No XML encryptor configured. Key {d4bce2fc-4c1b-4b58-b20c-fab375548319} may be persisted to storage in unencrypted form.

[22:11:59] [INF] [1] Emby.Server.Implementations.ApplicationHost: Running startup tasks

[22:11:59] [INF] [1] Emby.Server.Implementations.ScheduledTasks.TaskManager: Daily trigger for Extract Chapter Images set to fire at 2023-01-14 02:00:00.000 +01:00, which is 03:48:00.8439811 from now.

[22:11:59] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Found ffmpeg version 5.1.2

[22:11:59] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available decoders: ["libdav1d", "av1", "av1_cuvid", "av1_qsv", "h264", "h264_qsv", "h264_cuvid", "hevc", "hevc_qsv", "hevc_cuvid", "mpeg2video", "mpeg2_qsv", "mpeg2_cuvid", "mpeg4", "mpeg4_cuvid", "msmpeg4", "vc1_qsv", "vc1_cuvid", "vp8", "libvpx", "vp8_cuvid", "vp8_qsv", "vp9", "libvpx-vp9", "vp9_cuvid", "vp9_qsv", "aac", "ac3", "flac", "mp3"]

[22:11:59] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available encoders: ["libx264", "h264_amf", "h264_nvenc", "h264_qsv", "h264_v4l2m2m", "h264_vaapi", "libx265", "hevc_amf", "hevc_nvenc", "hevc_qsv", "hevc_vaapi", "mpeg4", "msmpeg4", "libvpx", "libvpx-vp9", "aac", "libfdk_aac", "ac3", "flac", "libmp3lame", "libopus", "libvorbis", "srt"]

[22:11:59] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: ["deinterlace_qsv", "deinterlace_vaapi", "hwupload_cuda", "hwupload_vaapi", "overlay_opencl", "overlay_qsv", "overlay_vaapi", "overlay_cuda", "procamp_vaapi", "scale_cuda", "scale_opencl", "scale_qsv", "scale_vaapi", "tonemap_cuda", "tonemap_opencl", "tonemap_vaapi", "vpp_qsv", "yadif_cuda", "zscale", "alphasrc"]

[22:11:59] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["cuda", "vaapi", "qsv", "drm", "opencl", "vulkan"]

[22:11:59] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: /usr/lib/jellyfin-ffmpeg/ffmpeg

[22:11:59] [INF] [1] Emby.Server.Implementations.ApplicationHost: ServerId: 32cb2fcdfbd94af6a224610319300ca3

[22:11:59] [INF] [1] Emby.Dlna.Main.DlnaEntryPoint: Registering publisher for urn:schemas-upnp-org:device:MediaServer:1 on 10.89.1.108/24

[22:11:59] [INF] [1] Emby.Dlna.Main.DlnaEntryPoint: Registering publisher for urn:schemas-upnp-org:device:MediaServer:1 on 127.0.0.1/8

[22:11:59] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all pre-startup entry points in 0:00:00.1231354

[22:11:59] [INF] [1] Emby.Server.Implementations.ApplicationHost: Core startup complete

[22:12:00] [INF] [14] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /downloads/library

[22:12:00] [INF] [19] Emby.Server.Implementations.IO.LibraryMonitor: Watching directory /downloads/library_tv

[22:12:00] [INF] [1] Emby.Server.Implementations.ApplicationHost: Executed all post-startup entry points in 0:00:00.1372043

[22:12:00] [INF] [1] Main: Startup complete 0:00:02.8001305

[ls.io-init] done.

[22:12:02] [INF] [15] Emby.Server.Implementations.ScheduledTasks.TaskManager: StartupTrigger fired for task: Update Plugins

[22:12:02] [INF] [15] Emby.Server.Implementations.ScheduledTasks.TaskManager: Queuing task PluginUpdateTask

[22:12:02] [INF] [26] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing Update Plugins

[22:12:16] [INF] [22] Emby.Server.Implementations.ScheduledTasks.TaskManager: Update Plugins Completed after 0 minute(s) and 13 seconds

[22:12:16] [INF] [22] Emby.Server.Implementations.ScheduledTasks.TaskManager: ExecuteQueuedTasks

Error during playback:

[21:39:09] [ERR] [89] Jellyfin.Api.Helpers.TranscodingJobHelper: FFmpeg exited with code 1
github-actions[bot] commented 1 year ago

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

Roxedus commented 1 year ago

We don't test, support or go out of our way to ensure our images (and mods) works in a rootless environment.