Troubleshooting Nvidia Hardware Transcoding for Docker Compose

  channels-dvr:
    image: fancybits/channels-dvr:latest
    container_name: channels-dvr
    network_mode: host
    ports:
      - "8089:8089"
    restart: on-failure:10
    environment:
      - PUID=1000
      - PGID=100
      - TZ=America/Chicago
      - runtime=nvidia
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
    devices:
      - /dev/dri:/dev/dri
    volumes:
      - ./channels-dvr/appdata/config:/config
...

Here's how I have Channels DVR set up in Docker Compose. I already have my Nvidia GPU (GTX 1660) hardware transcoding in another container (Plex).

I can see the card successfully when I nvidia-smi inside the channels-dvr container.

But I can only see Software Transcoding as an option in Channels Settings.

Thoughts?

Thanks!

What does Transcoder > View Debug Info show

amf

fork/exec /channels-dvr/2023.05.19.2045/ffmpeg-dl: no such file or directory

nvenc

fork/exec /channels-dvr/2023.05.19.2045/ffmpeg-dl: no such file or directory

vaapi@/dev/dri/card0

[AVHWDeviceContext @ 0x985c280] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x985c280] libva: driver init failed [AVHWDeviceContext @ 0x985c280] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x985c280] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD128

[AVHWDeviceContext @ 0x85ac280] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x85ac280] libva: driver init failed [AVHWDeviceContext @ 0x85ac280] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x85ac280] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD129

no such file or directory

vaapi@/dev/renderD128

no such file or directory

Can you update to prerelease and try again

amf

fork/exec /channels-dvr/2023.06.05.1524/ffmpeg-dl: no such file or directory

nvenc

fork/exec /channels-dvr/2023.06.05.1524/ffmpeg-dl: no such file or directory

vaapi@/dev/dri/card0

[AVHWDeviceContext @ 0x85ac280] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x85ac280] libva: driver init failed [AVHWDeviceContext @ 0x85ac280] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x85ac280] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD128

[AVHWDeviceContext @ 0x7c6e280] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x7c6e280] libva: driver init failed [AVHWDeviceContext @ 0x7c6e280] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x7c6e280] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD129

no such file or directory

vaapi@/dev/renderD128

no such file or directory

Try the fancybits/channels-dvr:nvidia image

amf

[Parsed_color_0 @ 0x214ad00] size:640x480 rate:25/1 duration:-1.000000 sar:1/1 Input #0, lavfi, from 'color=black:640x480': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_amf)) Press [q] to stop, [?] for help [graph 0 input from stream 0:0 @ 0x21782c0] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 [h264_amf @ 0x2174440] DLL libamfrt64.so.1 failed to open Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed!

exit status 1

nvenc

[Parsed_color_0 @ 0x33eed00] size:640x480 rate:25/1 duration:-1.000000 sar:1/1 Input #0, lavfi, from 'color=black:640x480': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc)) Press [q] to stop, [?] for help [graph 0 input from stream 0:0 @ 0x3436c80] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 [h264_nvenc @ 0x3418000] Cannot load libcuda.so.1 [h264_nvenc @ 0x3418000] Nvenc unloaded Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed!

exit status 1

vaapi@/dev/dri/card0

[AVHWDeviceContext @ 0x8346240] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x8346240] libva: driver init failed [AVHWDeviceContext @ 0x8346240] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x8346240] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD128

[AVHWDeviceContext @ 0x8e45240] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x8e45240] libva: driver init failed [AVHWDeviceContext @ 0x8e45240] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x8e45240] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD129

no such file or directory

vaapi@/dev/renderD128

no such file or directory

Maybe:

sudo apt install nvidia-cuda-toolkit

Actually, let me check the Nvidia install again. It was working a few days ago, but I just tested with Plex and it's not currently showing hardware trascoding in Docker

I think you're right, thanks one sec

image

amf

[Parsed_color_0 @ 0x2685d00] size:640x480 rate:25/1 duration:-1.000000 sar:1/1 Input #0, lavfi, from 'color=black:640x480': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_amf)) Press [q] to stop, [?] for help [graph 0 input from stream 0:0 @ 0x26b32c0] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 [h264_amf @ 0x26af440] DLL libamfrt64.so.1 failed to open Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed!

exit status 1

nvenc

[Parsed_color_0 @ 0x2822d00] size:640x480 rate:25/1 duration:-1.000000 sar:1/1 Input #0, lavfi, from 'color=black:640x480': Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: rawvideo, 1 reference frame (I420 / 0x30323449), yuv420p, 640x480 [SAR 1:1 DAR 4:3], 25 tbr, 25 tbn Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (h264_nvenc)) Press [q] to stop, [?] for help [graph 0 input from stream 0:0 @ 0x286ac80] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 [h264_nvenc @ 0x284c000] Cannot load libcuda.so.1 [h264_nvenc @ 0x284c000] Nvenc unloaded Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed!

exit status 1

vaapi@/dev/dri/card0

[AVHWDeviceContext @ 0x8582240] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x8582240] libva: driver init failed [AVHWDeviceContext @ 0x8582240] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x8582240] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD128

[AVHWDeviceContext @ 0x8c78240] libva: VA-API version 1.16.0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 DRM_IOCTL_I915_GEM_APERTURE failed: Invalid argument Assuming 131072kB available aperture size. May lead to reduced performance or incorrect rendering. get chip id failed: -1 [22] param: 4, val: 0 [AVHWDeviceContext @ 0x8c78240] libva: driver init failed [AVHWDeviceContext @ 0x8c78240] libva: va_openDriver() returns 18 [AVHWDeviceContext @ 0x8c78240] Failed to initialise VAAPI connection: 18 (invalid parameter).

signal: segmentation fault (core dumped)

vaapi@/dev/dri/renderD129

no such file or directory

vaapi@/dev/renderD128

no such file or directory

Working in Plex again now, but still no luck with Channels. I wonder if it's a folder permissions issue. I'm rather new to Docker and OpenMediaVault... I also wonder if there's something else I need to do with regards to GPU being used in 2 different Docker containers. I read this is possible as long as I'm not also using the GPU in a VM. I have no VMs...

@tmm1 Any further thoughts or ideas on what I should try?

What does your Plex docker compose look like?

  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    network_mode: host
    ports:
      - 32400:32400
    deploy:
      resources:
        reservations:
          devices:
            - capabilities: [gpu]
    environment:
      - PUID=1000
      - PGID=100
      - VERSION=docker
#      - PLEX_CLAIM=
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=compute,video,utility
    volumes:
      - ./plex/appdata/config:/config
      - /srv/mergerfs/mediashare/tv:/tv:ro
      - /srv/mergerfs/mediashare/movies:/movies:ro
    restart: unless-stopped

Can you add this part to the channels docker

Interesting, that worked! Cool, thanks!

(I didn't create the Plex container, so frankly I don't know yet what some of these lines of code do...)

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.