diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 9ae3b3bfce5..a184df2ec42 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -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 }} @@ -68,15 +68,9 @@ 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) @@ -84,7 +78,6 @@ jobs: # 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 @@ -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 @@ -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' }} @@ -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 @@ -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 @@ -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' }} diff --git a/.github/workflows/ubuntu-cuda.yml b/.github/workflows/ubuntu-cuda.yml index daab8f7af61..00dd303dcf1 100644 --- a/.github/workflows/ubuntu-cuda.yml +++ b/.github/workflows/ubuntu-cuda.yml @@ -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() diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b047cd0b82..08a49c5476c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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($<$:"/permissive-">) # Make sure we don't hit the 65535 object member limit with MSVC # # /bigobj allows object files with more than 65535 members diff --git a/cpp/open3d/CMakeLists.txt b/cpp/open3d/CMakeLists.txt index e31bb2b83f3..00b04684b2c 100644 --- a/cpp/open3d/CMakeLists.txt +++ b/cpp/open3d/CMakeLists.txt @@ -89,6 +89,7 @@ target_sources(Open3D PRIVATE open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE camera core + core_impl data geometry tgeometry @@ -101,6 +102,7 @@ open3d_ispc_target_sources_TARGET_OBJECTS(Open3D PRIVATE tpipelines_kernel utility visualization + visualization_impl ) if (BUILD_GUI) diff --git a/cpp/open3d/core/CMakeLists.txt b/cpp/open3d/core/CMakeLists.txt index 7926d3fbcc6..c34cea3fc6d 100644 --- a/cpp/open3d/core/CMakeLists.txt +++ b/cpp/open3d/core/CMakeLists.txt @@ -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 @@ -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 @@ -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 ) @@ -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() diff --git a/cpp/open3d/core/SYCLContext.cpp b/cpp/open3d/core/SYCLContext.cpp index b7ac71d1045..30c5f6f6afc 100644 --- a/cpp/open3d/core/SYCLContext.cpp +++ b/cpp/open3d/core/SYCLContext.cpp @@ -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) { diff --git a/cpp/open3d/core/SYCLUtils.cpp b/cpp/open3d/core/SYCLUtils.cpp index d92e44fe509..011ee5eb653 100644 --- a/cpp/open3d/core/SYCLUtils.cpp +++ b/cpp/open3d/core/SYCLUtils.cpp @@ -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 &platforms = @@ -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 diff --git a/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp b/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp index 994dbc6e8c8..2774b314364 100644 --- a/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp +++ b/cpp/open3d/geometry/SurfaceReconstructionBallPivoting.cpp @@ -17,6 +17,7 @@ namespace open3d { namespace geometry { +namespace { class BallPivotingVertex; class BallPivotingEdge; @@ -733,6 +734,7 @@ class BallPivoting { std::vector vertices; std::shared_ptr mesh_; }; +} // namespace std::shared_ptr TriangleMesh::CreateFromPointCloudBallPivoting( const PointCloud& pcd, const std::vector& radii) { diff --git a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp index a1553d6a653..7195166701f 100644 --- a/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp +++ b/cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp @@ -39,7 +39,7 @@ namespace open3d { namespace geometry { -namespace poisson { +namespace { // The order of the B-Spline used to splat in data for color interpolation static const int DATA_DEGREE = 0; @@ -713,7 +713,7 @@ void Execute(const open3d::geometry::PointCloud& pcd, Time() - startTime, FEMTree::MaxMemoryUsage()); } -} // namespace poisson +} // namespace std::tuple, std::vector> TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd, @@ -722,10 +722,9 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd, float scale, bool linear_fit, int n_threads) { - static const BoundaryType BType = poisson::DEFAULT_FEM_BOUNDARY; + static const BoundaryType BType = DEFAULT_FEM_BOUNDARY; typedef IsotropicUIntPack< - poisson::DIMENSION, - FEMDegreeAndBType::Signature> + DIMENSION, FEMDegreeAndBType::Signature> FEMSigs; if (!pcd.HasNormals()) { @@ -746,8 +745,8 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd, auto mesh = std::make_shared(); std::vector densities; - poisson::Execute(pcd, mesh, densities, static_cast(depth), - width, scale, linear_fit, FEMSigs()); + Execute(pcd, mesh, densities, static_cast(depth), width, scale, + linear_fit, FEMSigs()); ThreadPool::Terminate(); diff --git a/cpp/open3d/visualization/CMakeLists.txt b/cpp/open3d/visualization/CMakeLists.txt index fd794dcea24..8cf18c2088c 100644 --- a/cpp/open3d/visualization/CMakeLists.txt +++ b/cpp/open3d/visualization/CMakeLists.txt @@ -1,6 +1,9 @@ open3d_ispc_add_library(visualization OBJECT) -target_sources(visualization PRIVATE +open3d_ispc_add_library(visualization_impl OBJECT) +set_target_properties(visualization_impl PROPERTIES CXX_VISIBILITY_PRESET hidden) + +target_sources(visualization_impl PRIVATE shader/GeometryRenderer.cpp shader/ImageMaskShader.cpp shader/ImageShader.cpp @@ -62,14 +65,14 @@ if (BUILD_GUI) rendering/Renderer.cpp rendering/RendererHandle.cpp rendering/RotationInteractorLogic.cpp + rendering/filament/FilamentEngine.cpp + rendering/filament/FilamentRenderer.cpp ) - target_sources(visualization PRIVATE + target_sources(visualization_impl PRIVATE rendering/filament/FilamentCamera.cpp - rendering/filament/FilamentEngine.cpp rendering/filament/FilamentEntitiesMods.cpp rendering/filament/FilamentGeometryBuffersBuilder.cpp - rendering/filament/FilamentRenderer.cpp rendering/filament/FilamentRenderToBuffer.cpp rendering/filament/FilamentResourceManager.cpp rendering/filament/FilamentScene.cpp @@ -131,7 +134,7 @@ open3d_add_encoded_shader(shader # Source group for Visual Studio add_source_group(shader/glsl) -add_dependencies(visualization shader) +add_dependencies(visualization_impl shader) open3d_show_and_abort_on_warning(visualization) @@ -139,6 +142,11 @@ open3d_set_global_properties(visualization) open3d_set_open3d_lib_properties(visualization) open3d_link_3rdparty_libraries(visualization) +open3d_show_and_abort_on_warning(visualization_impl) +open3d_set_global_properties(visualization_impl) +open3d_set_open3d_lib_properties(visualization_impl) +open3d_link_3rdparty_libraries(visualization_impl) + # export GUI_RESOURCE_DIR to parent scope if (BUILD_GUI) set(GUI_RESOURCE_DIR ${GUI_RESOURCE_DIR} PARENT_SCOPE) diff --git a/cpp/pybind/core/sycl_utils.cpp b/cpp/pybind/core/sycl_utils.cpp index ea37e0b3961..9a28dcb5072 100644 --- a/cpp/pybind/core/sycl_utils.cpp +++ b/cpp/pybind/core/sycl_utils.cpp @@ -23,6 +23,12 @@ void pybind_sycl_utils_definitions(py::module& m) { m_sycl.def("get_available_devices", sy::GetAvailableSYCLDevices, "Return a list of available SYCL devices."); + m_sycl.def("print_sycl_devices", sy::PrintSYCLDevices, + "print_all"_a = false, + "Print SYCL device available to Open3D (either the best " + "available GPU, or a fallback CPU device). If `print_all` is " + "specified, also print SYCL devices of other types."); + m_sycl.def("enable_persistent_jit_cache", sy::enablePersistentJITCache, "Enables the JIT cache for SYCL. This sets an environment " "variable and " diff --git a/cpp/tests/core/CoreTest.cpp b/cpp/tests/core/CoreTest.cpp index babfc30a0e3..8f1486ce4c6 100644 --- a/cpp/tests/core/CoreTest.cpp +++ b/cpp/tests/core/CoreTest.cpp @@ -105,7 +105,11 @@ PermuteDevicePairsWithSYCL::TestCases() { std::vector devices; devices.insert(devices.end(), cpu_devices.begin(), cpu_devices.end()); devices.insert(devices.end(), cuda_devices.begin(), cuda_devices.end()); - devices.insert(devices.end(), sycl_devices.begin(), sycl_devices.end()); + // Skip the last SYCL device - this is the CPU fallback + if (sycl_devices.size() > 1) { + devices.insert(devices.end(), sycl_devices.begin(), + sycl_devices.end() - 1); + } // Self-pairs and cross pairs (bidirectional). std::vector> device_pairs; diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci index ac98e50236f..189fa6c50b0 100755 --- a/docker/Dockerfile.ci +++ b/docker/Dockerfile.ci @@ -141,10 +141,10 @@ RUN CCACHE_DIR=$(ccache -p | grep cache_dir | grep -oE "[^ ]+$") \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && mkdir -p ${CCACHE_DIR_PARENT} \ && cd ${CCACHE_DIR_PARENT} \ - && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ - && if [ -f ${CCACHE_TAR_NAME}.tar.gz ]; then tar -xf ${CCACHE_TAR_NAME}.tar.gz; fi \ + && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.xz https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ + && if [ -f ${CCACHE_TAR_NAME}.tar.?z ]; then tar -xf ${CCACHE_TAR_NAME}.tar.?z; fi \ && mkdir -p ${CCACHE_DIR} \ - && ccache -M 5G \ + && ccache -M 4G \ && ccache -s # Checkout Open3D-ML main branch @@ -235,7 +235,7 @@ RUN ccache -s \ && CCACHE_DIR_NAME=$(basename ${CCACHE_DIR}) \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && cd ${CCACHE_DIR_PARENT} \ - && tar -czf /${CCACHE_TAR_NAME}.tar.gz ${CCACHE_DIR_NAME} \ + && tar -caf /${CCACHE_TAR_NAME}.tar.xz ${CCACHE_DIR_NAME} \ && if [ "${PACKAGE}" = "ON" ]; then mv /root/Open3D/build/package/open3d-devel*.tar.xz /; fi \ && if [ "${PACKAGE}" = "VIEWER" ]; then mv /root/Open3D/build/package-Open3DViewer-deb/open3d-viewer-*-Linux.deb /; fi \ && ls -alh / diff --git a/docker/Dockerfile.wheel b/docker/Dockerfile.wheel index 25372da258d..eb60286b620 100644 --- a/docker/Dockerfile.wheel +++ b/docker/Dockerfile.wheel @@ -76,11 +76,11 @@ RUN CCACHE_DIR=$(ccache -p | grep cache_dir | grep -oE "[^ ]+$") \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && mkdir -p ${CCACHE_DIR_PARENT} \ && cd ${CCACHE_DIR_PARENT} \ - && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ - && if [ -f ${CCACHE_TAR_NAME}.tar.gz ]; then tar -xf ${CCACHE_TAR_NAME}.tar.gz; fi + && (wget -q https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.xz https://storage.googleapis.com/open3d-ci-cache/${CCACHE_TAR_NAME}.tar.gz || true) \ + && if [ -f ${CCACHE_TAR_NAME}.tar.?z ]; then tar -xf ${CCACHE_TAR_NAME}.tar.?z; fi # We need to set ccache size explicitly with -M, otherwise the default size is # *not* determined by ccache's default, but the downloaded ccache file's config. -RUN ccache -M 5G \ +RUN ccache -M 4G \ && ccache -s # Miniconda @@ -141,6 +141,6 @@ RUN ccache -s \ && CCACHE_DIR_NAME=$(basename ${CCACHE_DIR}) \ && CCACHE_DIR_PARENT=$(dirname ${CCACHE_DIR}) \ && cd ${CCACHE_DIR_PARENT} \ - && tar -czf /${CCACHE_TAR_NAME}.tar.gz ${CCACHE_DIR_NAME} + && tar -caf /${CCACHE_TAR_NAME}.tar.xz ${CCACHE_DIR_NAME} RUN echo "Docker build done." diff --git a/docker/docker_build.sh b/docker/docker_build.sh index 56cc75fb030..e6c22bb10df 100755 --- a/docker/docker_build.sh +++ b/docker/docker_build.sh @@ -225,9 +225,9 @@ cuda_wheel_build() { python_package_dir=/root/Open3D/build/lib/python_package docker run -v "${PWD}:/opt/mount" --rm open3d-ci:wheel \ bash -c "cp ${python_package_dir}/pip_package/open3d*.whl /opt/mount \ - && cp /${CCACHE_TAR_NAME}.tar.gz /opt/mount \ + && cp /${CCACHE_TAR_NAME}.tar.xz /opt/mount \ && chown $(id -u):$(id -g) /opt/mount/open3d*.whl \ - && chown $(id -u):$(id -g) /opt/mount/${CCACHE_TAR_NAME}.tar.gz" + && chown $(id -u):$(id -g) /opt/mount/${CCACHE_TAR_NAME}.tar.xz" } ci_build() { @@ -417,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.12 # no TF versions after 2.13.2 for Python 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 diff --git a/python/test/open3d_test.py b/python/test/open3d_test.py index f72a14ec58d..21fb7bf9c51 100755 --- a/python/test/open3d_test.py +++ b/python/test/open3d_test.py @@ -20,14 +20,15 @@ def list_devices(enable_cuda=True, enable_sycl=False): Returns a list of devices that are available for Open3D to use: - Device("CPU:0") - Device("CUDA:0") if built with CUDA support and a CUDA device is available. - - Device("SYCL:0") if built with SYCL support and a SYCL device is available. + - Device("SYCL:0") if built with SYCL support and a SYCL GPU device is available. """ import open3d as o3d devices = [o3d.core.Device("CPU:0")] if enable_cuda and o3d.core.cuda.device_count() > 0: devices.append(o3d.core.Device("CUDA:0")) - if enable_sycl and o3d.core.sycl.is_available(): + # Ignore fallback SYCL CPU device + if enable_sycl and len(o3d.core.sycl.get_available_devices()) > 1: devices.append(o3d.core.Device("SYCL:0")) return devices diff --git a/python/test/t/geometry/test_raycasting_scene.py b/python/test/t/geometry/test_raycasting_scene.py index 7820ff3e31c..2164f96d6fe 100755 --- a/python/test/t/geometry/test_raycasting_scene.py +++ b/python/test/t/geometry/test_raycasting_scene.py @@ -403,25 +403,58 @@ def test_sphere_wrong_occupancy(): occupancy = scene.compute_occupancy(query_points) expected = np.array( - [[[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], - [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], - [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]], - [[0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], - [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]]], - dtype=np.float32) + [ + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 1.0, 1.0, 1.0, 1.0, 0.0], + [0.0, 0.0, 1.0, 1.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + [ + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + [0.0, 0.0, 0.0, 0.0, 0.0, 0.0], + ], + ], + dtype=np.float32, + ) np.testing.assert_equal(occupancy.numpy(), expected) # we should get the same result with more samples diff --git a/util/ci_utils.sh b/util/ci_utils.sh index 5ba30b071dc..1adb4b7d8c5 100644 --- a/util/ci_utils.sh +++ b/util/ci_utils.sh @@ -50,7 +50,7 @@ install_python_dependencies() { if [[ "with-cuda" =~ ^($options)$ ]]; then TF_ARCH_NAME=tensorflow TF_ARCH_DISABLE_NAME=tensorflow-cpu - CUDA_VER=$(nvcc --version | grep "release " | cut -c33-37 | sed 's|[^0-9]||g') # e.g.: 117, 118, 121, ... + CUDA_VER=$(nvcc --version | grep "release " | cut -c33-37 | sed 's|[^0-9]||g') # e.g.: 117, 118, 121, ... TORCH_GLNX="torch==${TORCH_VER}+cu${CUDA_VER}" else # tensorflow-cpu wheels for macOS arm64 are not available @@ -260,14 +260,16 @@ test_wheel() { # find "$DLL_PATH"/cpu/ -type f -execdir otool -L {} \; # fi echo - if [ "$BUILD_PYTORCH_OPS" == ON ]; then + if python -c "import sys, open3d; sys.exit(not open3d._build_config['BUILD_PYTORCH_OPS'])"; then + BUILD_PYTORCH_OPS=ON python -m pip install -r "$OPEN3D_ML_ROOT/requirements-torch.txt" - python -W default -c \ + python -W default -c \ "import open3d.ml.torch; print('PyTorch Ops library loaded:', open3d.ml.torch._loaded)" fi - if [ "$BUILD_TENSORFLOW_OPS" == ON ]; then + if python -c "import sys, open3d; sys.exit(not open3d._build_config['BUILD_TENSORFLOW_OPS'])"; then + BUILD_TENSORFLOW_OPS=ON python -m pip install -r "$OPEN3D_ML_ROOT/requirements-tensorflow.txt" - python -W default -c \ + python -W default -c \ "import open3d.ml.tf.ops; print('TensorFlow Ops library loaded:', open3d.ml.tf.ops)" fi if [ "$BUILD_TENSORFLOW_OPS" == ON ] && [ "$BUILD_PYTORCH_OPS" == ON ]; then