Skip to content

Commit

Permalink
Merge branch 'isl-org:main' into tensor-arange-signature
Browse files Browse the repository at this point in the history
  • Loading branch information
timohl authored Dec 15, 2024
2 parents a4badc6 + 81201f9 commit 3dd0be0
Show file tree
Hide file tree
Showing 62 changed files with 913 additions and 357 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ jobs:
strategy:
fail-fast: false
matrix:
# macos-12 is Intel runner, macos-14 is Apple Silicon
# macos-13 is Intel runner, macos-14 is Apple Silicon
# https://github.com/actions/runner-images
os: [macos-12, macos-14]
os: [macos-13, macos-14]
CONFIG: [ON, OFF]
env:
BUILD_SHARED_LIBS: ${{ matrix.CONFIG }}
Expand Down Expand Up @@ -68,23 +68,16 @@ jobs:
run: |
brew install ccache pkg-config
if [[ ${{ runner.arch}} == "ARM64" ]]; then
if [[ ${{ runner.arch }} == "ARM64" ]]; then
# Fix gfortran not found issue
ln -s $(which gfortran-13) /usr/local/bin/gfortran
# Default macos-14 image Xcode (version 15.0.1) linker causes build issues.
# Newer Xcode versions work, but embree recommends Apple clang <= 14 on
# arm64 to avoid possible "EXEC_BAD_INSTRUCTION" runtime exceptions:
# https://github.com/embree/embree/releases/tag/v4.3.1
sudo xcode-select -switch /Applications/Xcode_14.3.1.app
fi
# Install libomp 11.1.0 from old brew bottle for x64 catalina (10.15)
# / arm64 big sur (11.0). Directly installing the Ruby formula will
# install for the current OS.
# https://github.com/microsoft/LightGBM/issues/4229
if [[ ${{ runner.arch}} == "X64" ]]; then
brew unlink libomp
# x64 catalina (10.15) bottle
export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
else # ARM64
Expand Down Expand Up @@ -142,7 +135,7 @@ jobs:
permissions:
contents: write # Release upload
name: Fuse x64 and ARM64 viewer app
runs-on: [macos-12]
runs-on: [macos-13]
needs: [MacOS]
steps:
- name: Checkout source code # for gh release upload
Expand Down Expand Up @@ -191,9 +184,9 @@ jobs:
fail-fast: false
# https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6
matrix:
# macos-12 is Intel runner, macos-14 is Apple Silicon
# macos-13 is Intel runner, macos-14 is Apple Silicon
# https://github.com/actions/runner-images
os: [macos-12, macos-14]
os: [macos-13, macos-14]
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
is_main:
- ${{ github.ref == 'refs/heads/main' }}
Expand Down Expand Up @@ -260,12 +253,10 @@ jobs:
# Fix macos-14 arm64 runner image issues, see comments in MacOS job.
if [[ ${{ runner.arch}} == "ARM64" ]]; then
ln -s $(which gfortran-13) /usr/local/bin/gfortran
sudo xcode-select -switch /Applications/Xcode_14.3.1.app
fi
# Install libomp 11.1.0. See comment above.
if [[ ${{ runner.arch}} == "X64" ]]; then
brew unlink libomp
# x64 catalina (10.15) bottle
export LIBOMP_BOTTLE_HASH=45a5aa653bd45bd5ff5858580b1a4670c4b5a51ea29d68d45a53f72f56010e05
else # ARM64
Expand Down Expand Up @@ -308,7 +299,7 @@ jobs:
name: Fuse universal2 wheel
permissions:
contents: write # Release upload
runs-on: [macos-12]
runs-on: [macos-13]
needs: [build-wheel]
strategy:
fail-fast: false
Expand Down Expand Up @@ -379,7 +370,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-12, macos-14]
os: [macos-13, macos-14]
python_version: ['3.8', '3.9', '3.10', '3.11', '3.12']
is_main:
- ${{ github.ref == 'refs/heads/main' }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ jobs:
gcloud compute ssh "${INSTANCE_NAME}" \
--zone="${GCE_ZONE}" \
--command="ls -alh \
&& gsutil cp ${CCACHE_TAR_NAME}.tar.gz gs://open3d-ci-cache/"
&& gsutil cp ${CCACHE_TAR_NAME}.tar.xz gs://open3d-ci-cache/"
- name: VM delete
if: always()
Expand Down
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
- Fix alpha shape reconstruction if alpha too small for point scale (PR #6998)
- Fix render to depth image on Apple Retina displays (PR #7001)
- Fix infinite loop in segment_plane if num_points < ransac_n (PR #7032)
- Add select_by_index method to Feature class (PR #7039)

## 0.13

Expand Down
6 changes: 4 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 Expand Up @@ -476,6 +476,8 @@ if(WIN32)
# Then, we could use -fvisibility=hidden for Linux as well
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
if(MSVC)
# MSVC standards-compliant mode: Error in PoissonRecon 3rd party header
# add_compile_options($<$<COMPILE_LANGUAGE:CXX>:"/permissive-">)
# Make sure we don't hit the 65535 object member limit with MSVC
#
# /bigobj allows object files with more than 65535 members
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
2 changes: 2 additions & 0 deletions cpp/open3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ target_sources(Open3D PRIVATE
open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE
camera
core
core_impl
data
geometry
tgeometry
Expand All @@ -101,6 +102,7 @@ open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE
tpipelines_kernel
utility
visualization
visualization_impl
)

if (BUILD_GUI)
Expand Down
47 changes: 31 additions & 16 deletions cpp/open3d/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,22 +41,7 @@ target_sources(core PRIVATE
hashmap/HashBackendBuffer.cpp
hashmap/HashMap.cpp
hashmap/HashSet.cpp
kernel/Arange.cpp
kernel/ArangeCPU.cpp
kernel/BinaryEW.cpp
kernel/BinaryEWCPU.cpp
kernel/IndexGetSet.cpp
kernel/IndexGetSetCPU.cpp
kernel/IndexReduction.cpp
kernel/IndexReductionCPU.cpp
kernel/Kernel.cpp
kernel/NonZero.cpp
kernel/NonZeroCPU.cpp
kernel/Reduction.cpp
kernel/ReductionCPU.cpp
kernel/UnaryEW.cpp
kernel/UnaryEWCPU.cpp
kernel/UnaryEWSYCL.cpp
linalg/AddMM.cpp
linalg/AddMMCPU.cpp
linalg/Det.cpp
Expand All @@ -82,11 +67,33 @@ target_sources(core PRIVATE
nns/NNSIndex.cpp
)

# core_impl contains the implementation of core functions that are not exposed in the public API
open3d_ispc_add_library(core_impl OBJECT)
set_target_properties(core_impl PROPERTIES CXX_VISIBILITY_PRESET "hidden")

target_sources(core_impl PRIVATE
kernel/Arange.cpp
kernel/ArangeCPU.cpp
kernel/BinaryEW.cpp
kernel/BinaryEWCPU.cpp
kernel/IndexGetSet.cpp
kernel/IndexGetSetCPU.cpp
kernel/IndexReduction.cpp
kernel/IndexReductionCPU.cpp
kernel/NonZero.cpp
kernel/NonZeroCPU.cpp
kernel/Reduction.cpp
kernel/ReductionCPU.cpp
kernel/UnaryEW.cpp
kernel/UnaryEWCPU.cpp
kernel/UnaryEWSYCL.cpp
)

if (BUILD_CUDA_MODULE)
target_sources(core PRIVATE
MemoryManagerCUDA.cpp
)
target_sources(core PRIVATE
target_sources(core_impl PRIVATE
hashmap/CUDA/CreateCUDAHashBackend.cu
hashmap/CUDA/CUDAHashBackendBuffer.cu
hashmap/CUDA/SlabNodeManager.cu
Expand Down Expand Up @@ -116,6 +123,8 @@ endif()
if (BUILD_ISPC_MODULE)
target_sources(core PRIVATE
Indexer.ispc
)
target_sources(core_impl PRIVATE
kernel/BinaryEWCPU.ispc
kernel/UnaryEWCPU.ispc
)
Expand All @@ -126,6 +135,12 @@ open3d_set_global_properties(core)
open3d_set_open3d_lib_properties(core)
open3d_link_3rdparty_libraries(core)

open3d_show_and_abort_on_warning(core_impl)
open3d_set_global_properties(core_impl)
open3d_set_open3d_lib_properties(core_impl)
open3d_link_3rdparty_libraries(core_impl)

if(BUILD_CUDA_MODULE)
target_include_directories(core SYSTEM PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
target_include_directories(core_impl SYSTEM PRIVATE ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
endif()
24 changes: 12 additions & 12 deletions cpp/open3d/core/SYCLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,22 @@ SYCLContext::SYCLContext() {
} catch (const sycl::exception &e) {
}

if (devices_.size() == 0) {
// SYCL CPU fallback.
// This could happen if the Intel GPGPU driver is not installed or if
// your CPU does not have integrated GPU.
try {
const sycl::device &sycl_device =
sycl::device(sycl::cpu_selector_v);
const Device open3d_device = Device("SYCL:0");
// SYCL CPU fallback.
// This could happen if the Intel GPGPU driver is not installed or if
// your CPU does not have integrated GPU.
try {
if (devices_.size() == 0) {
utility::LogWarning(
"SYCL GPU device is not available, falling back to SYCL "
"host device.");
devices_.push_back(open3d_device);
device_to_sycl_device_[open3d_device] = sycl_device;
device_to_default_queue_[open3d_device] = sycl::queue(sycl_device);
} catch (const sycl::exception &e) {
}
const sycl::device &sycl_device = sycl::device(sycl::cpu_selector_v);
const Device open3d_device =
Device("SYCL:" + std::to_string(devices_.size()));
devices_.push_back(open3d_device);
device_to_sycl_device_[open3d_device] = sycl_device;
device_to_default_queue_[open3d_device] = sycl::queue(sycl_device);
} catch (const sycl::exception &e) {
}

if (devices_.size() == 0) {
Expand Down
45 changes: 23 additions & 22 deletions cpp/open3d/core/SYCLUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,14 +118,32 @@ static std::string SYCLDeviceToString(const sycl::device &device) {

void PrintSYCLDevices(bool print_all) {
#ifdef BUILD_SYCL_MODULE
const char *filter = std::getenv("SYCL_DEVICE_FILTER");
const char *filter = std::getenv("ONEAPI_DEVICE_SELECTOR");
if (filter) {
utility::LogWarning(
"SYCL_DEVICE_FILTER environment variable is set to {}. To see "
"the correct device id, please unset SYCL_DEVICE_FILTER.",
"ONEAPI_DEVICE_SELECTOR environment variable is set to {}. To "
"see the correct device id, please unset "
"ONEAPI_DEVICE_SELECTOR.",
filter);
}

int nd = 0;
utility::LogInfo("# Open3D SYCL device");
try {
utility::LogInfo(
"- Device(\"SYCL:{}\"): {}", nd,
SYCLDeviceToString(sycl::device(sycl::gpu_selector_v)));
++nd;
} catch (const sycl::exception &e) {
}
try {
utility::LogInfo("# Open3D SYCL device (CPU fallback)");
utility::LogInfo(
"- Device(\"SYCL:{}\"): {}", nd,
SYCLDeviceToString(sycl::device(sycl::cpu_selector_v)));
} catch (const sycl::exception &e) {
if (nd == 0) utility::LogInfo("- Device(\"SYCL:0\"): N/A");
}
if (print_all) {
utility::LogInfo("# All SYCL devices");
const std::vector<sycl::platform> &platforms =
Expand Down Expand Up @@ -168,24 +186,6 @@ void PrintSYCLDevices(bool print_all) {
} catch (const sycl::exception &e) {
utility::LogInfo("- sycl::accelerator_selector_v: N/A");
}

utility::LogInfo("# Open3D SYCL device");
try {
const sycl::device &device = sycl::device(sycl::gpu_selector_v);
utility::LogInfo("- Device(\"SYCL:0\"): {}",
SYCLDeviceToString(device));
} catch (const sycl::exception &e) {
utility::LogInfo("- Device(\"SYCL:0\"): N/A");
}
} else {
utility::LogInfo("# Open3D SYCL device");
try {
const sycl::device &device = sycl::device(sycl::gpu_selector_v);
utility::LogInfo("- Device(\"SYCL:0\"): {}",
SYCLDeviceToString(device));
} catch (const sycl::exception &e) {
utility::LogInfo("- Device(\"SYCL:0\"): N/A");
}
}

#else
Expand Down Expand Up @@ -225,10 +225,11 @@ void enablePersistentJITCache() {
#else
setenv("SYCL_CACHE_PERSISTENT", "1", 1);
#endif
#endif
#else
utility::LogInfo(
"enablePersistentJITCache is not compiled with "
"BUILD_SYCL_MODULE=ON.");
#endif
}

} // namespace sy
Expand Down
Loading

0 comments on commit 3dd0be0

Please sign in to comment.