Hello AI World: jetson-inference: csi camera fails to load

Hello, I am trying to use 2 IMX 219 cameras to work within the jetson-inference container provided by the docker provided by the jetson-inference github page. Ive tried to rebbot, make sure cameras were properly connected, and checked the cameras work fine outside the container which they do. also, when i purchased the cameras they had me download a new .isp file to correct for reddish color, im not sure if that would have messed with anything

Here are the logs:
first i start the container:

docker/run.sh

ARCH: aarch64
reading L4T version from /etc/nv_tegra_release
L4T BSP Version: L4T R35.3.1
[sudo] password for eppl-sp:
localuser:root being added to access control list
CONTAINER_IMAGE: dustynv/jetson-inference:r35.3.1
DATA_VOLUME: --volume /home/eppl-sp/jetson-inference/data:/jetson-inference/data --volume /home/eppl-sp/jetson-inference/python/training/classification/data:/jetson-inference/python/training/classification/data --volume /home/eppl-sp/jetson-inference/python/training/classification/models:/jetson-inference/python/training/classification/models --volume /home/eppl-sp/jetson-inference/python/training/detection/ssd/data:/jetson-inference/python/training/detection/ssd/data --volume /home/eppl-sp/jetson-inference/python/training/detection/ssd/models:/jetson-inference/python/training/detection/ssd/models --volume /home/eppl-sp/jetson-inference/python/www/recognizer/data:/jetson-inference/python/www/recognizer/data
V4L2_DEVICES: --device /dev/video0 --device /dev/video1
DISPLAY_DEVICE: -e DISPLAY=:1 -v /tmp/.X11-unix/:/tmp/.X11-unix

video-viewer csi://0

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.500: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvegltransform.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.507: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglstreamsrc.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.513: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.520: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvjpeg.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.526: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvidconv.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.530: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosink.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.535: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosinks.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.542: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvivafilter.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.548: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.551: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvv4l2camerasrc.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.555: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglglessink.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block

(gst-plugin-scanner:22): GStreamer-WARNING **: 23:14:06.571: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvarguscamerasrc.so': /lib/aarch64-linux-gnu/libGLdispatch.so.0: cannot allocate memory in static TLS block
[gstreamer] initialized gstreamer, version 1.16.3.0
[gstreamer] gstCamera -- attempting to create device csi://0
[gstreamer] gstCamera pipeline string:
[gstreamer] nvarguscamerasrc sensor-id=0 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw ! appsink name=mysink
[gstreamer] gstCamera failed to create pipeline
[gstreamer]    (no element "nvarguscamerasrc")
[gstreamer] gstCamera -- failed to create device csi://0
video-viewer:  failed to create input stream


video-viewer csi://1

[gstreamer] initialized gstreamer, version 1.16.3.0
[gstreamer] gstCamera -- attempting to create device csi://1
[gstreamer] gstCamera pipeline string:
[gstreamer] nvarguscamerasrc sensor-id=1 ! video/x-raw(memory:NVMM), width=(int)1280, height=(int)720, framerate=30/1, format=(string)NV12 ! nvvidconv flip-method=2 ! video/x-raw ! appsink name=mysink
[gstreamer] gstCamera failed to create pipeline
[gstreamer]    (no element "nvarguscamerasrc")
[gstreamer] gstCamera -- failed to create device csi://1
video-viewer:  failed to create input stream

then, i tried export LD_PRELOAD=/lib/aarch64-linux-gnu/libGLdispatch.so.0 inside the container, and used gst inspect:

gst-inspect-1.0 --version

gst-inspect-1.0 version 1.16.3
GStreamer 1.16.3
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0

gst-inspect-1.0 | grep nv

 root@epplsp-desktop:/jetson-inference# gst-inspect-1.0 | grep nv
nvdrmvideosink:  nvdrmvideosink: Nvidia Drm Video Sink
nvtee:  nvtee: NvTee
audiofx:  audioinvert: Audio inversion
libav:  avdec_twinvq: libav VQF TwinVQ decoder
libav:  avdec_dsicinvideo: libav Delphine Software International CIN video decoder
libav:  avdec_idcinvideo: libav id Quake II CIN video decoder
libav:  avdec_wnv1: libav Winnov WNV1 decoder
rtponvif:  rtponviftimestamp: ONVIF NTP timestamps RTP extension
rtponvif:  rtponvifparse: ONVIF NTP timestamps RTP extension
videoconvert:  videoconvert: Colorspace converter
autoconvert:  autoconvert: Select convertor based on caps
autoconvert:  autovideoconvert: Select color space convertor based on caps
closedcaption:  ccconverter: Closed Caption Converter
debugutilsbad:  errorignore: Convert some GstFlowReturn types into others
ivtc:  ivtc: Inverse Telecine
audioconvert:  audioconvert: Audio converter
bayer:  rgb2bayer: RGB to Bayer converter


ls -ll /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnv*
-rw-r--r-- 1 root root  68544 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvarguscamerasrc.so
-rw-r--r-- 1 root root  35608 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so
-rw-r--r-- 1 root root  39672 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvdrmvideosink.so
-rw-r--r-- 1 root root 742592 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglglessink.so
-rw-r--r-- 1 root root  31320 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglstreamsrc.so
-rw-r--r-- 1 root root  27152 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvegltransform.so
-rw-r--r-- 1 root root  48168 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvivafilter.so
-rw-r--r-- 1 root root  52504 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvjpeg.so
-rw-r--r-- 1 root root  18936 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvtee.so
-rw-r--r-- 1 root root  35416 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvv4l2camerasrc.so
-rw-r--r-- 1 root root 700712 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvidconv.so
-rw-r--r-- 1 root root 275328 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so
-rw-r--r-- 1 root root  35488 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosink.so
-rw-r--r-- 1 root root 721312 Mar 19 15:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosinks.so


this is the same commands but outside the container:

$ gst-inspect-1.0 --version
gst-inspect-1.0 version 1.16.3
GStreamer 1.16.3
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0


$ gst-inspect-1.0 | grep nv
nvarguscamerasrc:  nvarguscamerasrc: NvArgusCameraSrc
nveglglessink:  nveglglessink: EGL/GLES vout Sink
opengl:  glviewconvert: OpenGL Multiview/3D conversion filter
opengl:  gleffects_laplacian: Laplacian Convolution Demo Effect
opengl:  gleffects_blur: Blur with 9x9 separable convolution Effect
opengl:  glcolorconvert: OpenGL color converter
nvv4l2camerasrc:  nvv4l2camerasrc: NvV4l2CameraSrc
audiofx:  audioinvert: Audio inversion
nvvideo4linux2:  nvv4l2av1enc: V4L2 AV1 Encoder
nvvideo4linux2:  nvv4l2vp9enc: V4L2 VP9 Encoder
nvvideo4linux2:  nvv4l2vp8enc: V4L2 VP8 Encoder
nvvideo4linux2:  nvv4l2h265enc: V4L2 H.265 Encoder
nvvideo4linux2:  nvv4l2h264enc: V4L2 H.264 Encoder
nvvideo4linux2:  nvv4l2decoder: NVIDIA v4l2 video decoder
nvivafilter:  nvivafilter: NvIVAFilter Plugin
rtponvif:  rtponvifparse: ONVIF NTP timestamps RTP extension
rtponvif:  rtponviftimestamp: ONVIF NTP timestamps RTP extension
nvvideosinks:  nv3dsink: Nvidia 3D sink
nvdrmvideosink:  nvdrmvideosink: Nvidia Drm Video Sink
nvvideosink:  nvvideosink: nVidia Video Sink
nvvidconv:  nvvidconv: NvVidConv Plugin
nvjpeg:  nvjpegdec: JPEG image decoder
nvjpeg:  nvjpegenc: JPEG image encoder
nvcompositor:  nvcompositor: NvCompositor
videoconvert:  videoconvert: Colorspace converter
autoconvert:  autovideoconvert: Select color space convertor based on caps
autoconvert:  autoconvert: Select convertor based on caps
closedcaption:  ccconverter: Closed Caption Converter
nvtee:  nvtee: NvTee
debugutilsbad:  errorignore: Convert some GstFlowReturn types into others
ivtc:  ivtc: Inverse Telecine
nveglstreamsrc:  nveglstreamsrc: nVidia EGL Stream
nvegltransform:  nvegltransform: NvEGLTransform
audioconvert:  audioconvert: Audio converter
nvdsgst_dewarper:  nvdewarper: nvdewarper
nvdsgst_tracker:  nvtracker: NvTracker plugin
nvdsgst_dsanalytics:  nvdsanalytics: DsAnalytics plugin
nvdsgst_msgbroker:  nvmsgbroker: Message Broker
nvdsgst_postprocess:  nvdspostprocess: NvDsPostProcess plugin for Transform/In-Place use-cases
nvdsgst_osd:  nvdsosd: NvDsOsd plugin
nvdsgst_metamux:  nvdsmetamux: meta muxer
nvdsgst_msgconv:  nvmsgconv: Message Converter
nvdsgst_multistreamtiler:  nvmultistreamtiler: Stream Tiler DS
nvdsgst_ofvisual:  nvofvisual: nvofvisual
nvdsgst_dsexample:  dsexample: DsExample plugin
nvdsgst_audiotemplate:  nvdsaudiotemplate: DS AUDIO template Plugin for Transform IP use-cases
nvdsgst_of:  nvof: nvof
nvdsgst_inferaudio:  nvinferaudio: NvInfer Audio plugin
nvdsgst_logger:  nvdslogger: Nvdslogger
nvdsgst_3dfilter:  nvds3dfilter: DS 3D filter custom plugin
nvdsgst_segvisual:  nvsegvisual: nvsegvisual
nvdsgst_speech:  nvdsasr: DS ASR Plugin for speech use-cases
nvdsgst_preprocess:  nvdspreprocess: gst-nvdspreprocess plugin
nvvideoconvert:  nvvideoconvert: NvVidConv Plugin
nvdsgst_infer:  nvinfer: NvInfer plugin
nvdsgst_multistream:  nvstreamdemux: Stream demultiplexer
nvdsgst_multistream:  nvstreammux: Stream multiplexer
nvdsgst_text_to_speech:  nvds_text_to_speech: DS Text To Speech Plugin for Conversational AI use cases
nvdsgst_videotemplate:  nvdsvideotemplate: NvDsVideoTemplate plugin for Transform/In-Place use-cases
bayer:  rgb2bayer: RGB to Bayer converter


$ ls -ll /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnv*
-rw-r--r-- 1 root root  68544 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvarguscamerasrc.so
-rw-r--r-- 1 root root  35608 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvcompositor.so
-rw-r--r-- 1 root root  39672 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvdrmvideosink.so
-rw-r--r-- 1 root root 742592 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglglessink.so
-rw-r--r-- 1 root root  31320 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnveglstreamsrc.so
-rw-r--r-- 1 root root  27152 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvegltransform.so
-rw-r--r-- 1 root root  48168 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvivafilter.so
-rw-r--r-- 1 root root  52504 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvjpeg.so
-rw-r--r-- 1 root root  18936 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvtee.so
-rw-r--r-- 1 root root  35416 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvv4l2camerasrc.so
-rw-r--r-- 1 root root 700712 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvidconv.so
-rw-r--r-- 1 root root 275328 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideo4linux2.so
-rw-r--r-- 1 root root  35488 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosink.so
-rw-r--r-- 1 root root 721312 Mar 19 11:14 /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstnvvideosinks.so

Hi @castej10, can you try exiting / starting the jetson-inference container again, and running the export LD_PRELOAD=/lib/aarch64-linux-gnu/libGLdispatch.so.0 command first? Otherwise, try running rm -rf /root/.cache/gstreamer-1.0 to clear the plugin cache.

Then try gst-inspect-1.0 | grep nv and see if nvarguscamerasrc can be found.

Dusty, thank you very much sir you are the greatest.

running export LD_PRELOAD=/lib/aarch64-linux-gnu/libGLdispatch.so.0 command first before trying the cameras has fixed the problem. also, if i run try to run the cameras first and then use export LD_PRELOAD=/lib/aarch64-linux-gnu/libGLdispatch.so.0 and thenrm -rf /root/.cache/gstreamer-1.0 also fixes the problem.

could I possibly change the dockerfile so that this process gets done automatically? or what would you recommend?

thanks again for your time

OK great!, glad you got it working @castej10 😊

I’ve added this fix to the Dockerfile in this commit: updated LD_PRELOAD · dusty-nv/jetson-inference@cbd9c06 · GitHub

However it would require rebuilding the container to take effect (which you should be able to do). However, for now it might just be easier for you to add --env LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1:/lib/aarch64-linux-gnu/libGLdispatch.so.0 to the docker run command in the docker/run.sh script here:

Try modifying it to be like this:

	sudo docker run --runtime nvidia -it --rm \
		--network host \
		-v /tmp/argus_socket:/tmp/argus_socket \
		-v /etc/enctune.conf:/etc/enctune.conf \
		-v /etc/nv_tegra_release:/etc/nv_tegra_release \
		-v /tmp/nv_jetson_model:/tmp/nv_jetson_model \
                --env LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1:/lib/aarch64-linux-gnu/libGLdispatch.so.0 \
		$DISPLAY_DEVICE $V4L2_DEVICES \
		$DATA_VOLUME $USER_VOLUME $DEV_VOLUME \
		$CONTAINER_IMAGE $USER_COMMAND
1 Like

Perfect. works like a charm!
thank you very much

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