Open hofbauerc opened 3 months ago
Are you running docker with nvidia runtime, i.e. with docker run --rm --runtime=nvidia ...
as explained here?
You need to have the nvidia containe toolkit https://github.com/NVIDIA/nvidia-container-toolkit?tab=readme-ov-file to be able to access the GPU with docker.
Hi,
Yeah sure, I use my GPU (in this case a RTX 4060 Laptop Version) all the time in multiple docker environments. The GPU is listed inside the docker and all the stuff that requires one runs on it, I already checked that. It somehow seems that the flag for if the code was compiled using CUDA is not set. Could be something else but it seems like it.
Do you have any other ideas what the issue could be?
Thanks in advance.
Maybe for some reason it's not including the config file. You can try to add
#include <cctag/cctag_config.hpp>
at the top of src/applications/detection/CmdLine.hpp
and main.cpp
in the same folder and recompile.
This file is the one who defines (or not) CCTAG_WITH_CUDA
used in the code.
Thanks for the info, sadly it did not fix my issue.
Any other ideas what could cause that?
My docker environment in terms of GPU seems fine, the building process also runs without issues.
ah sorry I overlooked you had your own detection file, I was thinking you were using the one in the library.
Can you try to use that one? It is in the build directory under something like ./Linux/detection
.
Does that work with cuda?
And in any case, you should include the cctag_config.hpp
in your file as well.
Just a side note, unrelated to the issue, you can remove these lines from your cmakelists
# 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/)
everything is taken in charge by target_link_libraries
, adding those manually may result in conflicts.
Hi,
I just tested the detection application from the code itself, however there seems to bee some boost issue. Could this be related to the CUDA issue?
I just tested the detection application from the code itself, however there seems to bee some boost issue. Could this be related to the CUDA issue?
No it is not.
Add --use-cuda
to the command line to ask for cuda, at least we can see if we hit the same warning.
Do you have writing permissions in the folder I suppose? the exception seems like to indicate it cannot create a file.
Yeah sorry there were some permission issues, could have thought about that.
I tried to force it with --use-cuda but still the same issue.
can you ldd detection
and then ldd libCCTag.so
to see if it is linked to cuda?
Yea seems to be linked correctly.
Try to modify src/CMakeLists.txt
and add right before line 182
target_compile_definitions(CCTag PUBLIC CCTAG_WITH_CUDA)
Add the same for the detection target in its cmakelists
target_compile_definitions(detection PUBLIC CCTAG_WITH_CUDA)
and rebuild everything
Hi,
I tried the above and now the CUDA error is gone, but the detection using GPU seems to not work properly. Here both with and without CUDA:
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:
And this would be the CMakeLists.txt for my detection cpp file:
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?