diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 82c90c2c17a..f0376d641fc 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -25,6 +25,7 @@ env: STOOLS_VER: "67.3.2" JEDI_VER: "0.17.2" # https://github.com/ipython/ipython/issues/12740 IDNA_VER: "2.8" # https://github.com/psf/requests/issues/5710 + CUDA_VERSION: 11.7.1 SRC_DIR: "D:\\a\\open3d\\open3d" BUILD_DIR: "C:\\Open3D\\build" NPROC: 2 @@ -34,7 +35,7 @@ jobs: windows: permissions: contents: write # upload - runs-on: windows-2019 + runs-on: windows-2022 strategy: fail-fast: false matrix: @@ -47,7 +48,6 @@ jobs: STATIC_RUNTIME: ON include: - BUILD_CUDA_MODULE: ON - CUDA_VERSION: 11.0.3 env: BUILD_WEBRTC: ${{ ( matrix.BUILD_SHARED_LIBS == 'OFF' && matrix.STATIC_RUNTIME == 'ON' ) && 'ON' || 'OFF' }} @@ -64,16 +64,12 @@ jobs: if: ${{ matrix.BUILD_CUDA_MODULE == 'ON' }} run: | # Define variables - $CUDA_VER_FULL = "${{ matrix.CUDA_VERSION }}" + $CUDA_VER_FULL = "${{ env.CUDA_VERSION }}" $CUDA_VER_ARR = $CUDA_VER_FULL.Split(".") $CUDA_VER = "$($CUDA_VER_ARR[0]).$($CUDA_VER_ARR[1])" $CUDA_VER_ID = "$($CUDA_VER_ARR[0])_$($CUDA_VER_ARR[1])" # Installer url - if ( $CUDA_VER_ARR[0] -ge 11 ) { - $CUDA_URL = "http://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_win10_network.exe" - } else { - $CUDA_URL = "http://developer.download.nvidia.com/compute/cuda/$CUDA_VER/Prod/network_installers/cuda_$($CUDA_VER_FULL)_win10_network.exe" - } + $CUDA_URL = "https://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" # Installer arguments $CUDA_INSTALL_ARGS = "-s" # Required packages @@ -110,7 +106,7 @@ jobs: if (${env:DEVELOPER_BUILD} -ne "OFF") { ${env:DEVELOPER_BUILD}="ON" } - cmake -G "Visual Studio 16 2019" -A x64 ` + cmake -G "Visual Studio 17 2022" -A x64 ` -DDEVELOPER_BUILD="${env:DEVELOPER_BUILD}" ` -DCMAKE_SYSTEM_VERSION="10.0.19041.0" ` -DBUILD_EXAMPLES=OFF ` @@ -205,7 +201,7 @@ jobs: $ErrorActionPreference = 'Stop' mkdir build cd build - cmake -G "Visual Studio 16 2019" -A x64 ` + cmake -G "Visual Studio 17 2022" -A x64 ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DSTATIC_WINDOWS_RUNTIME=${{ matrix.STATIC_RUNTIME }} ` .. @@ -235,7 +231,7 @@ jobs: name: Build wheel permissions: contents: write # upload - runs-on: windows-2019 + runs-on: windows-2022 strategy: fail-fast: false # https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 @@ -280,7 +276,7 @@ jobs: if (${env:DEVELOPER_BUILD} -ne "OFF") { ${env:DEVELOPER_BUILD}="ON" } - cmake -G "Visual Studio 16 2019" -A x64 ` + cmake -G "Visual Studio 17 2022" -A x64 ` -DCMAKE_INSTALL_PREFIX="C:\Program Files\Open3D" ` -DDEVELOPER_BUILD="${env:DEVELOPER_BUILD}" ` -DCMAKE_SYSTEM_VERSION="10.0.19041.0" ` @@ -323,7 +319,7 @@ jobs: name: Test wheel permissions: contents: read - runs-on: windows-2019 + runs-on: windows-2019 # build on 2022, test on 2019 needs: [build-wheel] strategy: fail-fast: false diff --git a/3rdparty/README.md b/3rdparty/README.md index c7c9f94a74e..44678269c85 100644 --- a/3rdparty/README.md +++ b/3rdparty/README.md @@ -51,7 +51,7 @@ dirent 1.21 MIT license https://github.com/tronkko/dirent A C/C++ programming interface for cross-platform filesystem -------------------------------------------------------------------------------- -librealsense 2.44.0 Apache-2 license +librealsense 2.54.2 Apache-2 license A cross-platform library for capturing data from the Intel RealSense F200, SR300, R200 and L500 cameras https://github.com/IntelRealSense/librealsense @@ -113,7 +113,7 @@ As an alternative, you can modify 3rdparty/zeromq/zeromq_build.cmake to fetch zeromq from our fork https://github.com/isl-org/libzmq -------------------------------------------------------------------------------- -embree 3.13.0 Apache-2 license +embree 4.3.1 Apache-2 license Embree is a collection of high-performance ray tracing kernels https://github.com/embree/embree -------------------------------------------------------------------------------- diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake index d91377a3138..3eec3beccf9 100644 --- a/3rdparty/find_dependencies.cmake +++ b/3rdparty/find_dependencies.cmake @@ -167,6 +167,7 @@ set(ExternalProject_CMAKE_ARGS -DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER} -DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER} -DCMAKE_CUDA_COMPILER_LAUNCHER=${CMAKE_CUDA_COMPILER_LAUNCHER} + -DCMAKE_CUDA_FLAGS=${CMAKE_CUDA_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_INSTALL_LIBDIR=${Open3D_INSTALL_LIB_DIR} diff --git a/3rdparty/librealsense/fix-macos-arm64.patch b/3rdparty/librealsense/fix-macos-arm64.patch deleted file mode 100644 index 0de73a574a1..00000000000 --- a/3rdparty/librealsense/fix-macos-arm64.patch +++ /dev/null @@ -1,22 +0,0 @@ -From beb4c44debc8336de991c983274cad841eb5c323 Mon Sep 17 00:00:00 2001 -From: Pavol Rusnak -Date: Sun, 20 Jun 2021 12:26:58 +0200 -Subject: [PATCH] Fix build on macOS arm64 - ---- - src/proc/color-formats-converter.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/proc/color-formats-converter.cpp b/src/proc/color-formats-converter.cpp -index 564a23d9c4..6c6c8c97d8 100644 ---- a/src/proc/color-formats-converter.cpp -+++ b/src/proc/color-formats-converter.cpp -@@ -18,7 +18,7 @@ - #include // For SSSE3 intrinsics - #endif - --#if defined (ANDROID) || (defined (__linux__) && !defined (__x86_64__)) -+#if defined (ANDROID) || (defined (__linux__) && !defined (__x86_64__)) || (defined (__APPLE__) && !defined (__x86_64__)) - - bool has_avx() { return false; } - diff --git a/3rdparty/librealsense/fix_mac_apple_silicon_build.patch b/3rdparty/librealsense/fix_mac_apple_silicon_build.patch new file mode 100644 index 00000000000..41ed3133ca3 --- /dev/null +++ b/3rdparty/librealsense/fix_mac_apple_silicon_build.patch @@ -0,0 +1,30 @@ +From 5a244052e2df7842940dfb5a9011973a09626300 Mon Sep 17 00:00:00 2001 +From: Nir Azkiel +Date: Tue, 28 May 2024 17:17:04 +0300 +Subject: [PATCH] fix mac apple silicon build + +--- + CMake/unix_config.cmake | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/CMake/unix_config.cmake b/CMake/unix_config.cmake +index 5a187c7c7a..89272b8ee1 100644 +--- a/CMake/unix_config.cmake ++++ b/CMake/unix_config.cmake +@@ -19,12 +19,12 @@ macro(os_set_flags) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-switch -Wno-multichar -Wsequence-point -Wformat -Wformat-security") + + execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpmachine OUTPUT_VARIABLE MACHINE) +- if(${MACHINE} MATCHES "arm-*") +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") +- elseif(${MACHINE} MATCHES "aarch64-*") ++ if(${MACHINE} MATCHES "arm64-*" OR ${MACHINE} MATCHES "aarch64-*") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mstrict-align -ftree-vectorize") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mstrict-align -ftree-vectorize") ++ elseif(${MACHINE} MATCHES "arm-*") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mfpu=neon -mfloat-abi=hard -ftree-vectorize -latomic") + elseif(${MACHINE} MATCHES "powerpc64(le)?-linux-gnu") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftree-vectorize") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ftree-vectorize") diff --git a/3rdparty/librealsense/librealsense.cmake b/3rdparty/librealsense/librealsense.cmake index e5caa700df7..eb13cf213d2 100644 --- a/3rdparty/librealsense/librealsense.cmake +++ b/3rdparty/librealsense/librealsense.cmake @@ -5,8 +5,9 @@ find_package(Git QUIET REQUIRED) ExternalProject_Add( ext_librealsense PREFIX librealsense - URL https://github.com/IntelRealSense/librealsense/archive/refs/tags/v2.44.0.tar.gz # 2020 Apr 1 - URL_HASH SHA256=5b0158592646984f0f7348da3783e2fb49e99308a97f2348fe3cc82c770c6dde + URL https://github.com/IntelRealSense/librealsense/archive/refs/tags/v2.54.2.tar.gz # 2023 Sep 28 + # Future versions after v2.54.2 may not support L515 and SR300 + URL_HASH SHA256=e3a767337ff40ae41000049a490ab84bd70b00cbfef65e8cdbadf17fd2e1e5a8 DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/librealsense" UPDATE_COMMAND "" # Patch for libusb static build failure on Linux @@ -17,9 +18,7 @@ ExternalProject_Add( COMMAND ${GIT_EXECUTABLE} init COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace ${CMAKE_CURRENT_LIST_DIR}/fix-cudacrt.patch - # Patch for macOS ARM64 support for versions < 2.50.0 - COMMAND ${GIT_EXECUTABLE} apply --ignore-space-change --ignore-whitespace - ${CMAKE_CURRENT_LIST_DIR}/fix-macos-arm64.patch + ${CMAKE_CURRENT_LIST_DIR}/fix_mac_apple_silicon_build.patch CMAKE_ARGS -DCMAKE_INSTALL_PREFIX= -DBUILD_SHARED_LIBS=OFF @@ -30,6 +29,7 @@ ExternalProject_Add( -DBUILD_PYTHON_BINDINGS=OFF -DBUILD_WITH_CUDA=${BUILD_CUDA_MODULE} -DUSE_EXTERNAL_USB=ON + -DBUILD_TOOLS=OFF # Syncing GLIBCXX_USE_CXX11_ABI for MSVC causes problems, but directly # checking CXX_COMPILER_ID is not supported. $,"",-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=$> @@ -43,27 +43,33 @@ ExternalProject_Add( /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}realsense2${CMAKE_STATIC_LIBRARY_SUFFIX} /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}realsense-file${CMAKE_STATIC_LIBRARY_SUFFIX} /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}fw${CMAKE_STATIC_LIBRARY_SUFFIX} + /${Open3D_INSTALL_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}rsutils${CMAKE_STATIC_LIBRARY_SUFFIX} ) ExternalProject_Get_Property(ext_librealsense INSTALL_DIR) set(LIBREALSENSE_INCLUDE_DIR "${INSTALL_DIR}/include/") # "/" is critical. set(LIBREALSENSE_LIB_DIR "${INSTALL_DIR}/${Open3D_INSTALL_LIB_DIR}") - -set(LIBREALSENSE_LIBRARIES realsense2 fw realsense-file usb) # The order is critical. +set(LIBREALSENSE_LIBRARIES realsense2 fw realsense-file rsutils) # The order is critical. +if (NOT MSVC) + list(APPEND LIBREALSENSE_LIBRARIES usb) +endif() if(MSVC) # Rename debug libs to ${LIBREALSENSE_LIBRARIES}. rem (comment) is no-op ExternalProject_Add_Step(ext_librealsense rename_debug_libs COMMAND $,move,rem> /Y realsense2d.lib realsense2.lib COMMAND $,move,rem> /Y fwd.lib fw.lib COMMAND $,move,rem> /Y realsense-filed.lib realsense-file.lib + COMMAND $,move,rem> /Y rsutilsd.lib rsutils.lib WORKING_DIRECTORY "${LIBREALSENSE_LIB_DIR}" DEPENDEES install ) endif() -ExternalProject_Add_Step(ext_librealsense copy_libusb_to_lib_folder - COMMAND ${CMAKE_COMMAND} -E copy - "/libusb_install/lib/${CMAKE_STATIC_LIBRARY_PREFIX}usb${CMAKE_STATIC_LIBRARY_SUFFIX}" - "${LIBREALSENSE_LIB_DIR}" - DEPENDEES install - BYPRODUCTS "${LIBREALSENSE_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}usb${CMAKE_STATIC_LIBRARY_SUFFIX}" - ) +if (NOT MSVC) + ExternalProject_Add_Step(ext_librealsense copy_libusb_to_lib_folder + COMMAND ${CMAKE_COMMAND} -E copy + "/libusb_install/lib/${CMAKE_STATIC_LIBRARY_PREFIX}usb${CMAKE_STATIC_LIBRARY_SUFFIX}" + "${LIBREALSENSE_LIB_DIR}" + DEPENDEES install + BYPRODUCTS "${LIBREALSENSE_LIB_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}usb${CMAKE_STATIC_LIBRARY_SUFFIX}" + ) +endif() diff --git a/3rdparty/stdgpu/stdgpu.cmake b/3rdparty/stdgpu/stdgpu.cmake index f486fc3d4ce..a016db2089a 100644 --- a/3rdparty/stdgpu/stdgpu.cmake +++ b/3rdparty/stdgpu/stdgpu.cmake @@ -7,8 +7,9 @@ include(ExternalProject) ExternalProject_Add( ext_stdgpu PREFIX stdgpu - URL https://github.com/stotko/stdgpu/archive/e10f6f3ccc9902d693af4380c3bcd188ec34a2e6.tar.gz - URL_HASH SHA256=7bb2733b099f7cedc86d2aee7830d128ac1222cfafa34cbaa4e818483c0a93f6 + # Jul 2024: Fix FindThrust.cmake + URL https://github.com/stotko/stdgpu/archive/1b6a3319f1fbf180166e1bbc1d75f69ab622a0a0.tar.gz + URL_HASH SHA256=FAA3BF9CBE49EF9CC09E2E07E60D10BBF3B896EDB6089C920BEBE0F850FD95E4 DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/stdgpu" UPDATE_COMMAND "" CMAKE_ARGS diff --git a/CMakeLists.txt b/CMakeLists.txt index dc2bdc62e15..85a3ec020a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -387,6 +387,14 @@ cmake_language(EVAL CODE "cmake_language(DEFER CALL open3d_patch_findthreads_mod # Build CUDA module by default if CUDA is available if(BUILD_CUDA_MODULE) + # Suppress nvcc unsupported compiler error for MSVC 2022 with CUDA 11.7 to 12.4 + # https://forums.developer.nvidia.com/t/problems-with-latest-vs2022-update/294150/12 + if (MSVC AND MSVC_VERSION VERSION_LESS_EQUAL "1949") + # Set this before any CUDA checks + set(CMAKE_CUDA_FLAGS "--allow-unsupported-compiler" CACHE STRING "Additional flags for nvcc" FORCE) + message(WARNING "Using --allow-unsupported-compiler flag for nvcc with MSVC 2022.") + endif() + if(BUILD_COMMON_CUDA_ARCHS) if (CMAKE_CUDA_ARCHITECTURES) message(STATUS "Building with user-provided architectures: ${CMAKE_CUDA_ARCHITECTURES}") diff --git a/python/test/t/io/test_realsense.py b/python/test/t/io/test_realsense.py index 2d05e1c28d7..c6df67ae181 100755 --- a/python/test/t/io/test_realsense.py +++ b/python/test/t/io/test_realsense.py @@ -64,7 +64,7 @@ def test_RSBagReader(): assert n_frames == 6 # save_frames - bag_reader = o3d.t.io.RGBDVideoReader.create("L515_test_s.bag") + bag_reader = o3d.t.io.RGBDVideoReader.create(sample_l515_bag.path) bag_reader.save_frames("L515_test_s") # Use issubset() since there may be other OS files present assert {'depth', 'color', @@ -79,8 +79,6 @@ def test_RSBagReader(): }.issubset(os.listdir('L515_test_s/color')) shutil.rmtree("L515_test_s") - if os.name != 'nt': # Permission error in Windows - os.remove("L515_test_s.bag") # Test recording from a RealSense camera, if one is connected