Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuda_block_solver.cu(147): error: no instance of overloaded function "atomicAdd" matches the argument list argument types are: (cuba::Scalar *, cuba::Scalar) #16

Open
nakole2 opened this issue May 15, 2023 · 1 comment

Comments

@nakole2
Copy link

nakole2 commented May 15, 2023

I am trying to build this setup in external SSD where I have installed Ubuntu 22.04. I am getting this error while running make command. I have added the results of "cmake .." command followed by "make". Please help me to resolve this issue.

nisha@nisha-OMEN:~/cuda-bundle-adjustment/build$ cmake ..
-- Automatic GPU detection failed. Building for common architectures.
-- Autodetected CUDA architecture(s): 5.3;6.0;6.1;7.0;7.5;8.0;8.6;8.6+PTX
-- CUDA_ARCH: "-gencode;arch=compute_53,code=sm_53;-gencode;arch=compute_60,code=sm_60;-gencode;arch=compute_61,code=sm_61;-gencode;arch=compute_70,code=sm_70;-gencode;arch=compute_75,code=sm_75;-gencode;arch=compute_80,code=sm_80;-gencode;arch=compute_86,code=sm_86;-gencode;arch=compute_86,code=compute_86"
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nisha/cuda-bundle-adjustment/build

nisha@nisha-OMEN:~/cuda-bundle-adjustment/build$ make
[ 14%] Building NVCC (Device) object src/CMakeFiles/cuda_bundle_adjustment.dir/cuda_bundle_adjustment_generated_cuda_block_solver.cu.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘...’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘...’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
CMake Error at cuda_bundle_adjustment_generated_cuda_block_solver.cu.o.cmake:280 (message):
Error generating file
/home/nisha/cuda-bundle-adjustment/build/src/CMakeFiles/cuda_bundle_adjustment.dir//./cuda_bundle_adjustment_generated_cuda_block_solver.cu.o

make[2]: *** [src/CMakeFiles/cuda_bundle_adjustment.dir/build.make:955: src/CMakeFiles/cuda_bundle_adjustment.dir/cuda_bundle_adjustment_generated_cuda_block_solver.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:115: src/CMakeFiles/cuda_bundle_adjustment.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@tzukpolinsky
Copy link

i solved it by changing the CMakeLists.txt file in the src dir

set(CUBA_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/include)
include_directories(${CUBA_INCLUDE_DIR})

# CUDA
find_package(CUDAToolkit REQUIRED)
include_directories(${CUDA_INCLUDE_DIRS})
set(CUDA_ARCH "${ARCH_FLAGS}" CACHE STRING "Value of the NVCC -arch option." FORCE)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} ${CUDA_ARCH} -lineinfo -gencode=arch=compute_61,code=sm_61")

basically i changed the architecture to sm_60 after reading:
https://forums.developer.nvidia.com/t/why-does-atomicadd-not-work-with-doubles-as-input/56429

let me know if you have more troubles
@atakagi-fixstars maybe it's something to consider adding to the CMakeLists.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants