From 5f148f2fd3c309c6585019f7c2c9402853a16e37 Mon Sep 17 00:00:00 2001 From: Stuart Date: Fri, 4 Oct 2024 17:21:41 -0400 Subject: [PATCH] Support python 312 (#6717) * TensorFlow updated to v2.16.2 * PyTorch updated to v2.2.0 * CUDA updated to 12.1 * Update windows CUDA version to match Linux, TF version, torch as latest supporting Intel Mac, update werkzeug, flask to matching versions. * Update stdgpu * Clearer ASSIMP error messages * Always obey CMAKE_CUDA_ARCHITECTURES if used. * use shared_ptr to capture array in lambda * set TORCH_CUDA_ARCH_LIST as workaround for CUDA 12 and Pytorch <2.4 * Update and sort library list in 3rdparty/README.md --------- Co-authored-by: Sameer Sheorey Co-authored-by: Benjamin Ummenhofer Co-authored-by: Sameer Sheorey <41028320+ssheorey@users.noreply.github.com> --- .github/workflows/macos.yml | 15 +- .github/workflows/ubuntu-wheel.yml | 13 +- .github/workflows/windows.yml | 17 +- 3rdparty/README.md | 185 +++++++++--------- 3rdparty/cmake/FindPytorch.cmake | 25 +++ 3rdparty/find_dependencies.cmake | 1 + 3rdparty/stdgpu/stdgpu.cmake | 6 +- CHANGELOG.md | 1 + CMakeLists.txt | 30 +-- cpp/open3d/t/geometry/RaycastingScene.cpp | 3 +- cpp/open3d/t/io/file_format/FileASSIMP.cpp | 2 +- cpp/pybind/core/tensor_converter.cpp | 6 +- docker/Dockerfile.wheel | 6 +- docker/README.md | 2 +- docker/docker_build.sh | 45 ++++- docker/docker_test.sh | 24 +++ docs/arm.rst | 1 + docs/getting_started.in.rst | 7 +- python/README.rst | 1 + .../ml/tf/python/layers/neighbor_search.py | 9 +- python/requirements.txt | 3 +- python/requirements_test.txt | 6 +- python/setup.py | 1 + python/test/ml_ops/test_sparseconv.py | 48 +++-- python/test/t/io/test_realsense.py | 4 +- util/ci_utils.sh | 7 +- 26 files changed, 310 insertions(+), 158 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 2aea46eb596..1c3ff74deba 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -62,7 +62,7 @@ jobs: - name: Set up Python version uses: actions/setup-python@v5 with: - python-version: '3.11' + python-version: '3.12' - name: Install dependencies run: | @@ -194,7 +194,7 @@ jobs: # macos-12 is Intel runner, macos-14 is Apple Silicon # https://github.com/actions/runner-images os: [macos-12, macos-14] - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -209,6 +209,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: BUILD_CUDA_MODULE: OFF @@ -310,12 +312,14 @@ jobs: fail-fast: false # https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 matrix: - python_version: ['3.10', '3.11'] + python_version: ['3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' steps: - name: Checkout source code # for gh release upload uses: actions/checkout@v4 @@ -374,7 +378,7 @@ jobs: fail-fast: false matrix: os: [macos-12, macos-14] - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -388,6 +392,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML @@ -399,6 +405,7 @@ jobs: uses: actions/checkout@v4 with: repository: isl-org/Open3D-ML + ref: main path: ${{ env.OPEN3D_ML_ROOT }} - name: Download wheels diff --git a/.github/workflows/ubuntu-wheel.yml b/.github/workflows/ubuntu-wheel.yml index 591d0852238..c55bc1d65c6 100644 --- a/.github/workflows/ubuntu-wheel.yml +++ b/.github/workflows/ubuntu-wheel.yml @@ -33,7 +33,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -43,6 +43,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }} PYTHON_VERSION: ${{ matrix.python_version }} @@ -67,6 +69,8 @@ jobs: docker/docker_build.sh cuda_wheel_py310_dev elif [ "${{ env.PYTHON_VERSION }}" = "3.11" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then docker/docker_build.sh cuda_wheel_py311_dev + elif [ "${{ env.PYTHON_VERSION }}" = "3.12" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then + docker/docker_build.sh cuda_wheel_py312_dev elif [ "${{ env.PYTHON_VERSION }}" = "3.8" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then docker/docker_build.sh cuda_wheel_py38 elif [ "${{ env.PYTHON_VERSION }}" = "3.9" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then @@ -75,6 +79,8 @@ jobs: docker/docker_build.sh cuda_wheel_py310 elif [ "${{ env.PYTHON_VERSION }}" = "3.11" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then docker/docker_build.sh cuda_wheel_py311 + elif [ "${{ env.PYTHON_VERSION }}" = "3.12" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then + docker/docker_build.sh cuda_wheel_py312 fi PIP_PKG_NAME="$(basename ${GITHUB_WORKSPACE}/open3d-[0-9]*.whl)" PIP_CPU_PKG_NAME="$(basename ${GITHUB_WORKSPACE}/open3d_cpu*.whl)" @@ -122,7 +128,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -132,6 +138,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' env: OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML steps: @@ -145,6 +153,7 @@ jobs: uses: actions/checkout@v4 with: repository: isl-org/Open3D-ML + ref: ss/python-3.12 # remove before merge path: ${{ env.OPEN3D_ML_ROOT }} - name: Download wheels uses: actions/download-artifact@v4 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 82c90c2c17a..04a408802d0 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: "12.1.0" SRC_DIR: "D:\\a\\open3d\\open3d" BUILD_DIR: "C:\\Open3D\\build" NPROC: 2 @@ -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,20 +64,20 @@ 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" + $CUDA_URL = "http://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" } else { $CUDA_URL = "http://developer.download.nvidia.com/compute/cuda/$CUDA_VER/Prod/network_installers/cuda_$($CUDA_VER_FULL)_win10_network.exe" } # Installer arguments $CUDA_INSTALL_ARGS = "-s" # Required packages - $CUDA_PACKAGES = "nvcc", "visual_studio_integration", "cublas", "cublas_dev", "cudart", "cusolver", "cusolver_dev", "npp", "npp_dev" + $CUDA_PACKAGES = "nvcc", "visual_studio_integration", "cublas", "cublas_dev", "cudart", "cusolver", "cusolver_dev", "npp", "npp_dev", "thrust" $CUDA_PACKAGES.ForEach({ $CUDA_INSTALL_ARGS += " $($_)_$($CUDA_VER)" }) # Download and install CUDA echo "Downloading CUDA installer from $CUDA_URL" @@ -110,6 +110,7 @@ jobs: if (${env:DEVELOPER_BUILD} -ne "OFF") { ${env:DEVELOPER_BUILD}="ON" } + cmake --version cmake -G "Visual Studio 16 2019" -A x64 ` -DDEVELOPER_BUILD="${env:DEVELOPER_BUILD}" ` -DCMAKE_SYSTEM_VERSION="10.0.19041.0" ` @@ -240,7 +241,7 @@ jobs: fail-fast: false # https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6 matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -250,6 +251,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' steps: - name: Checkout source code @@ -328,7 +331,7 @@ jobs: strategy: fail-fast: false matrix: - python_version: ['3.8', '3.9', '3.10', '3.11'] + python_version: ['3.8', '3.9', '3.10', '3.11', '3.12'] is_main: - ${{ github.ref == 'refs/heads/main' }} exclude: @@ -338,6 +341,8 @@ jobs: python_version: '3.9' - is_main: false python_version: '3.10' + - is_main: false + python_version: '3.11' steps: - name: Checkout source code diff --git a/3rdparty/README.md b/3rdparty/README.md index c7c9f94a74e..b494ac77fc7 100644 --- a/3rdparty/README.md +++ b/3rdparty/README.md @@ -8,139 +8,138 @@ system dependencies. ```txt -------------------------------------------------------------------------------- +benchmark 1.5.5 Apache-2 license +A microbenchmark support library +https://github.com/google/benchmark +-------------------------------------------------------------------------------- +boringssl: edfe413 Dual OpenSSL, SSLeay, ISC license +BoringSSL is a fork of OpenSSL that is designed to meet Google's needs. +https://github.com/google/boringssl +-------------------------------------------------------------------------------- +CUB 1.8.0 BSD license +A flexible library of cooperative threadblock primitives and other utilities for +CUDA kernel programming +https://github.com/NVlabs/cub +-------------------------------------------------------------------------------- +cppzmq 4.6.0 MIT license +Header-only C++ binding for libzmq +https://github.com/zeromq/cppzmq +As an alternative, you can modify 3rdparty/zeromq/zeromq_build.cmake to fetch +zeromq from our fork +https://github.com/isl-org/libzmq +-------------------------------------------------------------------------------- +curl 7.88.0 Curl license +Curl is a command-line tool for transferring data specified with URL syntax. +https://github.com/curl/curl +-------------------------------------------------------------------------------- +CUTLASS 1.3.3 BSD license +CUDA Templates for Linear Algebra Subroutines +https://github.com/NVIDIA/cutlass +-------------------------------------------------------------------------------- +dirent 1.21 MIT license +https://github.com/tronkko/dirent +A C/C++ programming interface for cross-platform filesystem +-------------------------------------------------------------------------------- +DirectX-Headers v1.606.3 MIT license +Official DirectX headers available under an open source license +https://github.com/microsoft/DirectX-Headers +-------------------------------------------------------------------------------- +DirectXMath may2022 MIT license +DirectXMath is an all inline SIMD C++ linear algebra library for use in games +and graphics apps +https://github.com/microsoft/DirectXMath +-------------------------------------------------------------------------------- Eigen 3.4 Mainly MPL2 license A high-level C++ library of template headers for linear algebra, matrix and vector operations, numerical solvers and related algorithms http://eigen.tuxfamily.org/ -------------------------------------------------------------------------------- -GLFW 3.3.0 (dev) zlib/libpng license -A cross-platform library for creating windows with OpenGL contexts and receiving -input and events -http://www.glfw.org/ +embree 4.3.1 Apache-2 license +Embree is a collection of high-performance ray tracing kernels +https://github.com/embree/embree +-------------------------------------------------------------------------------- +flann 1.8.4 BSD license +A C++ library for performing fast approximate nearest neighbor searches in high +dimensional spaces +http://www.cs.ubc.ca/research/flann/ -------------------------------------------------------------------------------- GLEW 2.1.0 MIT License A cross-platform open-source C/C++ extension loading library http://glew.sourceforge.net/ -------------------------------------------------------------------------------- -RPly 1.1.3 MIT license -A library to read and write PLY files -http://w3.impa.br/~diego/software/rply/ --------------------------------------------------------------------------------- -zlib 1.2.8 zlib license -A lossless data-compression library used by libpng -http://www.zlib.net/ --------------------------------------------------------------------------------- -libpng 1.6.18 libpng license -The free reference library for reading and writing PNGs -http://www.libpng.org/ --------------------------------------------------------------------------------- -libjpeg 9a libjpeg license -A widely used C library for reading and writing JPEG image files -http://libjpeg.sourceforge.net/ +GLFW 3.3.0 (dev) zlib/libpng license +A cross-platform library for creating windows with OpenGL contexts and receiving +input and events +http://www.glfw.org/ -------------------------------------------------------------------------------- jsoncpp 1.8.4 MIT license A C++ library that allows manipulating JSON values https://github.com/open-source-parsers/jsoncpp -------------------------------------------------------------------------------- -flann 1.8.4 BSD license -A C++ library for performing fast approximate nearest neighbor searches in high -dimensional spaces -http://www.cs.ubc.ca/research/flann/ +libjpeg-turbo 2.1.5.1 BSD-style license +A widely used C library for reading and writing JPEG image files +https://github.com/libjpeg-turbo/libjpeg-turbo -------------------------------------------------------------------------------- -dirent 1.21 MIT license -https://github.com/tronkko/dirent -A C/C++ programming interface for cross-platform filesystem +libpng 1.6.37 libpng license +The free reference library for reading and writing PNGs +http://www.libpng.org/ -------------------------------------------------------------------------------- librealsense 2.44.0 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 -------------------------------------------------------------------------------- -tinyfiledialogs 2.7.2 zlib license -A lightweight cross-platform file dialog library -https://sourceforge.net/projects/tinyfiledialogs/ --------------------------------------------------------------------------------- -tinygltf v2.2.0 MIT license -Header only C++11 tiny glTF 2.0 library -https://github.com/syoyo/tinygltf --------------------------------------------------------------------------------- -tinyobjloader v1.0.0 MIT license -Tiny but powerful single file wavefront obj loader -https://github.com/syoyo/tinyobjloader --------------------------------------------------------------------------------- -pybind11 v2.6.2 BSD license -Python binding for C++11 -https://github.com/pybind/pybind11 --------------------------------------------------------------------------------- -PoissonReco 12.0 BSD license -Poisson Surface Reconstruction -https://github.com/mkazhdan/PoissonRecon --------------------------------------------------------------------------------- -Parallel STL 20190522 Apache-2 license -An implementation of the C++ standard library algorithms with support for -execution policies -https://github.com/oneapi-src/oneDPL +libzmq 4.3.3 LGPLv3 + static link exception license +ZeroMQ is a high-performance asynchronous messaging library +https://github.com/zeromq/libzmq -------------------------------------------------------------------------------- -CUB 1.8.0 BSD license -A flexible library of cooperative threadblock primitives and other utilities for -CUDA kernel programming -https://github.com/NVlabs/cub +msgpack-c 3.3.0 Boost Software License 1.0 +MessagePack implementation for C and C++ +https://github.com/msgpack/msgpack-c/tree/cpp_master -------------------------------------------------------------------------------- nanoflann 1.3.1 BSD license A C++11 header-only library for Nearest Neighbor (NN) search with KD-trees https://github.com/jlblancoc/nanoflann -------------------------------------------------------------------------------- -CUTLASS 1.3.3 BSD license -CUDA Templates for Linear Algebra Subroutines -https://github.com/NVIDIA/cutlass +PoissonReco 12.0 BSD license +Poisson Surface Reconstruction +https://github.com/mkazhdan/PoissonRecon -------------------------------------------------------------------------------- -benchmark 1.5.0 Apache-2 license -A microbenchmark support library -https://github.com/google/benchmark +pybind11 v2.13.1 BSD license +Python binding for C++11 +https://github.com/pybind/pybind11 -------------------------------------------------------------------------------- -msgpack-c da2fc25f8 Boost Software License 1.0 -MessagePack implementation for C and C++ -https://github.com/msgpack/msgpack-c/tree/cpp_master +RPly 1.1.3 MIT license +A library to read and write PLY files +http://w3.impa.br/~diego/software/rply/ -------------------------------------------------------------------------------- -libzmq 4.3.2 LGPLv3 + static link exception license -ZeroMQ is a high-performance asynchronous messaging library -https://github.com/zeromq/libzmq +stdgpu 1b6a3319 Apache-2.0 license +Efficient STL-like Data Structures on the GPU +https://github.com/stotko/stdgpu/ -------------------------------------------------------------------------------- -cppzmq 4.6.0 MIT license -Header-only C++ binding for libzmq -https://github.com/zeromq/cppzmq -As an alternative, you can modify 3rdparty/zeromq/zeromq_build.cmake to fetch -zeromq from our fork -https://github.com/isl-org/libzmq +tinyfiledialogs 2.7.2 zlib license +A lightweight cross-platform file dialog library +https://sourceforge.net/projects/tinyfiledialogs/ -------------------------------------------------------------------------------- -embree 3.13.0 Apache-2 license -Embree is a collection of high-performance ray tracing kernels -https://github.com/embree/embree +tinygltf 72f4a55 MIT license +Header only C++11 tiny glTF 2.0 library +https://github.com/syoyo/tinygltf -------------------------------------------------------------------------------- -curl 7.79.1 Curl license -Curl is a command-line tool for transferring data specified with URL syntax. -https://github.com/curl/curl +tinyobjloader v1.0.0 MIT license +Tiny but powerful single file wavefront obj loader +https://github.com/syoyo/tinyobjloader -------------------------------------------------------------------------------- -boringssl: edfe413 Dual OpenSSL, SSLeay, ISC license -BoringSSL is a fork of OpenSSL that is designed to meet Google's needs. -https://github.com/google/boringssl +UVAtlas may2022 MIT license +UVAtlas isochart texture atlas +https://github.com/microsoft/uvatlas -------------------------------------------------------------------------------- vtk 9.1 BSD license The Visualization Toolkit (VTK) https://gitlab.kitware.com/vtk/vtk -------------------------------------------------------------------------------- -DirectX-Headers v1.606.3 MIT license -Official DirectX headers available under an open source license -https://github.com/microsoft/DirectX-Headers --------------------------------------------------------------------------------- -DirectXMath may2022 MIT license -DirectXMath is an all inline SIMD C++ linear algebra library for use in games -and graphics apps -https://github.com/microsoft/DirectXMath --------------------------------------------------------------------------------- -UVAtlas may2022 MIT license -UVAtlas isochart texture atlas -https://github.com/microsoft/uvatlas +zlib 1.2.13 zlib license +A lossless data-compression library used by libpng +http://www.zlib.net/ -------------------------------------------------------------------------------- ``` diff --git a/3rdparty/cmake/FindPytorch.cmake b/3rdparty/cmake/FindPytorch.cmake index eb2a53e2ec5..31babdca149 100644 --- a/3rdparty/cmake/FindPytorch.cmake +++ b/3rdparty/cmake/FindPytorch.cmake @@ -14,6 +14,20 @@ # # and import the target 'torch'. +# "80-real" to "8.0" and "80" to "8.0+PTX": +macro(translate_arch_string input output) + if("${input}" MATCHES "[0-9]+-real") + string(REGEX REPLACE "([1-9])([0-9])-real" "\\1.\\2" version "${input}") + elseif("${input}" MATCHES "([0-9]+)") + string(REGEX REPLACE "([1-9])([0-9])" "\\1.\\2+PTX" version "${input}") + elseif(input STREQUAL "native") + set(version "Auto") + else() + message(FATAL_ERROR "Invalid architecture string: ${input}") + endif() + set(${output} "${version}") +endmacro() + if(NOT Pytorch_FOUND) # Searching for pytorch requires the python executable if (NOT Python3_EXECUTABLE) @@ -41,6 +55,17 @@ if(NOT Pytorch_FOUND) unset(PyTorch_FETCH_PROPERTIES) unset(PyTorch_PROPERTIES) + if(BUILD_CUDA_MODULE) + # Using CUDA 12.x and Pytorch <2.4 gives the error "Unknown CUDA Architecture Name 9.0a in CUDA_SELECT_NVCC_ARCH_FLAGS". + # As a workaround we explicitly set TORCH_CUDA_ARCH_LIST + set(TORCH_CUDA_ARCH_LIST "") + foreach(arch IN LISTS CMAKE_CUDA_ARCHITECTURES) + translate_arch_string("${arch}" ptarch) + list(APPEND TORCH_CUDA_ARCH_LIST "${ptarch}") + endforeach() + message(STATUS "Using top level CMAKE_CUDA_ARCHITECTURES for TORCH_CUDA_ARCH_LIST: ${TORCH_CUDA_ARCH_LIST}") + endif() + # Use the cmake config provided by torch find_package(Torch REQUIRED PATHS "${Pytorch_ROOT}" NO_DEFAULT_PATH) diff --git a/3rdparty/find_dependencies.cmake b/3rdparty/find_dependencies.cmake index d91377a3138..c3dc3885565 100644 --- a/3rdparty/find_dependencies.cmake +++ b/3rdparty/find_dependencies.cmake @@ -168,6 +168,7 @@ set(ExternalProject_CMAKE_ARGS -DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER} -DCMAKE_CUDA_COMPILER_LAUNCHER=${CMAKE_CUDA_COMPILER_LAUNCHER} -DCMAKE_OSX_DEPLOYMENT_TARGET=${CMAKE_OSX_DEPLOYMENT_TARGET} + -DCMAKE_CUDA_FLAGS=${CMAKE_CUDA_FLAGS} -DCMAKE_SYSTEM_VERSION=${CMAKE_SYSTEM_VERSION} -DCMAKE_INSTALL_LIBDIR=${Open3D_INSTALL_LIB_DIR} # Always build 3rd party code in Release mode. Ignored by multi-config diff --git a/3rdparty/stdgpu/stdgpu.cmake b/3rdparty/stdgpu/stdgpu.cmake index f486fc3d4ce..fb9a64e09fd 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 + # 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 DOWNLOAD_DIR "${OPEN3D_THIRD_PARTY_DOWNLOAD_DIR}/stdgpu" UPDATE_COMMAND "" CMAKE_ARGS @@ -17,6 +18,7 @@ ExternalProject_Add( -DSTDGPU_BUILD_SHARED_LIBS=OFF -DSTDGPU_BUILD_EXAMPLES=OFF -DSTDGPU_BUILD_TESTS=OFF + -DSTDGPU_BUILD_BENCHMARKS=OFF -DSTDGPU_ENABLE_CONTRACT_CHECKS=OFF -DTHRUST_INCLUDE_DIR=${CUDAToolkit_INCLUDE_DIRS} ${ExternalProject_CMAKE_ARGS_hidden} diff --git a/CHANGELOG.md b/CHANGELOG.md index e5803ea862f..03818e01b47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ - `TriangleMesh`'s `+=` operator appends UVs regardless of the presence of existing features (PR #6728) - Fix build with fmt v10.2.0 (#6783) - Fix segmentation fault (lambda reference capture) of VisualizerWithCustomAnimation::Play (PR #6804) +- Python 3.12 support - Add O3DVisualizer API to enable collapse control of verts in the side panel (PR #6865) - Split pybind declarations/definitions to avoid C++ types in Python docs (PR #6869) - Fix minimal oriented bounding box of MeshBase derived classes and add new unit tests (PR #6898) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc2bdc62e15..7b047cd0b82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -387,10 +387,18 @@ 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) - if(BUILD_COMMON_CUDA_ARCHS) - if (CMAKE_CUDA_ARCHITECTURES) - message(STATUS "Building with user-provided architectures: ${CMAKE_CUDA_ARCHITECTURES}") - else() + # 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. " + "Set $Env:NVCC_PREPEND_FLAGS='--allow-unsupported-compiler' if nvcc still fails.") + endif() + if (CMAKE_CUDA_ARCHITECTURES) + message(STATUS "Building with user-provided CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}") + else() + if(BUILD_COMMON_CUDA_ARCHS) # Build with all supported architectures for previous 2 generations and # M0 (minor=0) architectures for previous generations (including # deprecated). Note that cubin for M0 runs on GPUs with architecture Mx. @@ -410,14 +418,14 @@ if(BUILD_CUDA_MODULE) set(CMAKE_CUDA_ARCHITECTURES 30-real 50-real 60-real 70-real 75) # Kepler, Maxwell, Pascal, Turing endif() message(STATUS "Using CUDA architectures: ${CMAKE_CUDA_ARCHITECTURES}") - endif() - else() - execute_process(COMMAND nvidia-smi RESULT_VARIABLE NVIDIA_CHECK OUTPUT_QUIET) - if (NVIDIA_CHECK EQUAL 0) - message(STATUS "Building with native CUDA architecture.") - set(CMAKE_CUDA_ARCHITECTURES native) else() - message(WARNING "No CUDA GPU detected. Building with CMake default CUDA architecture.") + execute_process(COMMAND nvidia-smi RESULT_VARIABLE NVIDIA_CHECK OUTPUT_QUIET) + if (NVIDIA_CHECK EQUAL 0) + message(STATUS "Building with native CUDA architecture.") + set(CMAKE_CUDA_ARCHITECTURES native) + else() + message(WARNING "No CUDA GPU detected. Building with CMake default CUDA architecture.") + endif() endif() endif() enable_language(CUDA) diff --git a/cpp/open3d/t/geometry/RaycastingScene.cpp b/cpp/open3d/t/geometry/RaycastingScene.cpp index bc003f8cbed..12f082d0ee1 100644 --- a/cpp/open3d/t/geometry/RaycastingScene.cpp +++ b/cpp/open3d/t/geometry/RaycastingScene.cpp @@ -33,7 +33,8 @@ typedef Eigen::Vector3f Vec3f; // Error function called by embree. void ErrorFunction(void* userPtr, enum RTCError error, const char* str) { - open3d::utility::LogError("embree error: {} {}", error, str); + open3d::utility::LogError("Embree error: {} {}", rtcGetErrorString(error), + str); } // Checks the last dim, ensures that the number of dims is >= min_ndim, checks diff --git a/cpp/open3d/t/io/file_format/FileASSIMP.cpp b/cpp/open3d/t/io/file_format/FileASSIMP.cpp index da23953fe79..7f7ce6a3cfb 100644 --- a/cpp/open3d/t/io/file_format/FileASSIMP.cpp +++ b/cpp/open3d/t/io/file_format/FileASSIMP.cpp @@ -245,7 +245,7 @@ bool WriteTriangleMeshUsingASSIMP(const std::string& filename, if (mesh.HasTriangleColors()) { utility::LogWarning( "Exporting triangle colors is not supported. Please convert to " - "vertex colors or export to a format that supporst it."); + "vertex colors or export to a format that supports it."); } Assimp::Exporter exporter; diff --git a/cpp/pybind/core/tensor_converter.cpp b/cpp/pybind/core/tensor_converter.cpp index 018d857e5ed..1e07ad91d0c 100644 --- a/cpp/pybind/core/tensor_converter.cpp +++ b/cpp/pybind/core/tensor_converter.cpp @@ -106,10 +106,10 @@ Tensor PyArrayToTensor(py::array array, bool inplace) { Dtype dtype = pybind_utils::ArrayFormatToDtype(info.format, info.itemsize); Device device("CPU:0"); - array.inc_ref(); - std::function deleter = [array](void*) -> void { + auto shared_array = std::make_shared(array); + std::function deleter = [shared_array](void*) mutable -> void { py::gil_scoped_acquire acquire; - array.dec_ref(); + shared_array.reset(); }; auto blob = std::make_shared(device, info.ptr, deleter); Tensor t_inplace(shape, strides, info.ptr, dtype, blob); diff --git a/docker/Dockerfile.wheel b/docker/Dockerfile.wheel index 8faa243bf26..25372da258d 100644 --- a/docker/Dockerfile.wheel +++ b/docker/Dockerfile.wheel @@ -1,5 +1,5 @@ # FROM must be called before other ARGS except for ARG BASE_IMAGE -ARG BASE_IMAGE=nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04 +ARG BASE_IMAGE=nvidia/cuda:12.1.0-cudnn8-devel-ubuntu20.04 FROM ${BASE_IMAGE} # Customizable build arguments from cuda.yml @@ -98,7 +98,7 @@ RUN which python \ # Checkout Open3D-ML main branch # TODO: We may add support for local Open3D-ML repo or pinned ML repo tag ENV OPEN3D_ML_ROOT=/root/Open3D-ML -RUN git clone https://github.com/isl-org/Open3D-ML.git ${OPEN3D_ML_ROOT} +RUN git clone --depth 1 https://github.com/isl-org/Open3D-ML.git ${OPEN3D_ML_ROOT} # Open3D C++ dependencies # Done before copying the full Open3D directory for better Docker caching @@ -112,7 +112,7 @@ COPY ./python/requirements.txt /root/Open3D/python/ COPY ./python/requirements_jupyter_build.txt /root/Open3D/python/ COPY ./python/requirements_jupyter_install.txt /root/Open3D/python/ RUN source /root/Open3D/util/ci_utils.sh \ - && install_python_dependencies with-cuda with-jupyter + && install_python_dependencies with-jupyter # Open3D Jupyter dependencies RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \ diff --git a/docker/README.md b/docker/README.md index 6922834cbf7..cd3a8198579 100644 --- a/docker/README.md +++ b/docker/README.md @@ -26,7 +26,7 @@ to install Nvidia Docker to run the CUDA container. To verify that the Nvidia Docker is working, run: ```bash -docker run --rm --gpus all nvidia/cuda:11.7-base nvidia-smi +docker run --rm --gpus all nvidia/cuda:12.1-base nvidia-smi ``` ### ARM64 Docker diff --git a/docker/docker_build.sh b/docker/docker_build.sh index bc150b06e11..c92aed26829 100755 --- a/docker/docker_build.sh +++ b/docker/docker_build.sh @@ -27,20 +27,24 @@ OPTION: openblas-amd64-py39-dev : OpenBLAS AMD64 3.9 wheel, developer mode openblas-amd64-py310-dev : OpenBLAS AMD64 3.10 wheel, developer mode openblas-amd64-py311-dev : OpenBLAS AMD64 3.11 wheel, developer mode + openblas-amd64-py312-dev : OpenBLAS AMD64 3.12 wheel, developer mode openblas-amd64-py38 : OpenBLAS AMD64 3.8 wheel, release mode openblas-amd64-py39 : OpenBLAS AMD64 3.9 wheel, release mode openblas-amd64-py310 : OpenBLAS AMD64 3.10 wheel, release mode openblas-amd64-py311 : OpenBLAS AMD64 3.11 wheel, release mode + openblas-amd64-py312 : OpenBLAS AMD64 3.12 wheel, release mode # OpenBLAS ARM64 (Dockerfile.openblas) openblas-arm64-py38-dev : OpenBLAS ARM64 3.8 wheel, developer mode openblas-arm64-py39-dev : OpenBLAS ARM64 3.9 wheel, developer mode openblas-arm64-py310-dev : OpenBLAS ARM64 3.10 wheel, developer mode openblas-arm64-py311-dev : OpenBLAS ARM64 3.11 wheel, developer mode + openblas-arm64-py312-dev : OpenBLAS ARM64 3.12 wheel, developer mode openblas-arm64-py38 : OpenBLAS ARM64 3.8 wheel, release mode openblas-arm64-py39 : OpenBLAS ARM64 3.9 wheel, release mode openblas-arm64-py310 : OpenBLAS ARM64 3.10 wheel, release mode openblas-arm64-py311 : OpenBLAS ARM64 3.11 wheel, release mode + openblas-arm64-py312 : OpenBLAS ARM64 3.12 wheel, release mode # Ubuntu CPU CI (Dockerfile.ci) cpu-static : Ubuntu CPU static @@ -66,10 +70,12 @@ OPTION: cuda_wheel_py39_dev : CUDA Python 3.9 wheel, developer mode cuda_wheel_py310_dev : CUDA Python 3.10 wheel, developer mode cuda_wheel_py311_dev : CUDA Python 3.11 wheel, developer mode + cuda_wheel_py312_dev : CUDA Python 3.12 wheel, developer mode cuda_wheel_py38 : CUDA Python 3.8 wheel, release mode cuda_wheel_py39 : CUDA Python 3.9 wheel, release mode cuda_wheel_py310 : CUDA Python 3.10 wheel, release mode cuda_wheel_py311 : CUDA Python 3.11 wheel, release mode + cuda_wheel_py312 : CUDA Python 3.12 wheel, release mode " HOST_OPEN3D_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pwd)" @@ -78,8 +84,8 @@ HOST_OPEN3D_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. >/dev/null 2>&1 && pw CCACHE_VERSION=4.3 CMAKE_VERSION=cmake-3.24.4-linux-x86_64 CMAKE_VERSION_AARCH64=cmake-3.24.4-linux-aarch64 -CUDA_VERSION=11.7.1-cudnn8 -CUDA_VERSION_LATEST=11.8.0-cudnn8 +CUDA_VERSION=12.1.0-cudnn8 +CUDA_VERSION_LATEST=12.1.0-cudnn8 print_usage_and_exit_docker_build() { echo "$__usage_docker_build" @@ -128,6 +134,9 @@ openblas_export_env() { elif [[ "py311" =~ ^($options)$ ]]; then export PYTHON_VERSION=3.11 export DOCKER_TAG=${DOCKER_TAG}-py311 + elif [[ "py312" =~ ^($options)$ ]]; then + export PYTHON_VERSION=3.12 + export DOCKER_TAG=${DOCKER_TAG}-py312 else echo "Invalid python version." print_usage_and_exit_docker_build @@ -182,6 +191,8 @@ cuda_wheel_build() { PYTHON_VERSION=3.10 elif [[ "py311" =~ ^($options)$ ]]; then PYTHON_VERSION=3.11 + elif [[ "py312" =~ ^($options)$ ]]; then + PYTHON_VERSION=3.12 else echo "Invalid python version." print_usage_and_exit_docker_build @@ -311,7 +322,7 @@ ci_build() { export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 export DEVELOPER_BUILD=ON export CCACHE_TAR_NAME=open3d-ci-4-shared-focal - export PYTHON_VERSION=3.8 + export PYTHON_VERSION=3.12 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=ON # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -327,7 +338,7 @@ ci_build() { export BASE_IMAGE=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu20.04 export DEVELOPER_BUILD=OFF export CCACHE_TAR_NAME=open3d-ci-4-shared-focal - export PYTHON_VERSION=3.8 + export PYTHON_VERSION=3.12 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=ON # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -374,7 +385,7 @@ cpu-shared_export_env() { export BASE_IMAGE=ubuntu:20.04 export DEVELOPER_BUILD=ON export CCACHE_TAR_NAME=open3d-ci-cpu - export PYTHON_VERSION=3.8 + export PYTHON_VERSION=3.12 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=OFF # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -406,7 +417,7 @@ cpu-shared-release_export_env() { export BASE_IMAGE=ubuntu:20.04 export DEVELOPER_BUILD=OFF export CCACHE_TAR_NAME=open3d-ci-cpu - export PYTHON_VERSION=3.8 + export PYTHON_VERSION=3.12 # no TF versions after 2.13.2 for Python 3.8 export BUILD_SHARED_LIBS=ON export BUILD_CUDA_MODULE=OFF # TODO: tensorflow tests moved here till PyTorch supports cxx11_abi @@ -490,6 +501,10 @@ function main() { openblas_export_env amd64 py311 dev openblas_build ;; + openblas-amd64-py312-dev) + openblas_export_env amd64 py312 dev + openblas_build + ;; openblas-amd64-py38) openblas_export_env amd64 py38 openblas_build @@ -506,6 +521,10 @@ function main() { openblas_export_env amd64 py311 openblas_build ;; + openblas-amd64-py312) + openblas_export_env amd64 py312 + openblas_build + ;; # OpenBLAS ARM64 openblas-arm64-py38-dev) @@ -524,6 +543,10 @@ function main() { openblas_export_env arm64 py311 dev openblas_build ;; + openblas-arm64-py312-dev) + openblas_export_env arm64 py312 dev + openblas_build + ;; openblas-arm64-py38) openblas_export_env arm64 py38 openblas_build @@ -540,6 +563,10 @@ function main() { openblas_export_env arm64 py311 openblas_build ;; + openblas-arm64-py312) + openblas_export_env arm64 py312 + openblas_build + ;; # CPU CI cpu-static) @@ -586,6 +613,9 @@ function main() { cuda_wheel_py311_dev) cuda_wheel_build py311 dev ;; + cuda_wheel_py312_dev) + cuda_wheel_build py312 dev + ;; cuda_wheel_py38) cuda_wheel_build py38 ;; @@ -598,6 +628,9 @@ function main() { cuda_wheel_py311) cuda_wheel_build py311 ;; + cuda_wheel_py312) + cuda_wheel_build py312 + ;; # ML CIs 2-focal) diff --git a/docker/docker_test.sh b/docker/docker_test.sh index d328d14535d..a7ab13fbc3c 100755 --- a/docker/docker_test.sh +++ b/docker/docker_test.sh @@ -20,20 +20,24 @@ OPTION: openblas-amd64-py39-dev : OpenBLAS AMD64 3.9 wheel, developer mode openblas-amd64-py310-dev : OpenBLAS AMD64 3.10 wheel, developer mode openblas-amd64-py311-dev : OpenBLAS AMD64 3.11 wheel, developer mode + openblas-amd64-py312-dev : OpenBLAS AMD64 3.12 wheel, developer mode openblas-amd64-py38 : OpenBLAS AMD64 3.8 wheel, release mode openblas-amd64-py39 : OpenBLAS AMD64 3.9 wheel, release mode openblas-amd64-py310 : OpenBLAS AMD64 3.10 wheel, release mode openblas-amd64-py311 : OpenBLAS AMD64 3.11 wheel, release mode + openblas-amd64-py312 : OpenBLAS AMD64 3.12 wheel, release mode # OpenBLAS ARM64 (Dockerfile.openblas) openblas-arm64-py38-dev : OpenBLAS ARM64 3.8 wheel, developer mode openblas-arm64-py39-dev : OpenBLAS ARM64 3.9 wheel, developer mode openblas-arm64-py310-dev : OpenBLAS ARM64 3.10 wheel, developer mode openblas-arm64-py311-dev : OpenBLAS ARM64 3.11 wheel, developer mode + openblas-arm64-py312-dev : OpenBLAS ARM64 3.12 wheel, developer mode openblas-arm64-py38 : OpenBLAS ARM64 3.8 wheel, release mode openblas-arm64-py39 : OpenBLAS ARM64 3.9 wheel, release mode openblas-arm64-py310 : OpenBLAS ARM64 3.10 wheel, release mode openblas-arm64-py311 : OpenBLAS ARM64 3.11 wheel, release mode + openblas-arm64-py312 : OpenBLAS ARM64 3.12 wheel, release mode # Ubuntu CPU CI (Dockerfile.ci) cpu-static : Ubuntu CPU static @@ -228,6 +232,11 @@ openblas-amd64-py311-dev) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-amd64-py312-dev) + openblas_export_env amd64 py312 dev + openblas_print_env + cpp_python_linking_uninstall_test + ;; openblas-amd64-py38) openblas_export_env amd64 py38 openblas_print_env @@ -248,6 +257,11 @@ openblas-amd64-py311) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-amd64-py312) + openblas_export_env amd64 py312 + openblas_print_env + cpp_python_linking_uninstall_test + ;; # OpenBLAS ARM64 openblas-arm64-py38-dev) @@ -270,6 +284,11 @@ openblas-arm64-py311-dev) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-arm64-py312-dev) + openblas_export_env arm64 py312 dev + openblas_print_env + cpp_python_linking_uninstall_test + ;; openblas-arm64-py38) openblas_export_env arm64 py38 openblas_print_env @@ -290,6 +309,11 @@ openblas-arm64-py311) openblas_print_env cpp_python_linking_uninstall_test ;; +openblas-arm64-py312) + openblas_export_env arm64 py312 + openblas_print_env + cpp_python_linking_uninstall_test + ;; # CPU CI cpu-static) diff --git a/docs/arm.rst b/docs/arm.rst index e9f9c942413..35ddf813bed 100644 --- a/docs/arm.rst +++ b/docs/arm.rst @@ -71,6 +71,7 @@ commands: ./docker_build.sh openblas-arm64-py39 # Python 3.9 ./docker_build.sh openblas-arm64-py310 # Python 3.10 ./docker_build.sh openblas-arm64-py311 # Python 3.11 + ./docker_build.sh openblas-arm64-py312 # Python 3.12 After running ``docker_build.sh``, you shall see a ``.whl`` file generated the current directly on the host. Then simply install the ``.whl`` file by: diff --git a/docs/getting_started.in.rst b/docs/getting_started.in.rst index 734cb694e1c..efa04016fce 100644 --- a/docs/getting_started.in.rst +++ b/docs/getting_started.in.rst @@ -32,6 +32,7 @@ Supported Python versions: * 3.9 * 3.10 * 3.11 +* 3.12 Supported operating systems: @@ -53,7 +54,7 @@ Pip (PyPI) .. warning:: Versions of ``numpy>=2.0.0`` require ``Open3D>0.18.0`` or the latest development - version of Open3D. If you are using an older version of Open3D, downgrade ``numpy`` + version of Open3D. If you are using an older version of Open3D, downgrade ``numpy`` with .. code-block:: bash @@ -99,24 +100,28 @@ version (``HEAD`` of ``main`` branch): - `Python 3.9 `__ - `Python 3.10 `__ - `Python 3.11 `__ + - `Python 3.12 `__ * - Linux (CPU) - `Python 3.8 `__ - `Python 3.9 `__ - `Python 3.10 `__ - `Python 3.11 `__ + - `Python 3.12 `__ * - MacOS - `Python 3.8 (x86_64) `__ - `Python 3.9 (x86_64) `__ - `Python 3.10 (x86_64+arm64) `__ - `Python 3.11 (x86_64+arm64) `__ + - `Python 3.12 (x86_64+arm64) `__ * - Windows - `Python 3.8 `__ - `Python 3.9 `__ - `Python 3.10 `__ - `Python 3.11 `__ + - `Python 3.12 `__ Please use these links from the `latest version of this page `__ only. You can also diff --git a/python/README.rst b/python/README.rst index 0c225d07581..e266c2904ab 100644 --- a/python/README.rst +++ b/python/README.rst @@ -48,6 +48,7 @@ With Python versions: * 3.9 * 3.10 * 3.11 +* 3.12 Resources ====================== diff --git a/python/open3d/ml/tf/python/layers/neighbor_search.py b/python/open3d/ml/tf/python/layers/neighbor_search.py index 8a9059ef485..d13dd799d11 100644 --- a/python/open3d/ml/tf/python/layers/neighbor_search.py +++ b/python/open3d/ml/tf/python/layers/neighbor_search.py @@ -121,6 +121,11 @@ def call(self, queries_row_splits = queries.row_splits queries = queries.values + if isinstance(radius, tf.Tensor): + radius_ = tf.cast(radius, points.dtype) + else: + radius_ = radius + if points_row_splits is None: points_row_splits = tf.cast(tf.stack([0, tf.shape(points)[0]]), dtype=tf.int64) @@ -131,7 +136,7 @@ def call(self, table = ops.build_spatial_hash_table( max_hash_table_size=self.max_hash_table_size, points=points, - radius=radius, + radius=radius_, points_row_splits=points_row_splits, hash_table_size_factor=hash_table_size_factor) else: @@ -142,7 +147,7 @@ def call(self, metric=self.metric, points=points, queries=queries, - radius=radius, + radius=radius_, points_row_splits=points_row_splits, queries_row_splits=queries_row_splits, hash_table_splits=table.hash_table_splits, diff --git a/python/requirements.txt b/python/requirements.txt index 148650326df..a7da4963446 100644 --- a/python/requirements.txt +++ b/python/requirements.txt @@ -1,5 +1,6 @@ numpy>=1.18.0,<2.0.0 dash>=2.6.0 -werkzeug>=2.2.3 +werkzeug>=3.0.0 +flask>=3.0.0 nbformat>=5.7.0 configargparse diff --git a/python/requirements_test.txt b/python/requirements_test.txt index 7bb3fd72143..38caaf57575 100644 --- a/python/requirements_test.txt +++ b/python/requirements_test.txt @@ -1,6 +1,8 @@ pytest==7.1.2 pytest-randomly==3.8.0 -scipy==1.10.1 -tensorboard==2.13.0 +scipy==1.10.1; python_version < "3.12" +scipy==1.11.4; python_version >= "3.12" +tensorboard==2.13.0; python_version < "3.12" +tensorboard==2.16.2; python_version >= "3.12" oauthlib==3.2.2 certifi==2024.7.4 diff --git a/python/setup.py b/python/setup.py index e32f69ab615..70b840cb801 100644 --- a/python/setup.py +++ b/python/setup.py @@ -136,6 +136,7 @@ def finalize_options(self): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Education", "Topic :: Multimedia :: Graphics :: 3D Modeling", "Topic :: Multimedia :: Graphics :: 3D Rendering", diff --git a/python/test/ml_ops/test_sparseconv.py b/python/test/ml_ops/test_sparseconv.py index 1fd6ed5058b..71a019ccc50 100644 --- a/python/test/ml_ops/test_sparseconv.py +++ b/python/test/ml_ops/test_sparseconv.py @@ -89,9 +89,15 @@ def bias_initializer(a): if ml.module.__name__ == 'torch': sparse_conv.to(ml.device) - y = mltest.run_op(ml, ml.device, True, sparse_conv, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, inp_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + inp_importance=inp_importance) # Compare the output to a standard 3d conv # store features in a volume to use standard 3d convs @@ -210,9 +216,15 @@ def test_compare_to_conv3d_batches(ml, dtype, kernel_size, out_channels, inp_features = tf.RaggedTensor.from_row_splits( values=inp_features, row_splits=inp_positions_row_splits) - y = mltest.run_op(ml, ml.device, True, sparse_conv, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, inp_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + inp_importance=inp_importance) for idx in range(batch_size): inp_pos = inp_positions[idx].numpy() inp_feat = inp_features[idx].numpy() @@ -336,9 +348,15 @@ def bias_initializer(a): if ml.module.__name__ == 'torch': sparse_conv_transpose.to(ml.device) - y = mltest.run_op(ml, ml.device, True, sparse_conv_transpose, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, out_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv_transpose, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + out_importance=out_importance) # Compare the output to a standard 3d conv # store features in a volume to use standard 3d convs @@ -463,9 +481,15 @@ def test_compare_to_conv3dtranspose_batches(ml, dtype, kernel_size, inp_features = tf.RaggedTensor.from_row_splits( values=inp_features, row_splits=inp_positions_row_splits) - y = mltest.run_op(ml, ml.device, True, sparse_conv_transpose, inp_features, - inp_positions * voxel_size, out_positions * voxel_size, - voxel_size, out_importance) + y = mltest.run_op(ml, + ml.device, + True, + sparse_conv_transpose, + inp_features, + inp_positions * voxel_size, + out_positions * voxel_size, + voxel_size=voxel_size, + out_importance=out_importance) for idx in range(batch_size): inp_pos = inp_positions[idx].numpy() inp_feat = inp_features[idx].numpy() 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 diff --git a/util/ci_utils.sh b/util/ci_utils.sh index 93e48c2e463..5ba30b071dc 100644 --- a/util/ci_utils.sh +++ b/util/ci_utils.sh @@ -25,8 +25,8 @@ LOW_MEM_USAGE=${LOW_MEM_USAGE:-OFF} # Dependency versions: # CUDA: see docker/docker_build.sh # ML -TENSORFLOW_VER="2.13.0" -TORCH_VER="2.0.1" +TENSORFLOW_VER="2.16.2" +TORCH_VER="2.2.2" TORCH_REPO_URL="https://download.pytorch.org/whl/torch/" # Python PIP_VER="23.2.1" @@ -362,8 +362,7 @@ install_docs_dependencies() { echo Installing Open3D-ML dependencies from "${OPEN3D_ML_ROOT}" python -m pip install -r "${OPEN3D_ML_ROOT}/requirements.txt" python -m pip install -r "${OPEN3D_ML_ROOT}/requirements-torch.txt" - python -m pip install -r "${OPEN3D_ML_ROOT}/requirements-tensorflow.txt" || - python -m pip install tensorflow # FIXME: Remove after Open3D-ML update + python -m pip install -r "${OPEN3D_ML_ROOT}/requirements-tensorflow.txt" else echo OPEN3D_ML_ROOT="$OPEN3D_ML_ROOT" not specified or invalid. Skipping ML dependencies. fi