From ac490255cccd83c77242f82701fe3358fab67db8 Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Mon, 7 Jun 2021 19:13:52 +0200 Subject: [PATCH 01/21] fix std::fabs etc. compile errors on 20.04 by including --- packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h b/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h index 215b004..f42dd17 100644 --- a/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h +++ b/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h @@ -25,6 +25,7 @@ #ifndef GPU_VOXELS_CUDA_VECTORS_H_INCLUDED #define GPU_VOXELS_CUDA_VECTORS_H_INCLUDED +#include #include #include #include From 39790ed53b9aa6db26ad8c47e25468a76fd01025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Filipe?= Date: Mon, 31 May 2021 11:41:59 +0100 Subject: [PATCH 02/21] Change variable type in order to be compatible with ubuntu 20.04. --- packages/gpu_voxels/src/gpu_visualization/Visualizer.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu b/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu index 43fcb14..26b8a1f 100644 --- a/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu +++ b/packages/gpu_voxels/src/gpu_visualization/Visualizer.cu @@ -1682,7 +1682,7 @@ void Visualizer::renderFunction(void) if (m_max_fps != 0 && m_delta_time < 1000.f / m_max_fps) { - float wait = 1000.f / m_max_fps - m_delta_time; + int wait = 1000 / m_max_fps - m_delta_time; m_delta_time += wait; boost::this_thread::sleep(boost::posix_time::milliseconds(wait)); } From 3bf9ac64d6ea4439bb54f523e435733824faec8b Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Tue, 24 Sep 2019 16:03:12 +0200 Subject: [PATCH 03/21] fix missing boost include --- packages/gpu_voxels/src/gpu_voxels/GpuVoxels.h | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/gpu_voxels/src/gpu_voxels/GpuVoxels.h b/packages/gpu_voxels/src/gpu_voxels/GpuVoxels.h index 4a089e6..6aab36e 100644 --- a/packages/gpu_voxels/src/gpu_voxels/GpuVoxels.h +++ b/packages/gpu_voxels/src/gpu_voxels/GpuVoxels.h @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include From 6136a43de90170cc20df1706763667c85409fb2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20J=C3=BClg?= Date: Fri, 8 Nov 2019 14:18:50 +0100 Subject: [PATCH 04/21] add install_eigen_for_18.04.sh. TODO: mention in docs --- install_eigen_for_18.04.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 install_eigen_for_18.04.sh diff --git a/install_eigen_for_18.04.sh b/install_eigen_for_18.04.sh new file mode 100755 index 0000000..695db89 --- /dev/null +++ b/install_eigen_for_18.04.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +DEST=3rd-party/eigen-git-mirror +VERSION="3.3.7" + +echo "Cloning Eigen3 $VERSION to $DEST ($(realpath $DEST))" +mkdir -p $DEST +git clone https://github.com/eigenteam/eigen-git-mirror.git -b $VERSION $DEST + +echo "Add the Eigen3 root folder to CMAKE_PREFIX_PATH as follows:" +echo "export CMAKE_PREFIX_PATH=$(realpath ${DEST}):\$CMAKE_PREFIX_PATH" From 0b79933f89ec56a7b5c51040eb3abfa264684371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20J=C3=BClg?= Date: Wed, 13 Nov 2019 14:22:40 +0100 Subject: [PATCH 05/21] Update install_eigen_for_18.04.sh --- install_eigen_for_18.04.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_eigen_for_18.04.sh b/install_eigen_for_18.04.sh index 695db89..0261624 100755 --- a/install_eigen_for_18.04.sh +++ b/install_eigen_for_18.04.sh @@ -3,7 +3,7 @@ DEST=3rd-party/eigen-git-mirror VERSION="3.3.7" -echo "Cloning Eigen3 $VERSION to $DEST ($(realpath $DEST))" +echo "Cloning Eigen3 tag $VERSION to $DEST ($(realpath $DEST))" mkdir -p $DEST git clone https://github.com/eigenteam/eigen-git-mirror.git -b $VERSION $DEST From 1cda05cb433b6ae6c79961bf76df4de68af1afa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9?= Date: Wed, 11 Nov 2020 15:41:58 +0000 Subject: [PATCH 06/21] Add some operators to Vector3f. --- .../src/gpu_voxels/helpers/cuda_vectors.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h b/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h index f42dd17..e1ec98f 100644 --- a/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h +++ b/packages/gpu_voxels/src/gpu_voxels/helpers/cuda_vectors.h @@ -232,6 +232,24 @@ struct Vector3f return *this; } + __device__ __host__ + inline Vector3f& operator*=(const float& b) + { + x *= b; + y *= b; + z *= b; + return *this; + } + + __device__ __host__ + inline Vector3f& operator/=(const float& b) + { + x /= b; + y /= b; + z /= b; + return *this; + } + __device__ __host__ inline bool operator==(const Vector3f& b) const { From 69bd7adc83587d6c542b762e784b77925ab3cec1 Mon Sep 17 00:00:00 2001 From: falmeida Date: Fri, 18 Sep 2020 11:45:30 +0100 Subject: [PATCH 07/21] update issue git url to http --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 83c432c..5e33923 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,12 @@ This is important if you are still using ROS Indigo and need to compile without - If the ROS dependency was found, but the GPU-Voxels URDF features are still unabailable, run `source /opt/ros/YOUR_ROS_DISTRO/setup.bash` before running cmake. - Eigen 3 issues: can be fixed by cloning a more current unstable Eigen version and placing it in CMAKE_PREFIX_PATH + on Ubuntu 18.04 with CUDA 10.0: "math_functions.hpp not found" + ```bash + git clone https://gitlab.com/libeigen/eigen.git + sudo cp -r signature_of_eigen3_matrix_library /usr/include/eigen3 + sudo cp -r unsupported/ /usr/include/eigen3 + sudo cp -r Eigen/ /usr/include/eigen3 + ``` + Eigen 3.3.4 and 3.3.5 with CUDA 9.0, 9.1, 9.2: Error: class "Eigen::half" has no member "x" + see http://eigen.tuxfamily.org/index.php?title=Main_Page#Download - Cuda 8.0: Code compiled with Cuda 8.0 works fine with older GPU drivers such as 375.66, but there are runtime errors with driver 384.111 and newer ("PTX JIT compilation failed"). Easy fix: use Cuda 10 with a current 410 or newer driver version. Cuda 10 is also available for Ubuntu 14.04 and 16.04. From abd3c29291a0b954c68df02b24ca8578889b78c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20J=C3=BClg?= Date: Mon, 23 Sep 2019 18:41:34 +0200 Subject: [PATCH 08/21] CMakeLists: add JETSON_SUPPORT and PCL_SUPPORT switches. Activate C++11 by default. Detect PCL without OpenNI grabber support --- packages/gpu_voxels/CMakeLists.txt | 62 ++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 12 deletions(-) diff --git a/packages/gpu_voxels/CMakeLists.txt b/packages/gpu_voxels/CMakeLists.txt index a2cff10..7b5a610 100644 --- a/packages/gpu_voxels/CMakeLists.txt +++ b/packages/gpu_voxels/CMakeLists.txt @@ -1,17 +1,37 @@ # this is for emacs file handling -*- mode: cmake; indent-tabs-mode: nil -*- +# --- Global options --- + +## support Jetson mobile GPUs +SET(JETSON_SUPPORT OFF) + +## allow compilation without PCL for gvl_ompl_planner +SET(PCL_SUPPORT ON) + +# fix for cuda 9.1 thrust cub addArgument runtime segfault +SET(CUDA_USE_STATIC_CUDA_RUNTIME OFF) + +# required in order to query CUDA_VERSION_STRING +FIND_PACKAGE(CUDA) + +## C++11 SET(CMAKE_CXX_STANDARD 11) # comment out to deactivate C++11 when using ROS indigo to avoid incompatibilities +SET(ICMAKER_CUDA_CXX_STANDARD "--std=c++11") # necessary to compile .cu files with C++11 content + +# suppress erroneous warnings, see https://github.com/ORNL-CEES/DataTransferKit/pull/404 +# Warning: incompatible with CUDA < 9.0 ! +MESSAGE(STATUS "------------- GPU Voxels found CUDA version ${CUDA_VERSION_STRING} ------------") +IF(CUDA_VERSION_STRING VERSION_LESS "9") + SET(SUPPRESS_NVCC_DEFAULTED_WARNINGS "") +ELSE() + SET(SUPPRESS_NVCC_DEFAULTED_WARNINGS "-Xcudafe --diag_suppress=esa_on_defaulted_function_ignored") +ENDIF() # --- To be used by other modules --- SET(GPU_VOXELS_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_BINARY_DIR}/src" CACHE INTERNAL "") SET(GPU_VOXELS_IDL_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE INTERNAL "") SET(GPU_VOXELS_IDE_FOLDER "gpu_voxels") -# --- Global options --- - -SET(CUDA_USE_STATIC_CUDA_RUNTIME OFF) # fix for cuda 9.1 thrust cub addArgument runtime segfault -FIND_PACKAGE(CUDA) - FIND_PACKAGE(Boost COMPONENTS system thread filesystem date_time unit_test_framework chrono) # LibRT is needed for Boost Interprocess on POSIX systems @@ -37,7 +57,9 @@ FIND_PACKAGE(kdl_parser) FIND_PACKAGE(Octomap) # Dependencies for PCL interfaces -FIND_PACKAGE(PCL) +IF (PCL_SUPPORT) + FIND_PACKAGE(PCL) +ENDIF (PCL_SUPPORT) FIND_PACKAGE(pcl_ros) @@ -48,6 +70,14 @@ FIND_PACKAGE(OpenNi) # ICL Package management ICMAKER_REGISTER_PACKAGE(gpu_voxels) +# Check if pcl/io/openni_grabber.h exists +FIND_FILE(PCL_OPENNI_GRABBER_FILE pcl/io/openni_grabber.h ${PCL_INCLUDE_DIRS}) +IF(${PCL_OPENNI_GRABBER_FILE} STREQUAL "PCL_OPENNI_GRABBER_FILE-NOTFOUND") + SET(PCL_OPENNI_GRABBER_FILE_FOUND OFF) +ELSE() + SET(PCL_OPENNI_GRABBER_FILE_FOUND ON) +ENDIF() + MESSAGE(STATUS "--------------------------------------------------------------------------") MESSAGE(STATUS "------------------------ GPU Voxels configuration ------------------------") MESSAGE(STATUS " ") @@ -106,11 +136,11 @@ ENDIF(urdfdom_FOUND AND orocos_kdl_FOUND AND kdl_parser_FOUND) # MESSAGE(STATUS "[WARNING] Building GPU-Voxels without Kinect support. OpenNI2 not found.") #ENDIF(OPENNI2_FOUND) -IF(OPENNI_FOUND) - MESSAGE(STATUS "[OK] Building GPU-Voxels with Kinect support. OpenNI was found.") +IF(OPENNI_FOUND AND PCL_OPENNI_GRABBER_FILE_FOUND) + MESSAGE(STATUS "[OK] Building GPU-Voxels with Kinect support. OpenNI and ${PCL_OPENNI_GRABBER_FILE} was found.") ELSE(OPENNI_FOUND) - MESSAGE(STATUS "[WARNING] Building GPU-Voxels without Kinect support. OpenNI not found.") -ENDIF(OPENNI_FOUND) + MESSAGE(STATUS "[WARNING] Building GPU-Voxels without Kinect support. OpenNI or pcl/io/openni_grabber.h not found.") +ENDIF(OPENNI_FOUND AND PCL_OPENNI_GRABBER_FILE_FOUND) IF(Octomap_FOUND) MESSAGE(STATUS "[OK] Building GPU-Voxels with Octomap support. Octomap found.") @@ -153,9 +183,17 @@ SET(ICMAKER_CUDA_CODE compute_${ICMAKER_CUDA_COMPUTE_VERSION}) SET(ICMAKER_CUDA_PTXAS_VERBOSE "") # "--resource-usage") #nvcc outputs register and memory usage data for each kernel SET(ICMAKER_CUDA_WALL "-Xcompiler=-Wall") -SET(ICMAKER_CUDA_MAXREGS "--maxrregcount=63") # set to 31 to compile on JetsonTX1/TX2/Nano (compute capability 5.3/6.2); N*blocksize must be smaller than max registers per block SET(ICMAKER_CUDA_DEBUG "-lineinfo") # "-lineinfo") #"-g -G") # -G disables optimization. use -lineinfo for profiling +# might be replaced by setting per-kernel launch bounds: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#launch-bounds +# TODO: test again if using 32 (Jetson) or 64 (non-Jetson) instead of 31/63 causes problems +IF(JETSON_SUPPORT) + # set to 31 to compile on JetsonTX1/TX2/Nano (compute capability 5.3/6.2); N*blocksize must be smaller than max registers per block + SET(ICMAKER_CUDA_MAXREGS "--maxrregcount=31") +ELSE(JETSON_SUPPORT) + SET(ICMAKER_CUDA_MAXREGS "--maxrregcount=63") # there are 64K registers on current Geforce GPUs, fittting 1K threads with 64 registers +ENDIF(JETSON_SUPPORT) + # Enable position independent code SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") @@ -166,7 +204,7 @@ ELSE() SET(ICMAKER_CUDA_THRUST_DEBUG "" ) ENDIF() -SET(ICMAKER_CUDA_CPPDEFINES "${ICMAKER_CUDA_DEBUG} ${ICMAKER_CUDA_MAXREGS} ${ICMAKER_CUDA_PTXAS_VERBOSE} -gencode=arch=${ICMAKER_CUDA_ARCH},code=[${ICMAKER_CUDA_CODE}] ${ICMAKER_CUDA_THRUST_DEBUG} ${ICMAKER_CUDA_WALL}") +SET(ICMAKER_CUDA_CPPDEFINES "${ICMAKER_CUDA_DEBUG} ${ICMAKER_CUDA_MAXREGS} ${ICMAKER_CUDA_PTXAS_VERBOSE} -gencode=arch=${ICMAKER_CUDA_ARCH},code=[${ICMAKER_CUDA_CODE}] ${ICMAKER_CUDA_THRUST_DEBUG} ${ICMAKER_CUDA_CXX_STANDARD} ${ICMAKER_CUDA_WALL} ${SUPPRESS_NVCC_DEFAULTED_WARNINGS}") MESSAGE("ICMAKER_CUDA_CPPDEFINES: ${ICMAKER_CUDA_CPPDEFINES}") From 11c87f896683bc41f86a91ac907bdb7054184c1c Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 24 Jun 2022 17:49:32 +0200 Subject: [PATCH 09/21] set C++14 standard, add BUILD_EXAMPLES option --- packages/gpu_voxels/CMakeLists.txt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/gpu_voxels/CMakeLists.txt b/packages/gpu_voxels/CMakeLists.txt index 7b5a610..8acfad1 100644 --- a/packages/gpu_voxels/CMakeLists.txt +++ b/packages/gpu_voxels/CMakeLists.txt @@ -8,15 +8,19 @@ SET(JETSON_SUPPORT OFF) ## allow compilation without PCL for gvl_ompl_planner SET(PCL_SUPPORT ON) +## disable compilation of GPU-Voxels examples +SET(BUILD_EXAMPLES ON) + # fix for cuda 9.1 thrust cub addArgument runtime segfault SET(CUDA_USE_STATIC_CUDA_RUNTIME OFF) # required in order to query CUDA_VERSION_STRING FIND_PACKAGE(CUDA) -## C++11 -SET(CMAKE_CXX_STANDARD 11) # comment out to deactivate C++11 when using ROS indigo to avoid incompatibilities -SET(ICMAKER_CUDA_CXX_STANDARD "--std=c++11") # necessary to compile .cu files with C++11 content +## set C++ standard +# Note: C++11 is incompatible with ROS Indigo / Ubuntu 16.04 +SET(CMAKE_CXX_STANDARD 14) +SET(ICMAKER_CUDA_CXX_STANDARD "--std=c++14") # suppress erroneous warnings, see https://github.com/ORNL-CEES/DataTransferKit/pull/404 # Warning: incompatible with CUDA < 9.0 ! @@ -237,7 +241,9 @@ ICMAKER_CONFIGURE_PACKAGE() ############################################################################### # Build examples -ADD_SUBDIRECTORY(src/examples) +IF(BUILD_EXAMPLES) + ADD_SUBDIRECTORY(src/examples) +ENDIF() IF(BUILD_TESTS) ENDIF(BUILD_TESTS) From 49720ad13191bcc840ffa993c4d6ae738ffd380a Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 24 Jun 2022 20:03:23 +0200 Subject: [PATCH 10/21] fix error namespace "thrust" has no member "host_vector" --- packages/gpu_voxels/src/gpu_voxels/test/testing_thrust.cu | 1 + packages/gpu_voxels/src/gpu_voxels/voxellist/BitVoxelList.h | 2 ++ .../gpu_voxels/src/gpu_voxels/voxelmap/DistanceVoxelMap.hpp | 1 + .../gpu_voxels/src/gpu_voxels/voxelmap/TemplateVoxelMap.hpp | 1 + 4 files changed, 5 insertions(+) diff --git a/packages/gpu_voxels/src/gpu_voxels/test/testing_thrust.cu b/packages/gpu_voxels/src/gpu_voxels/test/testing_thrust.cu index 8192252..256db57 100644 --- a/packages/gpu_voxels/src/gpu_voxels/test/testing_thrust.cu +++ b/packages/gpu_voxels/src/gpu_voxels/test/testing_thrust.cu @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include diff --git a/packages/gpu_voxels/src/gpu_voxels/voxellist/BitVoxelList.h b/packages/gpu_voxels/src/gpu_voxels/voxellist/BitVoxelList.h index b2c8f90..61463f9 100644 --- a/packages/gpu_voxels/src/gpu_voxels/voxellist/BitVoxelList.h +++ b/packages/gpu_voxels/src/gpu_voxels/voxellist/BitVoxelList.h @@ -30,6 +30,8 @@ #include #include +#include + namespace gpu_voxels { namespace voxellist { diff --git a/packages/gpu_voxels/src/gpu_voxels/voxelmap/DistanceVoxelMap.hpp b/packages/gpu_voxels/src/gpu_voxels/voxelmap/DistanceVoxelMap.hpp index bc26ba8..505d94f 100644 --- a/packages/gpu_voxels/src/gpu_voxels/voxelmap/DistanceVoxelMap.hpp +++ b/packages/gpu_voxels/src/gpu_voxels/voxelmap/DistanceVoxelMap.hpp @@ -34,6 +34,7 @@ #include #include +#include #include #include #include diff --git a/packages/gpu_voxels/src/gpu_voxels/voxelmap/TemplateVoxelMap.hpp b/packages/gpu_voxels/src/gpu_voxels/voxelmap/TemplateVoxelMap.hpp index 389f854..c19390c 100644 --- a/packages/gpu_voxels/src/gpu_voxels/voxelmap/TemplateVoxelMap.hpp +++ b/packages/gpu_voxels/src/gpu_voxels/voxelmap/TemplateVoxelMap.hpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include From dd2e1da45353b889272c89fbc41d4fcc4d2446a6 Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 24 Jun 2022 20:31:29 +0200 Subject: [PATCH 11/21] fix CUB includes for cuda 11 --- packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp | 4 +++- packages/gpu_voxels/src/gpu_voxels/octree/NTreeData.h | 5 ++++- packages/gpu_voxels/src/gpu_voxels/octree/PointCloud.cu | 7 +++++-- .../src/gpu_voxels/octree/kernels/kernel_common.h | 5 ++++- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp b/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp index fc2aae2..f68e6fd 100644 --- a/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp +++ b/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp @@ -62,13 +62,15 @@ #undef CUB_NS_PREFIX #undef CUB_NS_POSTFIX namespace cub = thrust::system::cuda::detail::cub_; -#else // Cuda 9 or higher +#elif CUDA_VERSION < 11000 // Cuda 9 or 10 #define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub { #define THRUST_CUB_NS_POSTFIX } } #include #undef CUB_NS_PREFIX #undef CUB_NS_POSTFIX namespace cub = thrust::cuda_cub::cub; +#else // cuda 11 or newer +#include #endif // Internal dependencies diff --git a/packages/gpu_voxels/src/gpu_voxels/octree/NTreeData.h b/packages/gpu_voxels/src/gpu_voxels/octree/NTreeData.h index c07c135..ae7ec95 100644 --- a/packages/gpu_voxels/src/gpu_voxels/octree/NTreeData.h +++ b/packages/gpu_voxels/src/gpu_voxels/octree/NTreeData.h @@ -41,15 +41,18 @@ #undef CUB_NS_PREFIX #undef CUB_NS_POSTFIX namespace cub = thrust::system::cuda::detail::cub_; -#else // Cuda 9 or higher +#elif CUDA_VERSION < 11000 // Cuda 9 or 10 #define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub { #define THRUST_CUB_NS_POSTFIX } } #include #undef CUB_NS_PREFIX #undef CUB_NS_POSTFIX namespace cub = thrust::cuda_cub::cub; +#else // cuda 11 or newer +#include #endif + namespace gpu_voxels { namespace NTree { diff --git a/packages/gpu_voxels/src/gpu_voxels/octree/PointCloud.cu b/packages/gpu_voxels/src/gpu_voxels/octree/PointCloud.cu index 5b3c009..b7f24b2 100644 --- a/packages/gpu_voxels/src/gpu_voxels/octree/PointCloud.cu +++ b/packages/gpu_voxels/src/gpu_voxels/octree/PointCloud.cu @@ -16,13 +16,16 @@ #if __CUDACC_VER_MAJOR__ < 9 #include namespace cub = thrust::system::cuda::detail::cub_; -#else // Cuda 9 or higher +#include +#elif __CUDACC_VER_MAJOR__ < 11 // Cuda 9 or 10 #define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub { -#define THRUST_CUB_NS_POSTFIX } } +#define THRUST_CUB_NS_POSTFIX } } #include #undef CUB_NS_PREFIX #undef CUB_NS_POSTFIX namespace cub = thrust::cuda_cub::cub; +#else // cuda 11 or newer +#include #endif #include diff --git a/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_common.h b/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_common.h index 4e9ff6e..847f026 100644 --- a/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_common.h +++ b/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_common.h @@ -40,15 +40,18 @@ #undef CUB_NS_PREFIX #undef CUB_NS_POSTFIX namespace cub = thrust::system::cuda::detail::cub_; -#else // Cuda 9 or higher +#elif CUDA_VERSION < 11000 // Cuda 9 or 10 #define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub { #define THRUST_CUB_NS_POSTFIX } } #include #undef CUB_NS_PREFIX #undef CUB_NS_POSTFIX namespace cub = thrust::cuda_cub::cub; +#else // cuda 11 or newer +#include #endif + // __ballot has been replaced by __ballot_sync in Cuda9 #if(__CUDACC_VER_MAJOR__ >= 9) #define FULL_MASK 0xffffffff From 78e42a5ed573c413e2ec4ed86b0e070953063249 Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 24 Jun 2022 20:50:13 +0200 Subject: [PATCH 12/21] avoid string conversion warning --- .../gpu_voxels/src/gpu_voxels/octree/kernels/kernel_Octree.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_Octree.h b/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_Octree.h index 7c7483f..4fac97a 100644 --- a/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_Octree.h +++ b/packages/gpu_voxels/src/gpu_voxels/octree/kernels/kernel_Octree.h @@ -146,7 +146,7 @@ void kernel_print(InnerNode* root, InnerNode* stack1, InnerNode* stack2) int32_t stack1Top = -1; int32_t stack2Top = -1; stack1[++stack1Top] = *root; - printf("L%i: ", level_count - 1); + printf("L%lu: ", level_count - 1); printf(" root[][%016llX]\n", root); //printf(" root[][%016llX]\n", (*octree.root).data); From b0120723b8bb73cc58d484624def240c00723c0f Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 24 Jun 2022 20:51:03 +0200 Subject: [PATCH 13/21] increase minimum compute version to 5.2 (GTX 980 etc.) --- packages/gpu_voxels/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/gpu_voxels/CMakeLists.txt b/packages/gpu_voxels/CMakeLists.txt index 8acfad1..3b1690d 100644 --- a/packages/gpu_voxels/CMakeLists.txt +++ b/packages/gpu_voxels/CMakeLists.txt @@ -169,8 +169,10 @@ MESSAGE(STATUS "---------------------------------------------------------------- # Change these lines to increase performance if your GPU's compute capability is higher # GPU-Voxels requires GPU CUDA capabilities >= 2.0 -#SET(ICMAKER_CUDA_COMPUTE_VERSION 20) -SET(ICMAKER_CUDA_COMPUTE_VERSION 35) +# examples: GTX980 is 5.2, Jetson TX1 is 5.3 +# Cuda 11 will print warnings for deprecated architectures like 3.5 and 3.7 +#SET(ICMAKER_CUDA_COMPUTE_VERSION 35) +SET(ICMAKER_CUDA_COMPUTE_VERSION 52) SET(ICMAKER_CUDA_ARCH compute_${ICMAKER_CUDA_COMPUTE_VERSION}) SET(ICMAKER_CUDA_CODE compute_${ICMAKER_CUDA_COMPUTE_VERSION}) From 5443ceef1288ab7904f53187608c32f6898d48f9 Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 24 Jun 2022 21:08:02 +0200 Subject: [PATCH 14/21] update README --- README.md | 25 ++++++++++++++++--------- packages/gpu_voxels/README.md | 31 ++++++++++++++++++++----------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 5e33923..ce5eeab 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,12 @@ If you have questions or experience any problems with the software, please post at https://github.com/fzi-forschungszentrum-informatik/gpu-voxels/issues ## Install dependencies: -This software is tested under 64 Bit Ubuntu Linux 14.04, 16.04 and 18.04. +This software was tested under 64 Bit Ubuntu Linux 16.04, 18.04. and 20.04 Find detailed installation and linking instructions in our Doxygen. **Core:** -- CUDA 7.5, 8.0, 9.x or 10.0 +- CUDA 9.x, 10.x or 11.x - PCL - OpenNI - Boost @@ -51,23 +51,30 @@ Doxygen files can be generated by make doc -## Compiling without C++11 -C++11 is enabled by default. To compile without C++11 mode comment out this at the top of packages/gpu_voxels/CMakeLists.txt: - SET(CMAKE_CXX_STANDARD 11) +## Compiling with C++11 instead of C++14 +C++14 is enabled by default. To compile with C++11 instead change these lines in packages/gpu_voxels/CMakeLists.txt: + + SET(CMAKE_CXX_STANDARD 14) + SET(ICMAKER_CUDA_CXX_STANDARD "--std=c++14") + This is important if you are still using ROS Indigo and need to compile without C++11 support for compatibility reasons. There is a separate indigo branch that only differs in this line to disable C++11 during compilation. ## Known issues -- If the ROS dependency was found, but the GPU-Voxels URDF features are still unabailable, run `source /opt/ros/YOUR_ROS_DISTRO/setup.bash` before running cmake. -- Eigen 3 issues: can be fixed by cloning a more current unstable Eigen version and placing it in CMAKE_PREFIX_PATH +- If the ROS dependency was found but the GPU-Voxels URDF features are still unabailable, run `source /opt/ros/YOUR_ROS_DISTRO/setup.bash` before running cmake. +- Octrees are currently bugged on modern GPU architectures of compute capability 7.2 and newer, leading to excessive/infinite runtime of octree algorithms. + + as a stopgap measure using octree functions on these GPUs now throws an exception until a fix has been found + + to run all tests except for the octree ones run `./bin/test_gpu_voxels_core --run_test=\!octree_selftest:\!octree_collisions` +- Eigen 3 issues on Ubuntu 18.04: can be fixed by cloning a more current unstable Eigen version and placing it in CMAKE_PREFIX_PATH + on Ubuntu 18.04 with CUDA 10.0: "math_functions.hpp not found" + + Eigen 3.3.4 and 3.3.5 with CUDA 9.0, 9.1, 9.2: Error: class "Eigen::half" has no member "x" + + see http://eigen.tuxfamily.org/index.php?title=Main_Page#Download + + follow install_eigen_for_18.04.sh to add a suitable Eigen to CMAKE_PREFIX_PATH or do the following to install a new Eigen system-wide ```bash git clone https://gitlab.com/libeigen/eigen.git sudo cp -r signature_of_eigen3_matrix_library /usr/include/eigen3 sudo cp -r unsupported/ /usr/include/eigen3 sudo cp -r Eigen/ /usr/include/eigen3 ``` - + Eigen 3.3.4 and 3.3.5 with CUDA 9.0, 9.1, 9.2: Error: class "Eigen::half" has no member "x" - + see http://eigen.tuxfamily.org/index.php?title=Main_Page#Download - Cuda 8.0: Code compiled with Cuda 8.0 works fine with older GPU drivers such as 375.66, but there are runtime errors with driver 384.111 and newer ("PTX JIT compilation failed"). Easy fix: use Cuda 10 with a current 410 or newer driver version. Cuda 10 is also available for Ubuntu 14.04 and 16.04. - GLM: There is a known bug in GLM on Ubuntu 16.04 that has to be patched to allow usage of the visualizer. Apply the patch described at https://github.com/g-truc/glm/issues/530 to /usr/include/glm/detail/func_common.inl diff --git a/packages/gpu_voxels/README.md b/packages/gpu_voxels/README.md index 7a58edb..ce5eeab 100644 --- a/packages/gpu_voxels/README.md +++ b/packages/gpu_voxels/README.md @@ -13,12 +13,12 @@ If you have questions or experience any problems with the software, please post at https://github.com/fzi-forschungszentrum-informatik/gpu-voxels/issues ## Install dependencies: -This software is tested under 64 Bit Ubuntu Linux 14.04, 16.04 and 18.04. +This software was tested under 64 Bit Ubuntu Linux 16.04, 18.04. and 20.04 Find detailed installation and linking instructions in our Doxygen. **Core:** -- CUDA 7.5, 8.0, 9.x or 10.0 +- CUDA 9.x, 10.x or 11.x - PCL - OpenNI - Boost @@ -51,21 +51,30 @@ Doxygen files can be generated by make doc -## Compiling without C++11 -C++11 is enabled by default. To compile without C++11 mode comment out this at the top of packages/gpu_voxels/CMakeLists.txt: - SET(CMAKE_CXX_STANDARD 11) -This is important if you are still using ROS Indigo and need to compile without C++11 support for compatibility reasons. There is a separate indigo branch that only differs in this line to disable C++11 during compilation. +## Compiling with C++11 instead of C++14 +C++14 is enabled by default. To compile with C++11 instead change these lines in packages/gpu_voxels/CMakeLists.txt: + + SET(CMAKE_CXX_STANDARD 14) + SET(ICMAKER_CUDA_CXX_STANDARD "--std=c++14") -## Enabling C++11 -C++11 is enabled by default. To compile without C++11 mode comment out this at the top of packages/gpu_voxels/CMakeLists.txt: - SET(CMAKE_CXX_STANDARD 11) +This is important if you are still using ROS Indigo and need to compile without C++11 support for compatibility reasons. There is a separate indigo branch that only differs in this line to disable C++11 during compilation. ## Known issues -- If the ROS dependency was found, but the GPU-Voxels URDF features are still unabailable, run `source /opt/ros/YOUR_ROS_DISTRO/setup.bash` before running cmake. -- Eigen 3 issues: can be fixed by cloning a more current unstable Eigen version and placing it in CMAKE_PREFIX_PATH +- If the ROS dependency was found but the GPU-Voxels URDF features are still unabailable, run `source /opt/ros/YOUR_ROS_DISTRO/setup.bash` before running cmake. +- Octrees are currently bugged on modern GPU architectures of compute capability 7.2 and newer, leading to excessive/infinite runtime of octree algorithms. + + as a stopgap measure using octree functions on these GPUs now throws an exception until a fix has been found + + to run all tests except for the octree ones run `./bin/test_gpu_voxels_core --run_test=\!octree_selftest:\!octree_collisions` +- Eigen 3 issues on Ubuntu 18.04: can be fixed by cloning a more current unstable Eigen version and placing it in CMAKE_PREFIX_PATH + on Ubuntu 18.04 with CUDA 10.0: "math_functions.hpp not found" + Eigen 3.3.4 and 3.3.5 with CUDA 9.0, 9.1, 9.2: Error: class "Eigen::half" has no member "x" + see http://eigen.tuxfamily.org/index.php?title=Main_Page#Download + + follow install_eigen_for_18.04.sh to add a suitable Eigen to CMAKE_PREFIX_PATH or do the following to install a new Eigen system-wide + ```bash + git clone https://gitlab.com/libeigen/eigen.git + sudo cp -r signature_of_eigen3_matrix_library /usr/include/eigen3 + sudo cp -r unsupported/ /usr/include/eigen3 + sudo cp -r Eigen/ /usr/include/eigen3 + ``` - Cuda 8.0: Code compiled with Cuda 8.0 works fine with older GPU drivers such as 375.66, but there are runtime errors with driver 384.111 and newer ("PTX JIT compilation failed"). Easy fix: use Cuda 10 with a current 410 or newer driver version. Cuda 10 is also available for Ubuntu 14.04 and 16.04. - GLM: There is a known bug in GLM on Ubuntu 16.04 that has to be patched to allow usage of the visualizer. Apply the patch described at https://github.com/g-truc/glm/issues/530 to /usr/include/glm/detail/func_common.inl From 54035eea6d799721f32b7981cbc14848a457945e Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 24 Jun 2022 21:09:15 +0200 Subject: [PATCH 15/21] avoid warning about partial overriding in test_fixture --- packages/gpu_voxels/src/gpu_voxels/test/testing_fixtures.hpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/gpu_voxels/src/gpu_voxels/test/testing_fixtures.hpp b/packages/gpu_voxels/src/gpu_voxels/test/testing_fixtures.hpp index ec8cbb2..b2c47aa 100644 --- a/packages/gpu_voxels/src/gpu_voxels/test/testing_fixtures.hpp +++ b/packages/gpu_voxels/src/gpu_voxels/test/testing_fixtures.hpp @@ -42,6 +42,9 @@ struct Visitor : boost::unit_test::test_tree_visitor { + // silence warning about partial overriding + using boost::unit_test::test_tree_visitor::visit; + void visit(boost::unit_test::test_case const& test) { } From 6ff2f02b41d2865f5ef22f4d8f2b63f06ac0e645 Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Fri, 26 Mar 2021 23:38:20 +0100 Subject: [PATCH 16/21] fix icl_core strncpy warnings from GCC 9 --- .../src/icl_core_logging/LogOutputStream.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/icl_core/src/icl_core_logging/LogOutputStream.cpp b/packages/icl_core/src/icl_core_logging/LogOutputStream.cpp index 42770e3..98a2204 100644 --- a/packages/icl_core/src/icl_core_logging/LogOutputStream.cpp +++ b/packages/icl_core/src/icl_core_logging/LogOutputStream.cpp @@ -656,11 +656,16 @@ LogOutputStream::LogMessage::LogMessage(const icl_core::TimeStamp& timestamp, log_level(log_level), line(line) { - std::strncpy(LogMessage::log_stream, log_stream, cMAX_IDENTIFIER_LENGTH+1); - std::strncpy(LogMessage::filename, filename, cMAX_DESCRIPTION_LENGTH+1); - std::strncpy(LogMessage::class_name, class_name, cMAX_IDENTIFIER_LENGTH+1); - std::strncpy(LogMessage::object_name, object_name, cMAX_DESCRIPTION_LENGTH+1); - std::strncpy(LogMessage::function_name, function_name, cMAX_IDENTIFIER_LENGTH+1); + std::strncpy(LogMessage::log_stream, log_stream, cMAX_IDENTIFIER_LENGTH); + LogMessage::log_stream[cMAX_IDENTIFIER_LENGTH] = '\0'; + std::strncpy(LogMessage::filename, filename, cMAX_DESCRIPTION_LENGTH); + LogMessage::filename[cMAX_DESCRIPTION_LENGTH] = '\0'; + std::strncpy(LogMessage::class_name, class_name, cMAX_IDENTIFIER_LENGTH); + LogMessage::class_name[cMAX_IDENTIFIER_LENGTH] = '\0'; + std::strncpy(LogMessage::object_name, object_name, cMAX_DESCRIPTION_LENGTH); + LogMessage::object_name[cMAX_DESCRIPTION_LENGTH] = '\0'; + std::strncpy(LogMessage::function_name, function_name, cMAX_IDENTIFIER_LENGTH); + LogMessage::function_name[cMAX_IDENTIFIER_LENGTH] = '\0'; std::strncpy(LogMessage::message_text, message_text, cDEFAULT_LOG_SIZE+1); } From fc92c0852720661836eca5e0c4d2d29b57c880ec Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Tue, 28 Jun 2022 14:56:00 +0200 Subject: [PATCH 17/21] suppress memset warning --- packages/gpu_voxels/src/gpu_voxels/helpers/MetaPointCloud.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gpu_voxels/src/gpu_voxels/helpers/MetaPointCloud.cu b/packages/gpu_voxels/src/gpu_voxels/helpers/MetaPointCloud.cu index 6d777cc..19d36d5 100644 --- a/packages/gpu_voxels/src/gpu_voxels/helpers/MetaPointCloud.cu +++ b/packages/gpu_voxels/src/gpu_voxels/helpers/MetaPointCloud.cu @@ -48,7 +48,7 @@ void MetaPointCloud::init(const std::vector &_point_cloud_sizes) // Memory is only allocated once with the accumulated cloud size: m_point_clouds_local->accumulated_cloud_size = m_accumulated_pointcloud_size; m_accumulated_cloud = new Vector3f[m_accumulated_pointcloud_size]; - memset(m_accumulated_cloud, 0, sizeof(Vector3f)*m_accumulated_pointcloud_size); + memset((float*)m_accumulated_cloud, 0, sizeof(Vector3f)*m_accumulated_pointcloud_size); // float* cast suppresses memset warning // The pointers in clouds_base_addresses point into the accumulated memory: Vector3f* tmp_addr = m_accumulated_cloud; From d106f1f278ee4b5227f034582f4dfb9785f9a48a Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Tue, 28 Jun 2022 14:56:40 +0200 Subject: [PATCH 18/21] set CMake policies --- CMakeLists.txt | 4 +++- icmaker/IcMaker.cmake | 4 ++++ packages/gpu_voxels/CMakeLists.txt | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9f3dec..ed179d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.2) + +project(IcWorkspace) SET(ICMAKER_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/icmaker) diff --git a/icmaker/IcMaker.cmake b/icmaker/IcMaker.cmake index d373c8e..9dde5a5 100644 --- a/icmaker/IcMaker.cmake +++ b/icmaker/IcMaker.cmake @@ -91,6 +91,10 @@ IF(POLICY CMP0015) CMAKE_POLICY(SET CMP0015 NEW) ENDIF() +cmake_policy(SET CMP0017 NEW) # prefer system CMake modules +cmake_policy(SET CMP0072 OLD) # use old FindOpenGL behavior +cmake_policy(SET CMP0074 OLD) # use env variables for find_package _ROOT discovery + # ---------------------------------------------------------------------------- # Current version number: # ---------------------------------------------------------------------------- diff --git a/packages/gpu_voxels/CMakeLists.txt b/packages/gpu_voxels/CMakeLists.txt index 3b1690d..6f9314a 100644 --- a/packages/gpu_voxels/CMakeLists.txt +++ b/packages/gpu_voxels/CMakeLists.txt @@ -2,6 +2,8 @@ # --- Global options --- +cmake_policy(SET CMP0074 OLD) # use env variables for find_package _ROOT discovery + ## support Jetson mobile GPUs SET(JETSON_SUPPORT OFF) From 623176e981ac3d7904d11bcaae0f75bfef0af559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20J=C3=BClg?= Date: Sat, 30 Mar 2019 15:38:16 +0100 Subject: [PATCH 19/21] Don't compile some kinect examples without openni_grabber.h --- .../gpu_voxels/src/examples/CMakeLists.txt | 116 +++++++++--------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/packages/gpu_voxels/src/examples/CMakeLists.txt b/packages/gpu_voxels/src/examples/CMakeLists.txt index 7f3f11a..0d6d6e8 100644 --- a/packages/gpu_voxels/src/examples/CMakeLists.txt +++ b/packages/gpu_voxels/src/examples/CMakeLists.txt @@ -128,36 +128,38 @@ ICMAKER_EXTERNAL_DEPENDENCIES( ICMAKER_BUILD_PROGRAM() #------------- Example Program for the usage of gpu_voxels ------------ -ICMAKER_SET("swept_volume_vs_environment" IDE_FOLDER ${EXAMPLES_IDE_FOLDER}) +IF(OPENNI_FOUND AND PCL_OPENNI_GRABBER_FILE_FOUND) + ICMAKER_SET("swept_volume_vs_environment" IDE_FOLDER ${EXAMPLES_IDE_FOLDER}) -ICMAKER_ADD_HEADERS( - ) + ICMAKER_ADD_HEADERS( + ) -ICMAKER_ADD_SOURCES( - SweptVolumeVsEnvironment.cpp - ) + ICMAKER_ADD_SOURCES( + SweptVolumeVsEnvironment.cpp + ) -ICMAKER_ADD_CUDA_FILES( - ) + ICMAKER_ADD_CUDA_FILES( + ) -ICMAKER_LOCAL_CPPDEFINES(-DGPU_VOXELS_EXPORT_SYMBOLS -Wno-unknown-pragmas) -ICMAKER_GLOBAL_CPPDEFINES(-D_IC_BUILDER_GPU_VOXELS_EXAMPLES_SV_VS_ENV_) -ICMAKER_INCLUDE_DIRECTORIES(${GPU_VOXELS_INCLUDE_DIRS}) + ICMAKER_LOCAL_CPPDEFINES(-DGPU_VOXELS_EXPORT_SYMBOLS -Wno-unknown-pragmas) + ICMAKER_GLOBAL_CPPDEFINES(-D_IC_BUILDER_GPU_VOXELS_EXAMPLES_SV_VS_ENV_) + ICMAKER_INCLUDE_DIRECTORIES(${GPU_VOXELS_INCLUDE_DIRS}) -ICMAKER_INTERNAL_DEPENDENCIES( - icl_core - icl_core_config - icl_core_logging - gpu_voxels - ) + ICMAKER_INTERNAL_DEPENDENCIES( + icl_core + icl_core_config + icl_core_logging + gpu_voxels + ) -ICMAKER_EXTERNAL_DEPENDENCIES( - CUDA - OpenNI - PCL - ) + ICMAKER_EXTERNAL_DEPENDENCIES( + CUDA + OpenNI + PCL + ) -ICMAKER_BUILD_PROGRAM() + ICMAKER_BUILD_PROGRAM() +ENDIF(OPENNI_FOUND AND PCL_OPENNI_GRABBER_FILE_FOUND) #------------- Example Program sandbox ------------ ICMAKER_SET("sandbox" IDE_FOLDER ${EXAMPLES_IDE_FOLDER}) @@ -544,39 +546,41 @@ ICMAKER_EXTERNAL_DEPENDENCIES( ICMAKER_BUILD_PROGRAM() #------------- Example Program distance_kinect_demo ------------ -ICMAKER_SET("distance_kinect_demo" IDE_FOLDER ${EXAMPLES_IDE_FOLDER}) -add_definitions(-DIC_PERFORMANCE_MONITOR) - -ICMAKER_ADD_HEADERS( - ) - -ICMAKER_ADD_SOURCES( - DistanceKinectDemo.cpp - ) - -ICMAKER_ADD_CUDA_FILES( - ) - -ICMAKER_LOCAL_CPPDEFINES(-DGPU_VOXELS_EXPORT_SYMBOLS -Wno-unknown-pragmas) -ICMAKER_GLOBAL_CPPDEFINES(-D_IC_BUILDER_GPU_VOXELS_EXAMPLES_DISTANCE_KINECT_DEMO_) -ICMAKER_INCLUDE_DIRECTORIES(${GPU_VOXELS_INCLUDE_DIRS}) - -ICMAKER_INTERNAL_DEPENDENCIES( - gpu_voxels - ) - -ICMAKER_EXTERNAL_DEPENDENCIES( - icl_core - icl_core_config - icl_core_logging - icl_core_performance_monitor - Boost_SYSTEM - CUDA - OpenNI - PCL - ) - -ICMAKER_BUILD_PROGRAM() +IF(OPENNI_FOUND AND PCL_OPENNI_GRABBER_FILE_FOUND) + ICMAKER_SET("distance_kinect_demo" IDE_FOLDER ${EXAMPLES_IDE_FOLDER}) + add_definitions(-DIC_PERFORMANCE_MONITOR) + + ICMAKER_ADD_HEADERS( + ) + + ICMAKER_ADD_SOURCES( + DistanceKinectDemo.cpp + ) + + ICMAKER_ADD_CUDA_FILES( + ) + + ICMAKER_LOCAL_CPPDEFINES(-DGPU_VOXELS_EXPORT_SYMBOLS -Wno-unknown-pragmas) + ICMAKER_GLOBAL_CPPDEFINES(-D_IC_BUILDER_GPU_VOXELS_EXAMPLES_DISTANCE_KINECT_DEMO_) + ICMAKER_INCLUDE_DIRECTORIES(${GPU_VOXELS_INCLUDE_DIRS}) + + ICMAKER_INTERNAL_DEPENDENCIES( + gpu_voxels + ) + + ICMAKER_EXTERNAL_DEPENDENCIES( + icl_core + icl_core_config + icl_core_logging + icl_core_performance_monitor + Boost_SYSTEM + CUDA + OpenNI + PCL + ) + + ICMAKER_BUILD_PROGRAM() +ENDIF(OPENNI_FOUND AND PCL_OPENNI_GRABBER_FILE_FOUND) #------------- Example Program for the two primitiveArray APIs ------------ ICMAKER_SET("primitive_array_test" IDE_FOLDER ${EXAMPLES_IDE_FOLDER}) From 03604e8fc40d58597209ae98972403fd94310fed Mon Sep 17 00:00:00 2001 From: Christian Juelg Date: Tue, 28 Jun 2022 15:34:48 +0200 Subject: [PATCH 20/21] remove warning on catching polymorphic type tf::TransformException by value --- packages/gpu_voxels/src/gpu_voxels/helpers/tfHelper.cpp | 2 +- .../gpu_voxels/src/gpu_voxels/octree/test/NTreeProvider.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/gpu_voxels/src/gpu_voxels/helpers/tfHelper.cpp b/packages/gpu_voxels/src/gpu_voxels/helpers/tfHelper.cpp index b0ef922..d412fb3 100644 --- a/packages/gpu_voxels/src/gpu_voxels/helpers/tfHelper.cpp +++ b/packages/gpu_voxels/src/gpu_voxels/helpers/tfHelper.cpp @@ -59,7 +59,7 @@ namespace gpu_voxels { m_tf_li.lookupTransform(parent, child, ros::Time(0), tf_transform); } - catch (tf::TransformException ex) + catch (tf::TransformException& ex) { ROS_ERROR("tfHelper::lookup error: %s",ex.what()); return false; diff --git a/packages/gpu_voxels/src/gpu_voxels/octree/test/NTreeProvider.cpp b/packages/gpu_voxels/src/gpu_voxels/octree/test/NTreeProvider.cpp index f86b3c8..fc0e9d5 100644 --- a/packages/gpu_voxels/src/gpu_voxels/octree/test/NTreeProvider.cpp +++ b/packages/gpu_voxels/src/gpu_voxels/octree/test/NTreeProvider.cpp @@ -511,7 +511,7 @@ void NTreeProvider::ros_point_cloud(const sensor_msgs::PointCloud2::ConstPtr& ms try { m_tf_listener->lookupTransform(to_frame, from_frame, ros::Time(0), transform); - } catch (tf::TransformException ex) + } catch (tf::TransformException& ex) { ROS_ERROR("%s", ex.what()); } From 9381cf137f5bc48bf083807522f14aaadb05122c Mon Sep 17 00:00:00 2001 From: Florian Fervers Date: Tue, 10 Dec 2019 13:31:31 +0100 Subject: [PATCH 21/21] NOTE: Disable octree algorithms if compute capability >= 7.x, throws runtime_error Octrees are currently broken on these devices in a way that results in endless runtimes. Better to fail fast than to have people guessing. --- .../gpu_voxels/src/gpu_voxels/octree/NTree.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp b/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp index f68e6fd..67ee325 100644 --- a/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp +++ b/packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp @@ -303,6 +303,22 @@ void getFreeBoxResetData(Environment::NodeProb::NodeData::BasicData& basic_data) basic_data = Environment::NodeProb::NodeData::BasicData(STATUS_OCCUPANCY_MASK, nf_UPDATE_SUBTREE, 0); } +void check_octree_compatibility() +{ + int device_count = 0; + cuGetNrOfDevices(&device_count); + for (int i = 0; i < device_count; ++i) + { + cudaDeviceProp properties; + HANDLE_CUDA_ERROR(cudaGetDeviceProperties(&properties, i)); + if (properties.major >= 7) + { + LOGGING_ERROR(CudaLog, "CRITICAL ERROR: Octrees have been temporarily disabled because of critical errors on Turing GPUs (compute capability 7.x+)! A proper fix for octrees is under work.\n"); + throw std::runtime_error("CRITICAL ERROR: Octrees have been temporarily disabled because of critical errors on Turing GPUs (compute capability 7.x+)! A proper fix for octrees is under work."); + } + } +} + /* * ######################################################## */ @@ -312,6 +328,8 @@ NTree::NTree(uint32_t numBlo uint32_t numThreadsPerBlock, uint32_t resolution) { + check_octree_compatibility(); + this->numBlocks = numBlocks; this->numThreadsPerBlock = numThreadsPerBlock; this->allocInnerNodes = 0;