Nvidia transcoding on Unraid Docker

Group,

I've been trying to get Channels to do hardware transcoding, but I can't seem to get it to change from software to hardware. I do have Plex also installed in Unraid Docker and it using Nvidia Hardware transcoding correctly.

I've done the following:

On my Unraid Server:

cat /boot/config/go

#!/bin/bash

Start the Management Utility

/usr/local/sbin/emhttp &
modprobe i915

root@UNRAID-1:~# lsmod | grep i915
root@UNRAID-1:~# modprobe i915
root@UNRAID-1:~# lsmod | grep i915
i915 1351680 0
video 40960 1 i915
backlight 16384 2 video,i915
iosf_mbi 16384 1 i915
intel_gtt 20480 1 i915
i2c_algo_bit 16384 1 i915
drm_kms_helper 135168 2 nvidia_drm,i915
drm 348160 4 drm_kms_helper,nvidia_drm,i915
i2c_core 40960 6 drm_kms_helper,i2c_algo_bit,nvidia,i915,ipmi_ssif,drm
root@UNRAID-1:~# ls -alh /dev/dri
total 0
drwxrwxrwx 3 nobody users 100 Oct 22 22:46 ./
drwxr-xr-x 15 root root 4.2K Dec 12 11:23 ../
drwxrwxrwx 2 nobody users 80 Oct 22 22:46 by-path/
crwxrwxrwx 1 nobody users 226, 0 Oct 22 22:46 card0
crwxrwxrwx 1 nobody users 226, 128 Oct 22 22:46 renderD128

Within Channels Docker
add Variable:
Name: Host Key 1
Key: NVIDIA_DRIVER_CAPABILITIES
Value: compute,video,utility

add Variable:
Name: Host Key 2
Key: NVIDIA_VISIBLE_DEVICES
Value: all

add device:
Name: Video
value: /dev/dri

IP:8089/system/misc
showing:
{"distro":false,"home":"/root","hwdeint":false,"model":"PowerEdge R720","pwd":"/channels-dvr/data","root":"","timezone":"PST","transcoder":"libx264","vendor":"Dell Inc."}

I'm still seeing transcoding as software still.

Please help

Are you using the ChannelsDVR-NVidia template?

Yes I am

Can you run a hwe test and collect all the results from the log?

https://getchannels.com/docs/getting-started/faqs/channels-plus/#why-is-my-dvr-not-showing-a-hardware-transcoding-option

ran the curl command from a remote computer (Mac). Here is the output from the channels log.

2020/12/12 21:01:16.780398 [HWE] Trying nvenc: /channels-dvr/2020.12.10.1836/ffmpeg-dl /channels-dvr/2020.12.10.1836/ffmpeg-dl -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -f null -c:v h264_nvenc -profile:v high -level 42 -b:v 400k -maxrate:v 600k -y /dev/null
[Parsed_color_0 @ 0x2093ec0] 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, 25 tbc
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 @ 0x20dd440] w:640 h:480 pixfmt:yuv420p tb:1/25 fr:25/1 sar:1/1 sws_param:flags=2
[h264_nvenc @ 0x20bdb00] Cannot load libcuda.so.1
[h264_nvenc @ 0x20bdb00] 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!
2020/12/12 21:01:16.808714 [HWE] Failure: exit status 1
2020/12/12 21:01:16.808848 [HWE] Trying amf: /channels-dvr/2020.12.10.1836/ffmpeg-dl /channels-dvr/2020.12.10.1836/ffmpeg-dl -hide_banner -nostats -loglevel warning -loglevel verbose -f lavfi -t 0.1 -i color=black:640x480 -f null -c:v h264_amf -profile:v high -level 42 -b:v 400k -maxrate:v 600k -y /dev/null
[Parsed_color_0 @ 0x2093ec0] 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, 25 tbc
Unknown encoder 'h264_amf'
2020/12/12 21:01:16.826617 [HWE] Failure: exit status 1
2020/12/12 21:01:16.826863 [HWE] Cannot access /dev/dri/renderD129: no such file or directory
2020/12/12 21:01:16.827048 [HWE] Trying vaapi@/dev/dri/renderD128: /channels-dvr/2020.12.10.1836/ffmpeg /channels-dvr/2020.12.10.1836/ffmpeg -hide_banner -nostats -loglevel warning -loglevel verbose -init_hw_device vaapi=intel:/dev/dri/renderD128 -f lavfi -t 0.1 -i color=black:640x480 -f null -y /dev/null
[AVHWDeviceContext @ 0x2249f00] libva: VA-API version 1.10.0
[AVHWDeviceContext @ 0x2249f00] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[AVHWDeviceContext @ 0x2249f00] Failed to initialise VAAPI connection: -1 (unknown libva error).
2020/12/12 21:01:16.839997 [HWE] Failure: signal: segmentation fault
2020/12/12 21:01:16.840113 [HWE] Cannot access /dev/renderD128: no such file or directory
2020/12/12 21:01:16.840219 [HWE] Trying vaapi@/dev/dri/card0: /channels-dvr/2020.12.10.1836/ffmpeg /channels-dvr/2020.12.10.1836/ffmpeg -hide_banner -nostats -loglevel warning -loglevel verbose -init_hw_device vaapi=intel:/dev/dri/card0 -f lavfi -t 0.1 -i color=black:640x480 -f null -y /dev/null
[AVHWDeviceContext @ 0x2249f00] libva: VA-API version 1.10.0
[AVHWDeviceContext @ 0x2249f00] libva: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null)
[AVHWDeviceContext @ 0x2249f00] Failed to initialise VAAPI connection: -1 (unknown libva error).
2020/12/12 21:01:16.853653 [HWE] Failure: signal: segmentation fault

This seems to be the issue, I guess a missing driver somewhere.

I know it works on Linux but not sure if anyone has tried on unraid before.

My Unraid build words with NVIDIA cards, https://github.com/timstephens24/docker-templates (https://github.com/timstephens24/channelsdvr-docker)

Looking at your output it doesn't look like you have either the Unraid Nvidia Plugin or the NVIDIA-Driver plugin (anything after 6.9.0-beta35) installed. Can you verify those are there and working with a valid UUID for your graphics card? It should look something like "GPU-9cfdd18c-2b41-b158-f67b-720279bc77fd" and you can pull that from their of those plugins.

Hi @timstephens24...yes I do have the Unraid Nvidia Plugin installed and I'm on 440.59 driver version. It is working correctly with Plex.

@tmm1, I was able to fix the issue. It looks like you are missing "--runtime=nvidia" in the extra parameters section of your docker build.

@timstephens24 thanks fo the info. I was able to find the issue with the docker build I was using and looks like I was able to fix it.

1 Like

No problem, that was going to be my next suggestion after seeing your reply. Enjoy!

Is this something that I can add to ChannelsDVR-NVidia.xml?

I think you should be able to. I've see other Docker apps that have it part of the the extra parameters...maybe @timstephens24 can answer that.

From what I know it should be on there (https://developer.nvidia.com/nvidia-container-runtime). It's default on my template and other's that I've seen.

1 Like
1 Like