Is there any custom docker image available online that has OpenCV with CUDA support. I am running ros 2 humble and for my camers i definitely need openCV. How do i solve this issue. Or is there any other ways let me know
Hello @madhubmvs97,
We would suggest you use dusty-nv Jetson Containers.
Reading through the README it seems like they should already support opencv:cuda.
Please give them a try and let us know if you run into any issues, we would love to help.
best regards,
Andrew
Embedded Software Engineer at ProventusNova
Hello, I have run this container using sudo docker run --runtime nvidia -it --rm --network=host dustynv/opencv:4.8.1-r36.2.0, but im getting opencv conflicts with ros2 humble no packages are getting installed. Any solutions for this i need ubuntu 22.04, opencv 4.5.4 with cuda enables.
Thanks in advance
/Prudhvi
Hi @madhubmvs97,
Would it be possible for you to provide log messages of the errors you are getting?
best regards,
Andrew
Embedded Software Engineer at ProventusNova
[quote=“madhubmvs97, post:3, topic:337281”]
sudo docker run --runtime nvidia -it --rm --network=host dustynv/opencv:4.8.1-r36.2.0
[/quote]locale # check for UTF-8
apt update && apt install locales
locale-gen en_US en_US.UTF-8
update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export LANG=en_US.UTF-8
locale # verify settings
apt install software-properties-common
add-apt-repository universe
apt update && apt install curl -y
export ROS_APT_SOURCE_VERSION=$(curl -s https://api.github.com/repos/ros-infrastructure/ros-apt-source/releases/latest | grep -F “tag_name” | awk -F" ‘{print $4}’)
curl -L -o /tmp/ros2-apt-source.deb “https://github.com/ros-infrastructure/ros-apt-source/releases/download/${ROS_APT_SOURCE_VERSION}/ros2-apt-source_${ROS_APT_SOURCE_VERSION}.$(. /etc/os-release && echo $VERSION_CODENAME)_all.deb” # If using Ubuntu derivates use $UBUNTU_CODENAME
dpkg -i /tmp/ros2-apt-source.deb
apt update
apt upgrade
apt install ros-humble-desktop
The above were the commands i ran for humble installation , the below is the error i get Unpacking proj-bin (8.2.1-1) …
Selecting previously unselected package usb-modeswitch-data.
Preparing to unpack …/1095-usb-modeswitch-data_20191128-4_all.deb …
Unpacking usb-modeswitch-data (20191128-4) …
Selecting previously unselected package usb-modeswitch.
Preparing to unpack …/1096-usb-modeswitch_2.6.1-3ubuntu2_arm64.deb …
Unpacking usb-modeswitch (2.6.1-3ubuntu2) …
Errors were encountered while processing:
/tmp/apt-dpkg-install-jMETIO/0540-libopencv-core-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0541-libopencv-flann-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0545-libopencv-imgproc-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0546-libopencv-imgcodecs-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0548-libopencv-videoio-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0555-libopencv-highgui-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0557-libopencv-ml-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0558-libopencv-features2d-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0559-libopencv-calib3d-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0565-libopencv-dnn-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0566-libopencv-objdetect-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0568-libopencv-photo-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0570-libopencv-video-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0571-libopencv-shape-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0573-libopencv-stitching-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0575-libopencv-superres-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0577-libopencv-videostab-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0581-libopencv-contrib-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0582-libopencv-dev_4.5.4+dfsg-9ubuntu4_arm64.deb
/tmp/apt-dpkg-install-jMETIO/0725-opencv-data_4.5.4+dfsg-9ubuntu4_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
and stops
Hi @madhubmvs97,
Thanks for sharing the logs.
We would suggest following the instructions from the dusty-nv Jetson Containers to build an image with ROS2 support.
What they recommend is the following:
-
Perform System Setup Configuration on your NVIDIA Jetson.
-
Build the containers directly on your Jetson:
$ jetson-containers build --name=my_container pytorch transformers ros:humble-desktop
If this doesn’t work, then we would need to work on debugging the containers or building a custom setup for you.
Please keep us posted on the progress.
best regards,
Andrew
Embedded Software Engineer at ProventusNova
Step 2/6 : FROM ${BASE_IMAGE}
Get “https://nvcr.io/v2/”: tls: failed to verify certificate: x509: certificate is valid for greerdv.dpip.us-west-2.skybdev.alameda.aws.dev, not nvcr.io
[10:42:28] Failed building: pytorch, transformers, ros:humble-desktop
Traceback (most recent call last):
File “/home/flexa/jetson-containers/jetson_containers/build.py”, line 129, in
build_container(**vars(args))
File “/home/flexa/jetson-containers/jetson_containers/container.py”, line 229, in
build_container
status = subprocess.run(cmd.replace(NEWLINE, ’ ‘), executable=’/bin/bash’, she
ll=True, check=True)
File “/usr/lib/python3.8/subprocess.py”, line 516, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command ‘DOCKER_BUILDKIT=0 docker build --network=hos
t --tag my_container:l4t-r35.6.2-build-essential --file /home/flexa/jetson-conta
iners/packages/build/build-essential/Dockerfile --build-arg BASE_IMAGE=nvcr.io/nvi
dia/l4t-jetpack:r35.4.1 /home/flexa/jetson-containers/packages/build/build-essent
ial 2>&1 | tee /home/flexa/jetson-containers/logs/20250628_104142/build/01o22_my_con
tainer_l4t-r35.6.2-build-essential.txt; exit ${PIPESTATUS[0]}’ returned non-zero exi
t status 1.
i get the following error
Hello @madhubmvs97,
- On which steps the repo instructions did you encounter that error?
- What JP are you using? Is it one of the supported versions?
best regards,
Andrew
Embedded Software Engineer at ProventusNova