dgrzech / sobfu

real-time 3D reconstruction of non-rigidly deforming scenes using depth data
BSD 3-Clause "New" or "Revised" License
161 stars 22 forks source link

Compilation in Ubuntu 20 fails [solved] #15

Open fsckawk opened 3 years ago

fsckawk commented 3 years ago

There are several issues related to compilation in an end-of-2021 system.

My setup:

wget https://www.coin-or.org/download/source/metslib/metslib-0.5.3.tgz
tar xzvf metslib-0.5.3.tgz
cd metslib-0.5.3
./configure --prefix=/usr/local
make
sudo make install

src/apps/demo.cpp:311:43: error: "CV_LOAD_IMAGE_ANYDEPTH" was not declared in this scope Edit and change that to:

            depth = cv::imread(depths[i], cv::IMREAD_ANYDEPTH);
            image = cv::imread(images[i], cv::IMREAD_COLOR);

With these changes, compilation ends succesfully. But "bin/app" complains:

Device 0:  "NVIDIA GeForce RTX 3070"  7960Mb
Can't determine number of cores. Unknown SM version 8.6!
, sm_86, 0 cores, Driver/Runtime ver.11.40/11.50

So, I tried replacing PCL 1.10 from distribution with my own compiled PCL 1.12.0 (with CUDA and GPU support).

Then, I had to change include/kfusion/cuda/marching_cubes.hpp too, replacing

typedef boost::shared_ptr<MarchingCubes> Ptr; with

typedef pcl::shared_ptr<MarchingCubes> Ptr;

But resulting "app" still can't determine number of cores.

So, I've edited src/kfusion/core.cpp following the example in

helper_cuda_drvapi.h

i.e., add {0x80, 64}, {0x86, 128} to gpuArchCoresPerSM array, and now seems to be OK.

Device 0: "NVIDIA GeForce RTX 3070" 7960Mb, sm_86, 5888 cores, Driver/Runtime ver.11.40/11.50

You can find a quick n' dirty patch here: sobfu.patch

With these changes, binaries are generated, and "app" works as expected with the "Snoopy" example.