Skip to content

Commit

Permalink
Upgrade stdgpu to latest version (#7083)
Browse files Browse the repository at this point in the history
Update CUDA requirements to > 11.5
  • Loading branch information
stotko authored Dec 6, 2024
1 parent 6e910d9 commit b7e5f16
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 27 deletions.
5 changes: 2 additions & 3 deletions 3rdparty/stdgpu/stdgpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ include(ExternalProject)
ExternalProject_Add(
ext_stdgpu
PREFIX stdgpu
# Jun 20 2024. Later versions need CUDA 11.5 and an API update (stdgpu::pair)
URL https://github.com/stotko/stdgpu/archive/1b6a3319f1fbf180166e1bbc1d75f69ab622a0a0.tar.gz
URL_HASH SHA256=faa3bf9cbe49ef9cc09e2e07e60d10bbf3b896edb6089c920bebe0f850fd95e4
URL https://github.com/stotko/stdgpu/archive/2588168d226bd17229dbf58d821549580791089d.tar.gz
URL_HASH SHA256=86e50789bbe21c57f64358c6acbd4481d56c1e45ce9ba1fb5c5c8482c3973215
DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/stdgpu"
UPDATE_COMMAND ""
CMAKE_ARGS
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ if(BUILD_CUDA_MODULE)
endif()
enable_language(CUDA)
set(CMAKE_CUDA_STANDARD 17)
if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "10.1")
message(FATAL_ERROR "CUDA 10.0 and older are not supported. Please upgrade to CUDA 10.1 or newer.")
if (CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.5")
message(FATAL_ERROR "CUDA 11.4 and older are not supported. Please upgrade to CUDA 11.5 or newer.")
endif()
endif()

Expand Down
20 changes: 3 additions & 17 deletions cmake/Open3DShowAndAbortOnWarning.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,14 @@ function(open3d_show_and_abort_on_warning target)
string(REPLACE ";" "," DISABLE_NVCC_WARNINGS "${DISABLE_NVCC_WARNINGS}")

set(CUDA_FLAGS "--Werror cross-execution-space-call,deprecated-declarations")
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "10.2")
string(APPEND CUDA_FLAGS " --Werror all-warnings")
endif()
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.0")
string(APPEND CUDA_FLAGS " --Werror ext-lambda-captures-this")
endif()
string(APPEND CUDA_FLAGS " --Werror all-warnings")
string(APPEND CUDA_FLAGS " --Werror ext-lambda-captures-this")
string(APPEND CUDA_FLAGS " --expt-relaxed-constexpr")
if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "11.2")
string(APPEND CUDA_FLAGS " --diag-suppress ${DISABLE_NVCC_WARNINGS}")
else()
string(APPEND CUDA_FLAGS " -Xcudafe --diag_suppress=[${DISABLE_NVCC_WARNINGS}]")
endif()
string(APPEND CUDA_FLAGS " --diag-suppress ${DISABLE_NVCC_WARNINGS}")

# Host compiler flags
if (MSVC)
set(CUDA_DISABLE_MSVC_WARNINGS ${DISABLE_MSVC_WARNINGS})
if (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.2")
list(APPEND CUDA_DISABLE_MSVC_WARNINGS $<$<CONFIG:Debug>:/wd4700>) # uninitialized local variable used (thrust)
endif()
if (CMAKE_CUDA_COMPILER_VERSION VERSION_LESS "11.1")
list(APPEND CUDA_DISABLE_MSVC_WARNINGS /wd4515) # namespace uses itself (thrust)
endif()
string(REPLACE ";" "," CUDA_DISABLE_MSVC_WARNINGS "${CUDA_DISABLE_MSVC_WARNINGS}")

string(APPEND CUDA_FLAGS " -Xcompiler /W4,/WX,${CUDA_DISABLE_MSVC_WARNINGS}")
Expand Down
5 changes: 3 additions & 2 deletions cpp/open3d/core/hashmap/CUDA/StdGPUHashBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

#include <stdgpu/memory.h>
#include <stdgpu/utility.h>
#include <thrust/device_vector.h>
#include <thrust/transform.h>

Expand Down Expand Up @@ -90,7 +91,7 @@ class StdGPUAllocator {
// accessible in raw CUDA kernels.
template <typename Key>
using InternalStdGPUHashBackendAllocator =
StdGPUAllocator<thrust::pair<const Key, buf_index_t>>;
StdGPUAllocator<stdgpu::pair<const Key, buf_index_t>>;

template <typename Key, typename Hash, typename Eq>
using InternalStdGPUHashBackend =
Expand Down Expand Up @@ -252,7 +253,7 @@ void StdGPUHashBackend<Key, Hash, Eq>::Erase(const void* input_keys,
template <typename Key>
struct ValueExtractor {
OPEN3D_HOST_DEVICE buf_index_t
operator()(const thrust::pair<Key, buf_index_t>& x) const {
operator()(const stdgpu::pair<Key, buf_index_t>& x) const {
return x.second;
}
};
Expand Down
6 changes: 3 additions & 3 deletions docs/compilation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ System requirements
* macOS: Install with Homebrew: ``brew install cmake``
* Windows: Download from: `CMake download page <https://cmake.org/download/>`_

* CUDA 10.1+ (optional): Open3D supports GPU acceleration of an increasing number
of operations through CUDA on Linux. We recommend using CUDA 11.0 for the
* CUDA 11.5+ (optional): Open3D supports GPU acceleration of an increasing number
of operations through CUDA on Linux. We recommend using CUDA 12+ for the
best compatibility with recent GPUs and optional external dependencies such
as Tensorflow or PyTorch. Please see the `official documentation
<https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html>`_ to
Expand Down Expand Up @@ -250,7 +250,7 @@ pipelines from Open3D-ML in the python package, set ``BUNDLE_OPEN3D_ML=ON`` and
Open3D-ML from GitHub during the build with
``OPEN3D_ML_ROOT=https://github.com/isl-org/Open3D-ML.git``.

.. warning:: Compiling PyTorch ops with CUDA 11 and PyTorch < 1.9 may have
.. warning:: Compiling PyTorch ops with PyTorch < 1.9 may have
stability issues. See `Open3D issue #3324 <https://github.com/isl-org/Open3D/issues/3324>`_
and `PyTorch issue #52663 <https://github.com/pytorch/pytorch/issues/52663>`_
for more information on this problem. Official PyTorch wheels 1.9 and later
Expand Down

0 comments on commit b7e5f16

Please sign in to comment.