Issue with camera docker

hello guys.

im using jetpack 4.5.1 and cloned the jetbot repo.

when i type the docker run command: ```
sudo docker run -it -d --restart always --runtime nvidia --network host --privileged --device /dev/video* --volume /dev/bus/usb:/dev/bus/usb --volume /tmp/argus_socket:/tmp/argus_socket --privileged --name=jetbot_camera jetbot/jetbot:camera-0.4.3-32.5.0


it creates the container just fine without issue, but the container keeps restarting over and over again

and if just type the command:
docker run -ti jetbot/jetbot:camera-0.4.3-32.5.0 

i have tons of errors:

nvbuf_utils: Could not get EGL display connection0
nvarguscamerasrc sensor-mode=0 ! video/x-raw(memory:NVMM), width=816, height=616, format=(string)NV12, framerate=(fraction)21/1 ! nvvidconv ! video/x-raw, width=(int)224, height=(int)224, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink name=sink
nvbuf_utils: Could not get EGL display connection
starting camera
(Argus) Error FileOperationFailed: Connecting to nvargus-daemon failed: No such file or directory (in src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 201)
(Argus) Error FileOperationFailed: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 102)
Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:639 Failed to create CameraProvider

(python3:6): GStreamer-CRITICAL **: 20:54:34.689: gst_mini_object_set_qdata: assertion 'object != NULL' failed

i´ve tried with jetpack 4.6, 4.5.1, jetbot 4.4, 4.3 and the same result


CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS                        PORTS               NAMES
bd14a3aad52f        jetbot/jetbot:camera-0.4.2-32.4.4    "/bin/sh -c 'cd ${JE…"   14 seconds ago      Restarting (0) 1 second ago                       jetbot_camera
56ab2923e573        jetbot/jetbot:jupyter-0.4.2-32.4.4   "/bin/sh -c 'cd $JUP…"   9 months ago        Up 9 minutes                                      jetbot_jupyter
daae838838e3        jetbot/jetbot:display-0.4.2-32.4.4   "/bin/sh -c 'python3…"   9 months ago        Up 9 minutes                                      jetbot_display

thanks in advance

Could you try this for checking the camera function.

sudo docker run --net=host --runtime nvidia --rm --ipc=host -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /tmp/argus_socket:/tmp/argus_socket --cap-add SYS_PTRACE -e DISPLAY=$DISPLAY -it nvcr.io/nvidia/l4t-base:r32.5.0

with that it works:

jetbot@nano-4gb-jp441:~$ sudo docker run -dti --net=host --runtime nvidia --rm --ipc=host -v /tmp/.X11-unix/:/tmp/.X11-unix/ -v /tmp/argus_socket:/tmp/argus_socket --cap-add SYS_PTRACE -e DISPLAY=$DISPLAY -it nvcr.io/nvidia/l4t-base:r32.5.0
6927a33853271720ab12c13d4356d6d7d3c73716d8bd69cfdaaa3d530a47ce88
jetbot@nano-4gb-jp441:~$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6927a3385327 nvcr.io/nvidia/l4t-base:r32.5.0 “/bin/bash” 4 seconds ago Up 3 seconds sad_swanson

but with the jetbot docker camera not

here is the problem:

im trying to use the Collision Avoidance - Data Collection notebook

but everytime the kernel crashes or no camera detected

i found the issue.

sudo docker ps
CONTAINER ID        IMAGE                                COMMAND                  CREATED             STATUS              PORTS               NAMES
9c2527c4e109        jetbot/jetbot:jupyter-0.4.3-32.5.1

sudo docker exec -ti 9c2527c4e109 bash

vim /usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py

self.cap = cv2.VideoCapture(self._gst_str(), cv2.CAP_GSTREAMER)
self.cap = cv2.VideoCapture(0, cv2.CAP_GSTREAMER)

i´ve changed the:

self._gst_str()  
for the 0

in:

vim /usr/local/lib/python3.6/dist-packages/jetbot-0.4.3-py3.6.egg/jetbot/camera/opencv_gst_camera.py

and now i can access my camera

1 Like