OpenCV with CUDA in Python on Jetson

JetsonHacks
JetsonHacks
13.5 هزار بار بازدید - 9 ماه پیش - Building OpenCV with CUDA support
Building OpenCV with CUDA support is a task. Many folks get a surprise after the build when they try to run it in Python. The old version is there instead of the new! Here's how to fix it and take advantage of that GPU goodness. We run a face detection demo to make sure it works. Full article on JetsonHacks: https://wp.me/p7ZgI9-3Ne

NOTE: If you use the cp command to save your build products, make sure to keep the same time stamps. For example:

$ cp -r --preserve=timestamps build_opencv  /path/to/destination

Remember that the make utility keeps a list of the timestamps to help determine if something needs to be rebuilt. By default, cp marks copied files with the current timestamp. That means that make will rebuild everything if the timestamps are not preserved.

This works for all models of NVIDIA Jetsons. The Jetson in the video is a NVIDIA Jetson Nano Developer Kit.

For a Jetson Nano, you will need to modify the build_open_cv script.
The Jetson Nano doesn't know about the 8.7 (Jetson Orin) architecture
-D CUDA_ARCH_BIN=5.3,6.2,7.2,8.7
changes to:
-D CUDA_ARCH_BIN=5.3,6.2,7.2

and change the CUDA version to match your machine. On the Jetson Nano, this is 8.2.
-D CUDNN_VERSION='8.0'
changes to:
-D CUDNN_VERSION='8.2'

Here's an earlier video that covers the build in slightly more detail: Build OpenCV with CUDA Support for Je...

Jetson Nano Developer Kit: https://amzn.to/468IM8x

As an Amazon Associate I earn from qualifying purchases.
Visit the JetsonHacks storefront on Amazon: https://www.amazon.com/shop/jetsonhacks

Visit the website at https://jetsonhacks.com
Sign up for the newsletter! https://newsletter.jetsonhacks.com
Github accounts: https://github.com/jetsonhacks
                              https://github.com/jetsonhacksnano
Twitter: Twitter: jetsonhacks

Some of these links here are affiliate links. As an Amazon Associate I earn from qualifying purchases at no extra cost to you.
9 ماه پیش در تاریخ 1402/08/16 منتشر شده است.
13,504 بـار بازدید شده
... بیشتر