Running accelerated gstreamer in non-privileged docker container

Hello,

we are trying to use the accelerated gstreamer on a Jetson Xavier from inside a non-privileged docker container. In detail, we are running a plain Ubuntu 18.04 where only they apply_binaries.sh step has been run and nothing else.

We then create a docker image based on Ubuntu:18.04 and install the nvidia-gst librariers and gstreamer. The resulting containers works fine if it is started with root-privileges but fails to run correctly without with the following errors:

Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory
nvbuf_utils: Could not create Default NvBufferSession
Error: Can't initialize nvrm channel
Error: Can't initialize nvrm channel
Couldn't create ddkvic Session: Cannot allocate memory

Is there a way to run avoid these errors when running in unprivileged mode?

Cheers
Arnim

Hi,
We have other user share experiences. Please check
https://devtalk.nvidia.com/default/topic/1062498/jetson-tx2/hw-video-encoding-support-in-a-container-/post/5380840/#5380840
https://devtalk.nvidia.com/default/topic/1063418/jetson-tx2/hw-video-encoder-needs-to-be-initialized-on-the-host-before-it-can-be-used-in-a-container-/post/5384982/#5384982

Thank you, I will give that a go

In the end it is as easy as not using nvidia-docker2 and just exposing these devices to the container:

Ansible:

  • docker_container:
    devices:
    - /dev/nvhost-ctrl
    - /dev/nvhost-ctrl-gpu
    - /dev/nvhost-prof-gpu
    - /dev/nvmap
    - /dev/nvhost-gpu
    - /dev/nvhost-as-gpu
    - /dev/nvhost-vic
    - /dev/tegra_dc_ctrl