I attempted to build opencv-2.4.11 for Jetson TX1 with cuda7.0-71 and managed to build successfully.
However my application failed to execute when it try using the gpu functions such as gpu::matchTemplate.
The following error are observed.
[i]NCV Assertion Failed: cudaError_t=18, file=opencv-2.4.11/modules/gpu/src/NVidia/NPP_staging/NPP_staging.cu, line=336
NCV Assertion Failed: NcvStat=4, file=opencv-2.4.11/modules/gpu/src/NVidia/NPP_staging/NPP_staging.cu, line=464
NCV Assertion Failed: NcvStat=4, file=opencv-2.4.11/modules/gpu/src/NVidia/NPP_staging/NPP_staging.cu, line=578
OpenCV Error: Gpu API call (NCV_FILE_ERROR [Code = 4]) in sqrIntegral, file opencv-2.4.11/modules/gpu/src/imgproc.cpp, line 636
terminate called after throwing an instance of ‘cv::Exception’
what(): opencv-2.4.11/modules/gpu/src/imgproc.cpp:636: error: (-217) NCV_FILE_ERROR [Code = 4] in function sqrIntegral
Hi There. A few things. You’re probably aware of this, but you can actually download a special version of OpenCV optimized for Tegra devices (2.4.12, I believe.) That should work out of the box
As for your error, I’m not sure about OCV2, but I’ve been building OpenCV3 over and over on my Tx1 (for various reasons…), and the commands I run are
for an out of source build
cd opencv-master;
mkdir build;
cd build;
cmake -DCMAKE_BUILD_TYPE=RELEASE …;
At which point CUDA gets picked up with the correct architecture. In the past this has just worked for me, and I haven’t had to specify a specific cmake toolcahin file or anything like that. However if there was a reason for you to format your cmake command like that, then you may have more knowledge than me and are ignore my advice.
Hi, I am aware there is prebuilt binary for TX1 but not so much about a special version of OpenCV source, so if you don’t mind, can you point me to the link?
As for the reason to my cmake command, I tried follow example provided to cross compile TK1 OpenCV (Jetson/Installing OpenCV - eLinux.org), which I realize may not be compatible as GPU used are different.
I am unsure what should I set for my CUDA_ARCH_BIN and CUDA_ARCH_PTX in order to cross compile TX1 OpenCV.