Ask Your Question
0

Build problem (latest opencv, cuda-5.5)

asked 2013-08-24 17:26:06 -0500

Cthulhu gravatar image

updated 2013-08-26 02:00:01 -0500

I use ubuntu, use following cmake options:

cmake .. -DBUILD_EXAMPLES:BOOL="1" -DBUILD_opencv_world:BOOL="1" -DWITH_TBB:BOOL="1" \ -DENABLE_FAST_MATH:BOOL="1" -DENABLE_AVX:BOOL="1" -DINSTALL_C_EXAMPLES:BOOL="1" \ -DCMAKE_INSTALL_PREFIX:STRING="/opt/opencv-cuda" -DCUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda-5.5/" \ -DCUDA_FAST_MATH:BOOL="1" -DWITH_NVCUVID:BOOL="1" -DWITH_CUBLAS:BOOL="1" -DBUILD_DOCS:BOOL="1"

cuda-related output of cmake:

-- CUDA detected: 5.5
-- CUDA NVCC target flags: -gencode;arch=compute_11,code=sm_11;-gencode;arch=compute_12,code=sm_12;-gencode;arch=compute_13,code=sm_13;-gencode;arch=compute_20,code=sm_20;-gencode;arch=compute_20,code=sm_21;-gencode;arch=compute_30,code=sm_30;-gencode;arch=compute_35,code=sm_35;-gencode;arch=compute_30,code=compute_30
...
--   NVIDIA CUDA
--     Use CUFFT:                   YES
--     Use CUBLAS:                  YES
--     USE NVCUVID:                 YES
--     NVIDIA GPU arch:             11 12 13 20 21 30 35
--     NVIDIA PTX archs:            30
--     Use fast math:               YES

When I compile, however, I get the following errors:

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(67): error: no instance of overloaded function "atomicAdd" matches the argument list
        argument types are: (float *, float)

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(77): error: identifier "__longlong_as_double" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(77): error: identifier "__double_as_longlong" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(76): error: no instance of overloaded function "atomicCAS" matches the argument list
        argument types are: (unsigned long long *, unsigned long long, <error-type>)

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(79): error: identifier "__longlong_as_double" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(113): error: identifier "__longlong_as_double" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(113): error: identifier "__double_as_longlong" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(112): error: no instance of overloaded function "atomicCAS" matches the argument list
        argument types are: (unsigned long long *, unsigned long long, <error-type>)

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(115): error: identifier "__longlong_as_double" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(149): error: identifier "__longlong_as_double" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(149): error: identifier "__double_as_longlong" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(148): error: no instance of overloaded function "atomicCAS" matches the argument list
        argument types are: (unsigned long long *, unsigned long long, <error-type>)

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/atomic.hpp(151): error: identifier "__longlong_as_double" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp(231): error: identifier "__double2int_rn" is undefined

/home/cthulhu/src/opencv/modules/cudev/include/opencv2/cudev/util/saturate_cast.hpp(259): error: identifier "__double2uint_rn" is undefined

15 errors detected in the compilation of "/tmp/tmpxft_000067a1_00000000-22_gpu_mat.compute_11.cpp1.ii".
CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:264 (message):
  Error generating file
  /home/cthulhu/src/opencv/build/modules/core/CMakeFiles/cuda_compile.dir ...
(more)
edit retag flag offensive close merge delete

Comments

Small remark. We suggest not to use hashtags in the tags of your topic. They generate a lot of double tags, rendering the search and filter options useless. Keep this in mind at your next post, adjusted it for you now.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-08-26 02:01:35 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
7

answered 2013-08-25 02:08:19 -0500

Vladislav Vinogradov gravatar image

Remove 1.x compute capability archs from CUDA_ARCH_BIN:

cmake -DCUDA_ARCH_BIN="2.0 3.0 3.5" ..
edit flag offensive delete link more

Comments

1

Thanks, that got me past this error!

Cthulhu gravatar imageCthulhu ( 2013-08-25 02:44:57 -0500 )edit

I face the same problem. The solution is OK to build but it will make app raise an error "Gpu Api Call <invalid device function>..." with card that Compute Capability < 2.0. How to fix this problem?

Compvis gravatar imageCompvis ( 2013-09-16 11:09:33 -0500 )edit

I had similar issue, I compiled it with only one parameter 2.0. i.e. CUDA_ARCH_BIN = 2.0 and everything went smooth..

avcs gravatar imageavcs ( 2014-06-18 15:38:17 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-08-24 17:26:06 -0500

Seen: 4,398 times

Last updated: Aug 26 '13