CCTag icon indicating copy to clipboard operation
CCTag copied to clipboard

[bug] Warning: CCTag library is built without CUDA support, so we can't enable CUDA.

Open hofbauerc opened this issue 6 months ago • 12 comments

Hello,

I am trying to build the library using CUDA and everything seems to be ok during the build process. However, when I try to do a simple detection using CUDA I get the following output: Warning: CCTag library is built without CUDA support, so we can't enable CUDA.

It seems that the CCTAG_WITH_CUDA flag is not set as seen in the message print.

I work inside a custom docker container with the following base image: FROM nvidia/cuda:12.3.1-devel-ubuntu22.04

I use the newest versions of TBB, eigen3, cmake and boost as well as opencv 4.7

I use following flags for building: cmake -DCCTAG_BUILD_TESTS:BOOL=ON -DCCTAG_BUILD_APPS:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DCCTAG_WITH_CUDA:BOOL=ON ..

And the output looks good as well:

-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Build type not set, building in Release configuration
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.66.0") found components: atomic chrono date_time filesystem program_options serialization system thread timer math_c99 stacktrace_basic unit_test_framework 
-- Found Boost: version 1.74.0
-- Try finding CUDA
-- BUILD_SHARED_LIBS ON
-- Found CUDA: /usr/local/cuda (found suitable version "12.3", minimum required is "9.0") 
-- Building in release mode
-- Found OpenCV: /opt (found version "4.7.0") found components: core videoio imgproc imgcodecs 
-- Found Eigen: version 3.4.0
-- Found TBB: version 2021.5.0
-- CCTAG already there
-- BOOST already there
-- Found OpenCV: /opt (found version "4.7.0") found components: core videoio imgproc imgcodecs highgui 
-- TBB already there
-- Found DevIL: /usr/lib/x86_64-linux-gnu/libIL.so  
-- DevIL found


******************************************
Building configuration:

-- CCTag version: 1.0.4
-- Build type: Release
-- Build Shared libs: ON
-- Build applications: ON
-- Build tests: ON
-- Build documentation: OFF
-- Cuda support: ON
-- Compiling for CUDA CCs: -gencode;arch=compute_50,code=sm_50;-gencode;arch=compute_52,code=sm_52;-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_89,code=sm_89;-gencode;arch=compute_90,code=sm_90;-gencode;arch=compute_90,code=compute_90
-- Enable Eigen alignment: OFF
-- Enable AVX2 optimizations: OFF
-- [debug] Serialize all the output: OFF
-- [debug] Enable visual debug: OFF
-- [debug] Disable output stream: ON
-- [debug] nvcc additional warnings: OFF
-- Install path: /usr/local

******************************************


-- Configuring done
-- Generating done
-- Build files have been written to: /opt/CCTag/build

And this would be the CMakeLists.txt for my detection cpp file:

# CMakeLists.txt
cmake_minimum_required(VERSION 3.13)

# Project name and version
project(cctag_detection VERSION 1.0)

# Specify the C++ standard
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Find OpenCV and Boost
find_package(OpenCV 4.7.0 REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem timer)
find_package(CUDA REQUIRED)
find_package(CCTag REQUIRED)

# Include directories for CCTag
include_directories(${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
include_directories(/usr/local/lib/)
include_directories(/usr/include/eigen3)
include_directories(/usr/local/cuda/include)
include_directories(${CUDA_INCLUDE_DIRS})

# Link directories for CCTag
link_directories(/usr/local/lib/)

# Add the executable
add_executable(cctag_detection cctag_detector.cpp)

# Link libraries
target_link_libraries(cctag_detection PRIVATE CCTag::CCTag ${OpenCV_LIBS} ${Boost_LIBRARIES} ${CUDA_LIBRARIES})

Which also builds without issues.

I am using the newest CCTag release from a few weeks ago.

Am I missing some flag that needs to be set? Are there some CUDA version issues with 12.3.1?

hofbauerc avatar Aug 12 '24 10:08 hofbauerc