Jetson orin nano developr kit with IMX219 camera inside docker container

Hi,

I am following the steps in the Getting Started with AI on Jetson Nano course, i am using jetson orin nano 8GB developer kit with IMX219 camera, outside the docker container it’s working fine.
but inside the docker container when i run this commands :

from jetcam.csi_camera import CSICamera

camera = CSICamera(width=224, height=224, capture_device=0)

It gives me this error :

RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/csi_camera.py in init(self, *args, **kwargs)
23 if not re:
—> 24 raise RuntimeError(‘Could not read image from camera.’)
25 except:

RuntimeError: Could not read image from camera.

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last)
in
1 from jetcam.csi_camera import CSICamera
2
----> 3 camera = CSICamera(width=224, height=224, capture_device=0) # confirm the capture_device number

/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/csi_camera.py in init(self, *args, **kwargs)
25 except:
26 raise RuntimeError(
—> 27 ‘Could not initialize camera. Please see error trace.’)
28
29 atexit.register(self.cap.release)

RuntimeError: Could not initialize camera. Please see error trace.

I used this command to run the docker container :

sudo docker run --runtime nvidia -it --rm --network host \
    --volume ~/nvdli-data:/nvdli-nano/data \
    --volume /tmp/argus_socket:/tmp/argus_socket \
    --device /dev/video0 \
    nvcr.io/nvidia/dli/dli-nano-ai:v2.0.2-r32.7.1


Best Regards,

Hi @musaab_taha, see this post for how to install jetcam:

Hi,

It didin’t work, i tried to run the same commands in python3 inside the container :

  • the jetcam is imported successfully.

  • but when i run this command : camera = CSICamera(width=224, height=224, capture_device=0)

it gives me this error :

[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (711) open OpenCV | GStreamer warning: Error opening bin: no element “nvarguscamerasrc”
[ WARN:0] global /home/nvidia/host/build_opencv/nv_opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Traceback (most recent call last):
File “/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/csi_camera.py”, line 24, in init
RuntimeError: Could not read image from camera.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python3.6/dist-packages/jetcam-0.0.0-py3.6.egg/jetcam/csi_camera.py”, line 27, in init
RuntimeError: Could not initialize camera. Please see error trace.

best regards,

@musaab_taha are you still attempting to run the nvcr.io/nvidia/dli/dli-nano-ai:v2.0.2-r32.7.1 container on JetPack 5? That container is for JetPack 4, and that Nano DLI course is supported on the original Jetson Nano and JetPack 4.

However if you follow the other threads, other uses have informally been able to use the nvcr.io/nvidia/l4t-ml:r35.2.1-py3 container by installing jetcam and mounting in the notebooks. This is not officially supported for the course, but seems to work.

If you encounter much trouble, I would just recommend proceeding with the Hello AI World tutorial, which is fully supported on Orin and JetPack 5:

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