Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build OpenCV with CUDA on Jetson AGX Xavier #65

Open
habjoel opened this issue May 18, 2022 · 4 comments
Open

Build OpenCV with CUDA on Jetson AGX Xavier #65

habjoel opened this issue May 18, 2022 · 4 comments
Labels
faq a common question about the script

Comments

@habjoel
Copy link

habjoel commented May 18, 2022

Hi @mdegans

I would like to use your script to build OpenCV with CUDA support on the Jetson AGX Xavier.
There is already a OpenCV installed on the device through Jetpack (but without cuda). Do I need uninstall it before running the script (sudo apt-get purge -y '*opencv*') or does it work without that?

Furthermore, is there any reason why this script should not work for OpenCV version > 4.4.0?

@habjoel
Copy link
Author

habjoel commented May 18, 2022

@mdegans The script worked flawlessly for OpenCV 4.5.0. :) The only thing I am confused about is that there is no /usr/include/opencv4 or /usr/lib/python3.6/dist-packages/cv2 directory, which exist for the native OpenCV installation. Why is that and should I be worried about it?

Furthermore, I am planning to use OpenCV together with ROS Melodic and I am hoping that ROS will use my newly installed OpenCV with CUDA... do you have any experience with that?

@mdegans mdegans added the faq a common question about the script label Aug 3, 2022
@mdegans
Copy link
Owner

mdegans commented Aug 3, 2022

Hi @mdegans

I would like to use your script to build OpenCV with CUDA support on the Jetson AGX Xavier. There is already a OpenCV installed on the device through Jetpack (but without cuda). Do I need uninstall it before running the script (sudo apt-get purge -y 'opencv') or does it work without that?

Furthermore, is there any reason why this script should not work for OpenCV version > 4.4.0?

It's not mandatory to remove a preexisting version of OpenCV so long as you know your build system and/or python paths. Some Nvidia software requires 4.1.1 anyway, I think, and as such apt might remove more than you'd expect (because it would break that software anyway).

@mdegans
Copy link
Owner

mdegans commented Aug 3, 2022

@mdegans The script worked flawlessly for OpenCV 4.5.0. :) The only thing I am confused about is that there is no /usr/include/opencv4 or /usr/lib/python3.6/dist-packages/cv2 directory, which exist for the native OpenCV installation. Why is that and should I be worried about it?

Furthermore, I am planning to use OpenCV together with ROS Melodic and I am hoping that ROS will use my newly installed OpenCV with CUDA... do you have any experience with that?

You'll have to look into OpenCV's cmake to see how it figures out the python path (and the way that worked it changed recently). If you run the script from within a venv, it'll probably pick the venv's location to install the python module. In any case you should be able to copy and paste the cv2 directory wherever you want it without breaking anything.

@HXB-1997
Copy link

HXB-1997 commented Nov 8, 2023

what's your jetpack version? @habjoel my jetpack is 5.1.2,and I specified OpenCV version 4.5.0. when I run the bash, terminal says multipul dependency unmet,and the dependency is not to be installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
faq a common question about the script
Projects
None yet
Development

No branches or pull requests

3 participants