Qt + CUDA _ GPU works on TX1 but not on TX2

Dear all,

I built a problem on Qt creator with CUDA and GPU. it works on TX1, TK1 but I I change it to TX2. I got this error message

" GPU 1: 0.002398
OpenCV Error: Gpu API call (invalid device function) in call, file /hdd/buildbot/slave_jetson_tx_3/35-O4T-L4T-R24/opencv/modules/gpu/include/opencv2/gpu/device/detail/transform_detail.hpp, line 320
terminate called after throwing an instance of ‘cv::Exception’
what(): /hdd/buildbot/slave_jetson_tx_3/35-O4T-L4T-R24/opencv/modules/gpu/include/opencv2/gpu/device/detail/transform_detail.hpp:320: error: (-217) invalid device function in function call"

From QT project .pro file, I changed GPU architecture from sm_53 to sm_62

GPU architecture

CUDA_ARCH = sm_62

Please give me some suggestions,

Thanks,

You can find more information regarding the problems with the gpu:: functions and Opencv4Tegra here:

https://devtalk.nvidia.com/default/topic/1000106/?comment=5114203

https://devtalk.nvidia.com/default/topic/1000701/?comment=5176691

You are advised to build from source if you wish to use the gpu:: functions immediately,

https://devtalk.nvidia.com/default/topic/1000106/jetson-tx2/opencv-convertto-failure/post/5133788/#5133788

Thanks, I followed the instruction and I can use gpu::functions now.

Sorry, I was wrong. I built from source OpenCV 2.4.13
I followed this instruction: http://docs.opencv.org/master/d6/d15/tutorial_building_tegra_cuda.html#tutorial_building_tegra_cuda_opencv_24X

nvidia@tegra-ubuntu:~$ pkg-config --modversion opencv
2.4.13

I still got the same error message.

OpenCV Error: Gpu API call (invalid device function) in call, file /hdd/buildbot/slave_jetson_tx_3/35-O4T-L4T-R24/opencv/modules/gpu/include/opencv2/gpu/device/detail/transform_detail.hpp, line 320
terminate called after throwing an instance of 'cv::Exception'
  what():  /hdd/buildbot/slave_jetson_tx_3/35-O4T-L4T-R24/opencv/modules/gpu/include/opencv2/gpu/device/detail/transform_detail.hpp:320: error: (-217) invalid device function in function call

Hi ngonha,

Do you enable -D CUDA when running cmake? Please paste the parameters you use when installed.

Hi Wayne

Thanks for your reply. Here is my CMake installed parameters

$ cmake \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_PNG=OFF \
    -DBUILD_TIFF=OFF \
    -DBUILD_TBB=OFF \
    -DBUILD_JPEG=OFF \
    -DBUILD_JASPER=OFF \
    -DBUILD_ZLIB=OFF \
    -DBUILD_EXAMPLES=ON \
    -DBUILD_opencv_java=OFF \
    -DBUILD_opencv_nonfree=OFF \
    -DBUILD_opencv_python=ON \
    -DENABLE_PRECOMPILED_HEADERS=OFF \
    -DWITH_OPENCL=OFF \
    -DWITH_OPENMP=OFF \
    -DWITH_FFMPEG=ON \
    -DWITH_GSTREAMER=OFF \
    -DWITH_GSTREAMER_0_10=OFF \
    -DWITH_CUDA=ON \
    -DWITH_GTK=ON \
    -DWITH_VTK=OFF \
    -DWITH_TBB=ON \
    -DWITH_1394=OFF \
    -DWITH_OPENEXR=OFF \
    -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-8.0 \
    -DCUDA_ARCH_BIN=5.3 \
    -DCUDA_ARCH_PTX="" \
    -DINSTALL_C_EXAMPLES=ON \
    -DINSTALL_TESTS=ON \
    -DOPENCV_TEST_DATA_PATH=../opencv_extra/testdata \
    ../opencv

Hi ngonha,

On TX2, the CUDA ARCH BIN is 6.2

-DCUDA_ARCH_BIN=5.3 -> please correct this line.