From 374ef292d116a7ac16cd2d6e0ea8cff5ec64a7b0 Mon Sep 17 00:00:00 2001 From: Shrijit Singh Date: Fri, 15 May 2020 07:44:45 +0530 Subject: [PATCH] Add support for CUDA --- .ci/azure-pipelines/azure-pipelines.yaml | 3 +++ .ci/azure-pipelines/build/ubuntu.yaml | 8 ++++++- .dev/docker/env/Dockerfile | 27 ++++++++++++------------ 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/.ci/azure-pipelines/azure-pipelines.yaml b/.ci/azure-pipelines/azure-pipelines.yaml index 10231ff6f4d..295192e6e3d 100644 --- a/.ci/azure-pipelines/azure-pipelines.yaml +++ b/.ci/azure-pipelines/azure-pipelines.yaml @@ -31,11 +31,13 @@ stages: CONTAINER: env1604 CC: gcc CXX: g++ + BUILD_GPU: OFF CMAKE_ARGS: '-DPCL_WARNINGS_ARE_ERRORS=ON' 20.04 GCC: CONTAINER: env2004 CC: gcc CXX: g++ + BUILD_GPU: OFF CMAKE_ARGS: '' container: $[ variables['CONTAINER'] ] timeoutInMinutes: 0 @@ -83,6 +85,7 @@ stages: CONTAINER: env1804 CC: clang CXX: clang++ + BUILD_GPU: ON CMAKE_ARGS: '' container: $[ variables['CONTAINER'] ] timeoutInMinutes: 0 diff --git a/.ci/azure-pipelines/build/ubuntu.yaml b/.ci/azure-pipelines/build/ubuntu.yaml index c87b13d0604..2e59e391878 100644 --- a/.ci/azure-pipelines/build/ubuntu.yaml +++ b/.ci/azure-pipelines/build/ubuntu.yaml @@ -18,7 +18,13 @@ steps: -DBUILD_apps_cloud_composer=ON \ -DBUILD_apps_in_hand_scanner=ON \ -DBUILD_apps_modeler=ON \ - -DBUILD_apps_point_cloud_editor=ON + -DBUILD_apps_point_cloud_editor=ON \ + -DBUILD_CUDA=$BUILD_GPU \ + -DBUILD_GPU=$BUILD_GPU \ + -DBUILD_cuda_io=$BUILD_GPU \ + -DBUILD_gpu_tracking=$BUILD_GPU \ + -DBUILD_gpu_surface=$BUILD_GPU \ + -DBUILD_gpu_people=$BUILD_GPU # Temporary fix to ensure no tests are skipped cmake $(Build.SourcesDirectory) displayName: 'CMake Configuration' diff --git a/.dev/docker/env/Dockerfile b/.dev/docker/env/Dockerfile index 08e1bef4aca..5774afa68b0 100644 --- a/.dev/docker/env/Dockerfile +++ b/.dev/docker/env/Dockerfile @@ -4,11 +4,15 @@ ARG USE_CUDA ARG CUDA_VERSION="9.2" ARG UBUNTU_DISTRO="16.04" +# Known conflicts: +# * 9.1 is an issue with 16.04 for Eigen ARG BASE_CUDA_IMAGE=${USE_CUDA:+"nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_DISTRO}"} ARG BASE_IMAGE=${BASE_CUDA_IMAGE:-"ubuntu:${UBUNTU_DISTRO}"} FROM ${BASE_IMAGE} +ARG USE_CUDA + ARG VTK_VERSION=6 ENV DEBIAN_FRONTEND=noninteractive @@ -41,20 +45,17 @@ RUN apt-get update \ # Eigen patch (https://eigen.tuxfamily.org/bz/show_bug.cgi?id=1462) to fix issue metioned # in https://github.com/PointCloudLibrary/pcl/issues/3729 is available in Eigen 3.3.7 # Not needed from 20.04 since it is the default version from apt -RUN if [ `pkg-config --modversion eigen3 | cut -d. -f3` -lt 7 ]; then \ - wget -qO- https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz | tar xz \ - && apt install -y libblas-dev \ - && cd eigen-3.3.7 \ - && mkdir build \ - && cd build \ - && cmake .. \ - && make install \ - && cd ../.. \ - && rm -rf eigen-3.3.7/ \ - && rm -f eigen-3.3.7.tar.gz ; \ - fi +RUN wget -qO- https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz | tar xz \ + && apt install -y libblas-dev \ + && cd eigen-3.3.7 \ + && mkdir build \ + && cd build \ + && cmake .. \ + && make install \ + && cd ../.. \ + && rm -rf eigen-3.3.7/ \ + && rm -f eigen-3.3.7.tar.gz -# CUDA 9.2 supports GCC 7 RUN if [ `gcc -dumpversion | cut -d. -f1` -lt 7 ]; then add-apt-repository ppa:ubuntu-toolchain-r/test \ && apt update \ && apt install g++-7 -y \