Skip to content

Dev remove cuda tex refs v2 #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 52 additions & 121 deletions COPYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,155 +2,86 @@

AliceVision is licensed under the [MPL2 license](LICENSE-MPL2.md).

[CMPMVS](http://people.ciirc.cvut.cz/~pajdla/) has been the first step to build the AliceVision MVS pipeline and was CTU proprietary solution before being part of AliceVision.
[openMVG](https://github.com/openMVG/openMVG) has been the first step to build the AliceVision SfM pipeline and was released under [MPLv2](LICENSE-MPL2.md).
[CMPMVS](http://people.ciirc.cvut.cz/~pajdla/) has been the first step to build the AliceVision MVS pipeline and was CTU proprietary solution before being part of AliceVision.
[openMVG](https://github.com/openMVG/openMVG) has been the first step to build the AliceVision SfM pipeline and was released under [MPLv2](LICENSE-MPL2.md).
[libmv](https://github.com/libmv/libmv) has been an important source of inspiration for the design and part of the code of the "multiview" and "robustEstimation"
modules are based on the libmv code released under MIT, see [LICENSE-MIT-libmv.md](LICENSE-MIT-libmv.md).


It also contains one file with different license:

* __kvld__
[src/aliceVision/matching/kvld](src/aliceVision/matching/kvld)
Copyright (C) 2011-12 Zhe Liu and Pierre Moulon.
* __kvld__
[src/aliceVision/matching/kvld](src/aliceVision/matching/kvld)
Copyright (C) 2011-12 Zhe Liu and Pierre Moulon.
This file was first released under BSD-2-Clause license, see [LICENSE-BSD-2-Clause](http://opensource.org/licenses/BSD-2-Clause).


## Third parties licenses

This program is based on works distributed under the terms of another license(s) and other copyright notice(s).

* __Alembic__ (optional)
[http://www.alembic.io](http://www.alembic.io)
Copyright 2009-2015 Lucasfilm Entertainment Company Ltd. or Lucasfilm Ltd.
Copyright 2009-2015 Sony Pictures Imageworks Inc.
* __Alembic__ (optional)
[http://www.alembic.io](http://www.alembic.io)
Copyright 2009-2015 Lucasfilm Entertainment Company Ltd. or Lucasfilm Ltd.
Copyright 2009-2015 Sony Pictures Imageworks Inc.
Distributed under the [BSD-3-Clause](https://github.com/alembic/alembic/blob/master/LICENSE.txt).

* __Boost__
[http://www.boost.org](http://www.boost.org)
Distributed under the [Boost Software License](http://www.boost.org/users/license.html).

* __CCTag__ (optional)
[https://github.com/alicevision/CCTag](https://github.com/alicevision/CCTag)
Copyright 2016, Simula Research Laboratory
Distributed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).
* __ceres-solver__
[http://ceres-solver.org](http://ceres-solver.org)
Copyright 2015 Google Inc. All rights reserved.
Licensed under the [New BSD licence](http://ceres-solver.org/license.html).

* __Ceres-Solver__
[http://ceres-solver.org](http://ceres-solver.org)
Copyright 2015 Google Inc. All rights reserved.
Distributed under the [New BSD licence](http://ceres-solver.org/license.html).

* __Clp__
Copyright (C) 2002, 2003 International Business Machines Corporation
and others. All Rights Reserved.
Distributed under the terms of the Eclipse Public License (EPL).
* __Boost__
[http://www.boost.org](http://www.boost.org)
Distributed under the [Boost Software License](http://www.boost.org/users/license.html).

* __CoinUtils__
Copyright (C) 1987, 2009 International Business Machines Corporation
and others. All Rights Reserved.
Distributed under the terms of the Eclipse Public License (EPL).
* __OpenImageIO__
[https://openimageio.org](https://openimageio.org)
Copyright 2008-2016 Larry Gritz et al.
Distributed under the [BSD-3-Clause](https://github.com/OpenImageIO/oiio/blob/master/LICENSE).

* __CUDA__ (required for the depth map computation)
See [License](https://docs.nvidia.com/cuda/eula/index.html#license-driver).
* __OpenCV__ (optional)
[https://opencv.org](https://opencv.org)
Copyright (C) 2000-2016, Intel Corporation, all rights reserved.
Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved.
Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved.
Copyright (C) 2015-2016, Itseez Inc., all rights reserved.
Distributed under the [BSD-3-Clause](https://github.com/OpenImageIO/oiio/blob/master/LICENSE).

* __cxsparse__ (optional)
Copyright (c) 2006-2012, Timothy A. Davis.
* __cxsparse__ (optional)
Copyright (c) 2006-2012, Timothy A. Davis.
Distributed under the [GNU LGPL license](http://opensource.org/licenses/lgpl-license).

* __Eigen__
[http://eigen.tuxfamily.org](http://eigen.tuxfamily.org)
Copyright (c) Eigen authors.
Distributed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).
Compiled with EIGEN_MPL2_ONLY to ensure MPL2 compatible code.

* __Flann__
[https://www.cs.ubc.ca/research/flann](https://www.cs.ubc.ca/research/flann)
Copyright (c) 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
Copyright (c) 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
Distributed under the [BSD License](http://www.opensource.org/licenses/bsd-license.php).

* __Geogram__
[http://alice.loria.fr/software/geogram/doc/html/index.html](http://alice.loria.fr/software/geogram/doc/html/index.html)
Copyright (c) 2012-2014 Bruno Levy. All rights reserved.
Distributed under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)

* __Histogram__
Copyright (c) Jansson Consulting & Pierre Moulon.
Distributed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).

* __HtmlDoc__
Copyright (c) Pierre Moulon.
* __eigen__
Copyright (c) Eigen authors.
Distributed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).
Compiled with EIGEN_MPL2_ONLY to ensure MPL2 compatible code.

* __Lemon__
[http://lemon.cs.elte.hu/trac/lemon](http://lemon.cs.elte.hu/trac/lemon)
Copyright (c) Lemon authors.
Distributed under the [Boost License 1.0](http://www.boost.org/LICENSE_1_0.txt).

* __MeshSDFilter__
[https://github.com/bldeng/MeshSDFilter](https://github.com/bldeng/MeshSDFilter)
Copyright (c) 2017, Bailin Deng. All rights reserved.
Distributed under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)

* __Nanoflann__
[https://github.com/jlblancoc/nanoflann](https://github.com/jlblancoc/nanoflann)
Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
Copyright 2011 Jose L. Blanco (joseluisblancoc@gmail.com). All rights reserved.
* __flann__
Copyright (c) 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved.
Copyright (c) 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved.
Distributed under the [BSD License](http://www.opensource.org/licenses/bsd-license.php).

* __OpenCV__ (optional)
[https://opencv.org](https://opencv.org)
Copyright (C) 2000-2016, Intel Corporation, all rights reserved.
Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved.
Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved.
Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved.
Copyright (C) 2015-2016, Itseez Inc., all rights reserved.
Distributed under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)

* __OpenEXR__ (required by OpenImageIO and used in the pipeline)
[http://www.openexr.com](http://www.openexr.com)
Copyright (c) 2002, Industrial Light & Magic, a division of Lucas Digital Ltd. LLC
Distributed under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)

* __OpenGV__ (optional)
[https://laurentkneip.github.io/opengv](https://laurentkneip.github.io/opengv)
Copyright (c) 2013 Laurent Kneip, The Australian National University ANU. All rights reserved
Distributed under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)

* __OpenImageIO__
[https://openimageio.org](https://openimageio.org)
Copyright 2008-2016 Larry Gritz et al.
Distributed under the [BSD-3-Clause](https://github.com/OpenImageIO/oiio/blob/master/LICENSE).
* __histogram__
Copyright (c) Jansson Consulting & Pierre Moulon.
Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).

* __OpenMesh__ (required by MeshSDFilter)
[http://openmesh.org](http://openmesh.org)
Copyright (c) 2001-2015, RWTH-Aachen University.
Department of Computer Graphics and Multimedia. All rights reserved.
Distributed under the [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
* __htmlDoc__
Copyright (c) Pierre Moulon.
Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).

* __Osi__
Copyright (C) 2000 International Business Machines Corporation
and others. All Rights Reserved.
Distributed under the terms of the Eclipse Public License (EPL).
* __lemon__
Copyright (c) Lemon authors.
Licensed under the [Boost License 1.0](http://www.boost.org/LICENSE_1_0.txt).

* __PopSift__ (optional)
[https://github.com/alicevision/popsift](https://github.com/alicevision/popsift)
Copyright 2016, Simula Research Laboratory
Distributed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).
* __vectorGraphics__
Copyright (c) Pierre Moulon
Licensed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).

* __vectorGraphics__
Copyright (c) Pierre Moulon
Distributed under the [MPL2 license](http://opensource.org/licenses/MPL-2.0).

* __vlfeat__
[http://www.vlfeat.org](http://www.vlfeat.org)
Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. All rights reserved.
Distributed under the [BSD License](http://www.opensource.org/licenses/bsd-license.php).
* __zlib__ (optional)
Copyright (C) 1995-2005 Jean-loup Gailly
Licensed under the [zlib license](http://opensource.org/licenses/Zlib).

* __zlib__ (optional)
[https://zlib.net](https://zlib.net)
Copyright (C) 1995-2005 Jean-loup Gailly
Distributed under the [zlib license](http://opensource.org/licenses/Zlib).

50 changes: 36 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,9 @@ endif()
# ==============================================================================
# CUDA
# ==============================================================================
option(ALICEVISION_USE_NVTX_PROFILING "Use CUDA NVTX for profiling." OFF)
option(ALICEVISION_NVCC_WARNINGS "Switch on several additional warnings for CUDA nvcc." OFF)

set(ALICEVISION_HAVE_CUDA 0)

if(NOT ALICEVISION_USE_CUDA STREQUAL "OFF")
Expand Down Expand Up @@ -692,20 +695,28 @@ if(ALICEVISION_HAVE_CUDA)

set(CUDA_NVCC_FLAGS_DEBUG "${CUDA_NVCC_FLAGS_DEBUG};-G;-g")
set(CUDA_NVCC_FLAGS_RELEASE "${CUDA_NVCC_FLAGS_RELEASE};-O3")
if(CUDA_VERSION VERSION_LESS 9.0) # cuda < 9.0
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_20,code=sm_20")
if(NOT CUDA_VERSION_MAJOR LESS 9)
set(ALICEVISION_CUDA_CC_LIST_BASIC 30 35 50 52 60 61 62)
elseif(CUDA_VERSION_MAJOR GREATER 7)
set(ALICEVISION_CUDA_CC_LIST_BASIC 20 30 35 50 52 60 61 62)
else()
set(ALICEVISION_CUDA_CC_LIST_BASIC 20 30 35 50 52 )
endif()
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_30,code=sm_30")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_35,code=sm_35")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_50,code=sm_50")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_52,code=sm_52")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode=arch=compute_52,code=compute_52")
set(ALICEVISION_CUDA_CC_LIST ${ALICEVISION_CUDA_CC_LIST_BASIC}
CACHE STRING "CUDA CC versions to compile")

# Add all requested CUDA CCs to the command line for offline compilation
list(SORT ALICEVISION_CUDA_CC_LIST)
foreach(ALICEVISION_CC_VERSION ${ALICEVISION_CUDA_CC_LIST})
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_${ALICEVISION_CC_VERSION},code=sm_${ALICEVISION_CC_VERSION}")
endforeach()

# Use the highest request CUDA CC for CUDA JIT compilation
list(LENGTH ALICEVISION_CUDA_CC_LIST ALICEVISION_CC_LIST_LEN)
MATH(EXPR ALICEVISION_CC_LIST_LEN "${ALICEVISION_CC_LIST_LEN}-1")
list(GET ALICEVISION_CUDA_CC_LIST ${ALICEVISION_CC_LIST_LEN} ALICEVISION_CUDA_CC_LIST_LAST)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode;arch=compute_${ALICEVISION_CUDA_CC_LIST_LAST},code=compute_${ALICEVISION_CUDA_CC_LIST_LAST}")

if(NOT CUDA_VERSION VERSION_LESS 8.0) # cuda >= 8.0
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode=arch=compute_60,code=sm_60")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode=arch=compute_61,code=sm_61")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-gencode=arch=compute_62,code=sm_62")
endif()

if(NOT CUDA_VERSION VERSION_LESS 7.0) # cuda >= 7.0
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-std=c++11")
Expand All @@ -722,13 +733,24 @@ if(ALICEVISION_HAVE_CUDA)
if(UNIX)
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-D_FORCE_INLINES")
endif()
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xptxas;--warn-on-local-memory-usage")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS};-Xptxas;--warn-on-spills")
if(ALICEVISION_NVCC_WARNINGS)
set(CUDA_NVCC_FLAGS_RELEASE "${CUDA_NVCC_FLAGS_RELEASE};-Xptxas;-warn-lmem-usage")
set(CUDA_NVCC_FLAGS_RELEASE "${CUDA_NVCC_FLAGS_RELEASE};-Xptxas;-warn-spills")
set(CUDA_NVCC_FLAGS_RELEASE "${CUDA_NVCC_FLAGS_RELEASE};-Xptxas;--warn-on-local-memory-usage")
set(CUDA_NVCC_FLAGS_RELEASE "${CUDA_NVCC_FLAGS_RELEASE};-Xptxas;--warn-on-spills")
endif()
endif()

# library required for CUDA dynamic parallelism, forgotten by CMake 3.4
cuda_find_library_local_first(CUDA_CUDADEVRT_LIBRARY cudadevrt "\"cudadevrt\" library")

# If user activates NVTX profiling, add library and flags
if(ALICEVISION_USE_NVTX_PROFILING)
message(STATUS "PROFILING CPU/GPU CODE: NVTX is in use")
cuda_find_library_local_first(CUDA_NVTX_LIBRARY nvToolsExt "NVTX library")
add_definitions(-DUSE_NVTX)
include_directories(${CUDA_INCLUDE_DIRS})
endif()
endif()

# ==============================================================================
Expand Down
43 changes: 15 additions & 28 deletions src/aliceVision/depthMap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,23 @@ set(depthMap_files_sources
SemiGlobalMatchingVolume.cpp
)

# Cuda Headers
set(depthMap_cuda_files_headers
# Headers
cuda/deviceCommon/device_patch_es_glob.hpp
# deviceCommon
cuda/deviceCommon/device_color.cu
cuda/deviceCommon/device_eig33.cu
cuda/deviceCommon/device_global.cu
cuda/deviceCommon/device_matrix.cu
cuda/deviceCommon/device_patch_es.cu
cuda/deviceCommon/device_simStat.cu
# planeSweeping
cuda/planeSweeping/device_code.cu
cuda/planeSweeping/device_code_refine.cu
cuda/planeSweeping/device_code_volume.cu
cuda/planeSweeping/device_code_fuse.cu
cuda/planeSweeping/device_utils.cu
)

set_source_files_properties(${depthMap_cuda_files_headers}
PROPERTIES HEADER_FILE_ONLY true
)

# Cuda Sources
set(depthMap_cuda_files_sources
cuda/commonStructures.hpp
cuda/PlaneSweepingCuda.cpp
cuda/PlaneSweepingCuda.hpp
cuda/planeSweeping/plane_sweeping_cuda.cu
${depthMap_cuda_files_headers}
cuda/commonStructures.cpp cuda/commonStructures.hpp
cuda/PlaneSweepingCuda.cpp cuda/PlaneSweepingCuda.hpp
cuda/planeSweeping/plane_sweeping_cuda.cu cuda/planeSweeping/plane_sweeping_cuda.hpp
cuda/planeSweeping/cuda_global_data.cu cuda/planeSweeping/cuda_global_data.cuh
cuda/planeSweeping/device_code_refine.cu cuda/planeSweeping/device_code_refine.cuh
cuda/planeSweeping/device_utils.cuh
cuda/planeSweeping/device_code.cu cuda/planeSweeping/device_code.cuh
cuda/planeSweeping/device_code_volume.cu cuda/planeSweeping/device_code_volume.cuh
cuda/planeSweeping/device_code_fuse.cu cuda/planeSweeping/device_code_fuse.cuh
cuda/deviceCommon/device_patch_es.cuh
cuda/deviceCommon/device_color.cu cuda/deviceCommon/device_color.cuh
cuda/deviceCommon/device_eig33.cu cuda/deviceCommon/device_eig33.cuh
cuda/deviceCommon/device_global.cu cuda/deviceCommon/device_global.cuh
cuda/deviceCommon/device_matrix.cu cuda/deviceCommon/device_matrix.cuh
cuda/deviceCommon/device_simStat.cu cuda/deviceCommon/device_simStat.cuh
)

source_group("aliceVision_depthMap_cuda" FILES ${depthMap_cuda_files_sources})
Expand Down
Loading