How do I enable CUDA when installing OpenCV?

I’ve followed all the instructions here: http://elinux.org/Tegra/Installing_CUDA and here: http://elinux.org/Jetson/Installing_OpenCV to the letter but when I run the houghlines example at the bottom of OpenCV page I get an error that dynamicuda.hpp had been compiled without CUDA support.

I’ve executed a ton of Google searches and tried a lot of suggestions to no avail.

Any help would be greatly appreciated.
I’d like to start writing custom code but if CUDA is not being utilized then what is the point of developing on the Jetson?

I don’t think the dynamicuda module is used at all in OpenCV4Tegra, but let me ask around to see what might be the issue.

Did you use the pre-built OpenCV4Tegra package or did you build OpenCV from source using CMake?

If you did both then they are probably in conflict so remove everything related to OpenCV then just use the prebuilt OpenCV4Tegra.

Or if you built from sources, please provide CMake and make output. Probably, cMake wasn’t able to find CUDA so it built OpenCV without CUDA support. As a solution, you can explicitly specify the path to CUDA toolkit dir in CMake command line:

cmake -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-6.0/ <other options>

But either way, you shouldn’t be getting this problem if you installed the CUDA Toolkit then installed the prebuilt OpenCV4Tegra library on the device.