Running accelerated gstreamer in docker contianer?

I am trying to get the ROS camera driver based on GStreamer with Nvidia-accelerated elements to work inside the Docker container.

I am getting this error:

[  500.372280] nvmap_alloc_handle: PID 4431: camera_driver: WARNING: All NvMap Allocations must have a tag to identify the subsystem allocating memory.Please pass the tag to the API call NvRmMemHanldeAllocAttr() or relevant. 
my_ros_container  | [camera_driver-1] Couldn't create nvvic Session: Cannot allocate memory
my_ros_container  | [camera_driver-1] nvbufsurftransform: Could not get EGL display connection
my_ros_container  | [camera_driver-1] nvbufsurftransform: Could not create Default NvBufferSession
my_ros_container  | [ERROR] [camera_driver-1]: process has died 

docker-compose.yaml

ersion: '3.8'

services:
  my_ros_container:
    image: my_ros_container:latest
    container_name: my_ros_container
    network_mode: "host"
    runtime: nvidia
    pid: "host"
    ipc: "host"
    environment:
      - ENABLE_GNSS=false
      - ENABLE_NTRIP_CLIENT=false
      - ENABLE_IMU=false
      - ENABLE_CAM1=true
      - ENABLE_CAM2=false
      - NVIDIA_DRIVER_CAPABILITIES=all
      - ROS_DOMAIN_ID=2
    volumes:
      - /dev/shm:/dev/shm
      - /tmp/argus_socket:/tmp/argus_socket
    devices:
      - /dev/video0
      - /dev/video1
      - /dev/nvsciipc:/dev/nvsciipc
      - /dev/nvmap:/dev/nvmap
      - /dev/capture-vi-channel0:/dev/capture-vi-channel0
      - /dev/capture-isp-channel0:/dev/capture-isp-channel0
      - /dev/nvgpu:/dev/nvgpu
      - /dev/nvhost-as-gpu:/dev/nvhost-as-gpu
      - /dev/nvhost-ctrl-gpu:/dev/nvhost-ctrl-gpu
      - /dev/nvhost-ctrl-isp:/dev/nvhost-ctrl-isp
      - /dev/nvhost-ctrl-isp-thi:/dev/nvhost-ctrl-isp-thi
      - /dev/nvhost-ctrl-nvcsi:/dev/nvhost-ctrl-nvcsi
      - /dev/nvhost-ctrl-vi0:/dev/nvhost-ctrl-vi0
      - /dev/nvhost-ctrl-vi0-thi:/dev/nvhost-ctrl-vi0-thi
      - /dev/nvhost-ctrl-vi1:/dev/nvhost-ctrl-vi1
      - /dev/nvhost-ctrl-vi1-thi:/dev/nvhost-ctrl-vi1-thi
      - /dev/nvhost-ctxsw-gpu:/dev/nvhost-ctxsw-gpu
      - /dev/nvhost-dbg-gpu:/dev/nvhost-dbg-gpu
      - /dev/nvhost-gpu:/dev/nvhost-gpu
      - /dev/nvhost-nvsched_ctrl_fifo-gpu:/dev/nvhost-nvsched_ctrl_fifo-gpu
      - /dev/nvhost-nvsched-gpu:/dev/nvhost-nvsched-gpu
      - /dev/nvhost-power-gpu:/dev/nvhost-power-gpu
      - /dev/nvhost-prof-ctx-gpu:/dev/nvhost-prof-ctx-gpu
      - /dev/nvhost-prof-dev-gpu:/dev/nvhost-prof-dev-gpu
      - /dev/nvhost-prof-gpu:/dev/nvhost-prof-gpu
      - /dev/nvhost-sched-gpu:/dev/nvhost-sched-gpu
      - /dev/nvhost-tsg-gpu:/dev/nvhost-tsg-gpu
      - /dev/nvidia0:/dev/nvidia0
      - /dev/nvidiactl:/dev/nvidiactl
      - /dev/nvidia-modeset:/dev/nvidia-modeset
      - /dev/nvsciipc:/dev/nvsciipc
      - /dev/v4l2-nvdec:/dev/v4l2-nvdec


Any help will be highly appreciated.

Thank you!

Hi,
Please try the docker image:
NVIDIA L4T JetPack | NVIDIA NGC

It is supposed to work in this docker. And latest release is Jetpack 6.2. If you are using previous version, would suggest upgrade to latest version and try.