how to configure DecoderHWAccelName & Device?

Support for the docker image maintained by dlandon
Post Reply
veehexx
Posts: 7
Joined: Mon Jan 04, 2016 12:16 pm

how to configure DecoderHWAccelName & Device?

Post by veehexx »

i've been attempting to get HWAcceleration working in ZM via the docker image (actually podman since i'm Fedora/RH distro).
i've added the following lines to my create container:
--device /dev/dri/renderD128 \
--device /dev/dri/card0 \

which i beleive are the required devices based on those devices existing on the host and from one of the media app docker container howto on hw acceleration - plex/jellyfin/emby. CPU is an AMD Althon3000G with vega3 graphics (2019 cpu - https://www.amd.com/en/products/apu/amd-athlon-3000g).

both devices appear present from within the ZM container:

Code: Select all

[root@a0c91a9a6722 /]# ll /dev/dri/renderD128 
crw-rw-rw- 1 root printadmin 226, 128 Sep 18 08:48 /dev/dri/renderD128
[root@a0c91a9a6722 /]# ll /dev/dri/card0      
crw-rw---- 1 root video 226, 0 Sep 18 08:48 /dev/dri/card0
host side shows:

Code: Select all

# ll /dev/dri/
...
crw-rw---- 1 root video  226,   0 Sep 11 13:36 card0
crw-rw-rw- 1 root render 226, 128 Sep 11 13:36 renderD128
ZM has 'DecoderHWAccelName=vaapi', and 'DecoderHWAccelDevice=/dev/dri/renderD128' set on the monitor source tab.
ZM logs report 'ERR - Failed to create hwaccel device. Input/output error'. so something is wrong. not sure if it's permissions as card0 is undefined, renderD128 has global RW despite the group mismatch between container & host.

the manual at readthedocs.io doesnt have much info on this. I'm also not going to spend vast amounts of time on this; i've CPU down <10% for ZM usage so i probably wont see any benefit with getting this implemented and it's more out of curiosity with it. maybe if i add more cameras and/or increase FPS in the future then GPU offloading would be more noticeable.
User avatar
burger
Posts: 390
Joined: Mon May 11, 2020 4:32 pm

Re: how to configure DecoderHWAccelName & Device?

Post by burger »

Can you test the GPU in a normal ZM install first to make sure it works? Docker can make configuration more difficult than normal, and you don't know the compatibility with the GPU yet. You might want to rule out whether its a GPU issue or a Docker issue. So try in normal ZM w/out docker, see if it works, then mirror that in Docker. With docker & GPUs I would not be surprised if it requires some config.

There is a writeup on GPUs here: https://wiki.zoneminder.com/GPU_passthrough_in_VMWare
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
Post Reply