mihaibujanca / dynamicfusion

Implementation of Newcombe et al. CVPR 2015 DynamicFusion paper
BSD 3-Clause "New" or "Revised" License
391 stars 105 forks source link

compiling the project on Ubuntu 18.04 LTS #75

Open OshriHalimi opened 3 years ago

OshriHalimi commented 3 years ago

I'm trying to compile the code on my Ubuntu 18.04 LTS machine, with cuda=10.2, Nvidia driver version=440.33.01. I suspect the code is not compatible with cuda 10. Cuda 9 is not officially supported on Ubuntu 18.04 so I cannot test the compilation with cuda 9. I'm attaching the compilation output below. Is there a way to make the project compile with cuda>=10? I'll appreciate your help!

It took some effort but I managed to compile all the dependencies:

(base) smosesli@smosesli-gpu:~/dynamicfusion/build$ cmake -DOpenCV_DIR=/home/smosesli/dynamicfusion/opencv/build -DBOOST_ROOT=/home/smosesli/dynamicfusion/boost_1_64_0 -DOPENNI_INCLUDE_DIR=/home/smosesli/dynamicfusion/OpenNI-master/ -DOpenCV_FOUND=TRUE ..
-- OpenNI found (include: /home/smosesli/dynamicfusion/OpenNI-master, lib: /usr/lib/libOpenNI.so)
-- Found required Ceres dependency: Eigen version 3.3.4 in /usr/include/eigen3
-- Found required Ceres dependency: glog
-- Found Ceres version: 2.0.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SchurSpecializations, Multithreading]
FOUND OPENNI AT: /home/smosesli/dynamicfusion/OpenNI-master
CUDA_LIBRARIES:/usr/local/cuda/lib64/libcudart_static.a-lpthreaddl/usr/lib/x86_64-linux-gnu/librt.so
CUDA_CUDART_LIBRARY:/usr/local/cuda/lib64/libcudart.so
CUDA_CUDA_LIBRARY:/usr/lib/x86_64-linux-gnu/libcuda.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/smosesli/dynamicfusion

The compilation fails when it comes to compile the cuda code:

(base) smosesli@smosesli-gpu:~/dynamicfusion$ make -j16 [ 5%] Building NVCC (Device) object kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_tsdf_volume.cu.o [ 11%] Building NVCC (Device) object kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_imgproc.cu.o [ 16%] Building NVCC (Device) object kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_proj_icp.cu.o In file included from /home/smosesli/dynamicfusion/kfusion/src/cuda/imgproc.cu:1:0: /usr/local/cuda/include/host_defines.h:54:2: warning: #warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]

warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead."

^~~ In file included from /home/smosesli/dynamicfusion/kfusion/src/cuda/imgproc.cu:1:0: /usr/local/cuda/include/host_defines.h:54:2: warning: #warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]

warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead."

^~~ In file included from /home/smosesli/dynamicfusion/kfusion/src/cuda/imgproc.cu:1:0: /usr/local/cuda/include/host_defines.h:54:2: warning: #warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]

warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead."

^~~ In file included from /home/smosesli/dynamicfusion/kfusion/src/cuda/imgproc.cu:1:0: /usr/local/cuda/include/host_defines.h:54:2: warning: #warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]

warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead."

^~~ In file included from /home/smosesli/dynamicfusion/kfusion/src/cuda/imgproc.cu:1:0: /usr/local/cuda/include/host_defines.h:54:2: warning: #warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]

warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead."

^~~ In file included from /home/smosesli/dynamicfusion/kfusion/src/cuda/imgproc.cu:1:0: /usr/local/cuda/include/host_defines.h:54:2: warning: #warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead." [-Wcpp]

warning "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead."

^~~ /home/smosesli/dynamicfusion/kfusion/src/cuda/temp_utils.hpp(585): warning: function "ballot" /usr/local/cuda/include/sm_20_intrinsics.h(405): here was declared deprecated ("ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/temp_utils.hpp(597): warning: function "all" /usr/local/cuda/include/device_atomic_functions.h(179): here was declared deprecated ("all() is deprecated in favor of __all_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/temp_utils.hpp(585): warning: function "ballot" /usr/local/cuda/include/sm_20_intrinsics.h(405): here was declared deprecated ("ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/temp_utils.hpp(597): warning: function "all" /usr/local/cuda/include/device_atomic_functions.h(179): here was declared deprecated ("all() is deprecated in favor of __all_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(54): error: identifier "__float2half_rn" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(59): error: identifier "__half2float" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(61): error: identifier "__half2float" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(54): error: identifier "__float2half_rn" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(59): error: identifier "__half2float" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(61): error: identifier "__half2float" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/tsdf_volume.cu(541): warning: function "all" /usr/local/cuda/include/device_atomic_functions.h(179): here was declared deprecated ("all() is deprecated in favor of __all_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/tsdf_volume.cu(541): warning: function "all" /usr/local/cuda/include/device_atomic_functions.h(179): here was declared deprecated ("all() is deprecated in favor of __all_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/tsdf_volume.cu(638): warning: function "ballot" /usr/local/cuda/include/sm_20_intrinsics.h(405): here was declared deprecated ("ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/tsdf_volume.cu(638): warning: function "ballot" /usr/local/cuda/include/sm_20_intrinsics.h(405): here was declared deprecated ("ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/tsdf_volume.cu(638): warning: function "ballot" /usr/local/cuda/include/sm_20_intrinsics.h(405): here was declared deprecated ("ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/temp_utils.hpp(585): warning: function "ballot" /usr/local/cuda/include/sm_20_intrinsics.h(405): here was declared deprecated ("ballot() is deprecated in favor of __ballot_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/temp_utils.hpp(597): warning: function "all" /usr/local/cuda/include/device_atomic_functions.h(179): here was declared deprecated ("all() is deprecated in favor of __all_sync() and may be removed in a future release (Use -Wno-deprecated-declarations to suppress this warning).")

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(54): error: identifier "__float2half_rn" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(59): error: identifier "__half2float" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/device.hpp(61): error: identifier "__half2float" is undefined

/home/smosesli/dynamicfusion/kfusion/src/cuda/imgproc.cu(270): error: identifier "__float2half_rn" is undefined

3 errors detected in the compilation of "/tmp/tmpxft_00004468_00000000-9_proj_icp.compute_61.cpp1.ii". 3 errors detected in the compilation of "/tmp/tmpxft_00004467_00000000-9_tsdf_volume.compute_61.cpp1.ii". CMake Error at kfusion_generated_proj_icp.cu.o.cmake:280 (message): Error generating file /home/smosesli/dynamicfusion/kfusion/CMakeFiles/kfusion.dir/src/cuda/./kfusion_generated_proj_icp.cu.o

kfusion/CMakeFiles/kfusion.dir/build.make:642: recipe for target 'kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_proj_icp.cu.o' failed make[2]: [kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_proj_icp.cu.o] Error 1 make[2]: Waiting for unfinished jobs.... CMake Error at kfusion_generated_tsdf_volume.cu.o.cmake:280 (message): Error generating file /home/smosesli/dynamicfusion/kfusion/CMakeFiles/kfusion.dir/src/cuda/./kfusion_generated_tsdf_volume.cu.o

kfusion/CMakeFiles/kfusion.dir/build.make:935: recipe for target 'kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_tsdf_volume.cu.o' failed make[2]: *** [kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_tsdf_volume.cu.o] Error 1 4 errors detected in the compilation of "/tmp/tmpxft_0000446e_00000000-9_imgproc.compute_61.cpp1.ii". CMake Error at kfusion_generated_imgproc.cu.o.cmake:280 (message): Error generating file /home/smosesli/dynamicfusion/kfusion/CMakeFiles/kfusion.dir/src/cuda/./kfusion_generated_imgproc.cu.o

kfusion/CMakeFiles/kfusion.dir/build.make:349: recipe for target 'kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_imgproc.cu.o' failed make[2]: [kfusion/CMakeFiles/kfusion.dir/src/cuda/kfusion_generated_imgproc.cu.o] Error 1 CMakeFiles/Makefile2:116: recipe for target 'kfusion/CMakeFiles/kfusion.dir/all' failed make[1]: [kfusion/CMakeFiles/kfusion.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

nicolashei1201 commented 3 years ago

I can’t built it on cuda10 either, I think the newest compatible version of coda is cuda8, I built a docker image on docker hub if your gpu is compatible with cuda8, good luck! https://hub.docker.com/r/nicolashei/nick-dynamicfusion-cuda8.0

Wangyouai commented 3 years ago

@OshriHalimi Hi , did you succeed?

iegorval commented 3 years ago

@OshriHalimi did you manage to build the specified OpenCV version? I am getting CMakeError when I am trying to follow the build.sh script.

jinzhenmu commented 3 years ago

hi, have you solved this problem? i met the same error