Skip to content

Reduce installed Open3D wheel size - #7540

Open
ssheorey wants to merge 38 commits into
mainfrom
ss/v0.20
Open

Reduce installed Open3D wheel size#7540
ssheorey wants to merge 38 commits into
mainfrom
ss/v0.20

Conversation

@ssheorey

@ssheorey ssheorey commented Aug 21, 2026

Copy link
Copy Markdown
Member

Type

Issues Fixed

Issue Description Fix
#6347 depth_trunc ignored for float depth images in create_from_depth_image Apply depth truncation to float depth images consistently with uint16 path
#6607 "vector too long" error writing large (>100M points) binary PCD Stream large binary PCD writes in chunks instead of single allocation
#6979 Jupyter visualizer unavailable on macOS ARM64 Enable Jupyter visualizer (WebRTC) on macOS ARM64; fix custom action freeze
#7354 Tensor reconstruction system cannot run on Intel GPU with SYCL Enable SYCL dense reconstruction odometry kernel
#7367 Tensor ICP doesn't stop when relative convergence criteria are met Fix convergence criteria check and avoid redundant metric evaluation
#7363 IsContiguous docs unclear (should be C-contiguous / row-major) Clarify IsContiguous/Contiguous docs as C-contiguous matching PyTorch/NumPy
#7475 registration_ransac_based_on_feature_matching not deterministic despite seed Mitigation only, no fix. pre-computed random samples, deterministic reduce.
#7497 compute_unique_block_coordinates fails with CUDA VoxelBlockGrid Fix InverseTransformation/TransformIndexer to accept non-CPU tensors
#7499 macOS build error with USE_SYSTEM_EIGEN3=ON in VoxelPooling.h Add SFINAE constraint to VoxelPooling AddPoint templates
#7502 Build with Open3D-ML hardcodes main branch (not reproducible) Allow choice of Open3D-ML tag/branch via OPEN3D_ML_VERSION
#7538 remove_radius_outlier data race from std::vector<bool> in parallel loop Replace std::vector<bool> with std::deque<bool> for thread safety

Motivation and Context

Total open3d wheel install size (blank virtual env): 1.41 GB. Most of the size comes from ML dependencies and CUDA SASS / PTX per-architecture binary code.

Direct requirement Subtotal Notable packages
open3d (wheel) 849.8 MiB open3d
numpy 65.9 MiB numpy
dash 125.4 MiB plotly 62.5, dash 37.8, pydantic/setuptools, …
flask 0.7 MiB Flask
werkzeug 1.6 MiB Werkzeug
nbformat 3.7 MiB jsonschema, rpds-py, …
configargparse 0.2 MiB ConfigArgParse
ipywidgets 47.9 MiB jedi, widgetsnbextension, Pygments, ipython, …
addict ~0 addict
pillow 20.1 MiB pillow
matplotlib 67.8 MiB matplotlib, fonttools, kiwisolver, …
pandas 65.4 MiB pandas
pyyaml 3.0 MiB PyYAML
scikit-learn 178.4 MiB scipy 132.3, scikit-learn 44.1, joblib
tqdm 0.4 MiB tqdm
pyquaternion 0.1 MiB pyquaternion

Separating ml dependencies saves ~335MB of installed disk space.

Install Approx. venv size vs core-only
pip install open3d (today's release wheel + all Requires-Dist) 1.41 GiB
pip install open3d (future core only) 1.03 GiB baseline
pip install open3d[ml] (core + Open3D-ML requirements.txt) 1.36 GiB +0.33 GiB (~335 MiB)

Where the CUDA wheel bytes are

Measured on the released open3d-0.19.0-cp312-manylinux_2_35_x86_64.whl (426.9 MiB) by parsing every fat binary in .nv_fatbin:

Artifact Raw Compressed in wheel
CUDA pybind extension 765.1 MiB 324.7 MiB (76% of the wheel)
.nv_fatbin inside it 466.4 MiB 222.3 MiB (52% of the wheel)
├ Open3D's own device code 278.1 MiB
└ Statically linked CUDA libraries 188.5 MiB

Fatbin bytes still deflate 2.10x inside the wheel, so removing 1 MiB of device code saves ~0.48 MiB of wheel and the full 1 MiB of installed size. Per-architecture slices:

Source sm_50 sm_60 sm_61 sm_70 sm_75 sm_80 sm_86 sm_89 sm_90 PTX
Open3D kernels 47.7 48.2 47.6 47.6 54.4 32.6
Static CUDA libs 12.7 12.6 9.3 12.6 6.3 36.1 11.9 3.7 58.1 25.2

Removing CUDA static libs for old architectures can save up to ~48MB from the wheel, but it was found to cause errors in Google CUDA runners with Tesla T4 GPUs. Reverted for future work.

Checklist:

  • I have run python util/check_style.py --apply to apply Open3D code style
    to my code.
  • This PR changes Open3D behavior or adds new functionality.
    • Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is
      updated accordingly.
    • I have added or updated C++ and / or Python unit tests OR included test
      results
      (e.g. screenshots or numbers) here.
  • I will follow up and update the code if CI fails.
  • For fork PRs, I have selected Allow edits from maintainers.

Description

Reduce the wheel and installed size along three axes: make the Open3D-ML Python dependencies an optional [ml] extra, ship Turing as PTX instead of SASS in release CUDA builds, and prune the GPU architectures we don't support out of NVIDIA's static CUDA libraries with nvprune.

This PR also bundles multiple bug fixes and improvements — see the Issues Fixed table above for a complete list.

Changes

  • Optional ML dependencies: Open3D-ML's requirements.txt is packaged as extras_require["ml"], so pip install open3d[ml] (or open3d-cpu[ml]) pulls the models/pipelines/datasets dependencies. open3d.ml submodules are imported lazily (PEP 562 __getattr__) so import open3d works without them, and the wrappers raise an actionable ImportError via require_ml_extra().
  • Open3D-ML bundling: BUNDLE_OPEN3D_ML defaults to ON when ML ops are built and OPEN3D_ML_ROOT is set (still overridable with -D), Windows wheels bundle Open3D-ML too, and CI sets OPEN3D_ML_ROOT wherever Torch/TF ops are built.
  • Linux GUI wheels bundle Filament's LLVM libc++ / libc++abi / libunwind via a small ldd helper.
  • CI installs the [ml] extra when testing wheels that bundle Open3D-ML.
  • CI / Build: Keep compressed ccache archive out of Docker image; separate dev_wheels.html page; fix style check failures; fix TensorBoard summary test teardown errors; update copyright years to 2026; various CMake and CI fixes.

Behavior changes

  • Open3D-ML users must install open3d[ml].

…ackaging

Enable BUNDLE_OPEN3D_ML automatically when PyTorch or TensorFlow ops are built,
ship Open3D-ML pip deps as extras_require[ml], and validate imports via require_ml_extra.
Bundle Filament LLVM libc++ on Linux GUI wheels with a small ldd helper; refresh CI/Docker
for Open3D-ML main, CUDA 12.6+ arch defaults, and local style --changed-only.
@update-docs

update-docs Bot commented Aug 21, 2026

Copy link
Copy Markdown

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

@ssheorey ssheorey added this to the v0.20 milestone Aug 21, 2026
@ssheorey
ssheorey requested a balanced review from Copilot August 21, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Reduces Open3D wheel size by optionalizing ML dependencies and narrowing release CUDA architectures.

Changes:

  • Adds the ml package extra and dependency checks.
  • Updates CUDA targets, CI dependencies, and Open3D-ML checkout behavior.
  • Bundles Linux GUI runtime libraries and adds changed-file style checking.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
CMakeLists.txt Automates ML bundling and revises CUDA targets.
cmake/Open3DPrintConfigurationSummary.cmake Reports CUDA architecture settings.
cpp/pybind/CMakeLists.txt Revises wheel runtime-library handling.
cpp/pybind/make_python_package.cmake Packages ML requirements and Linux runtimes.
cpp/pybind/package_linux_wheel_runtime.sh Copies required LLVM runtime libraries.
python/setup.py Exposes ML dependencies as an extra.
python/open3d/_optional_deps.py Validates optional ML dependencies.
python/open3d/ml/configs.py Adds ML dependency validation.
python/open3d/ml/datasets.py Adds ML dependency validation.
python/open3d/ml/utils.py Adds ML dependency validation.
python/open3d/ml/vis.py Adds ML dependency validation.
util/ci_utils.sh Aligns runtime dependencies and CUDA architectures.
util/check_style.py Adds changed-files-only formatting.
docker/Dockerfile.ci Updates ML checkout and dependencies.
3rdparty/README_SYCL.md Documents SYCL runtime installation.
.github/workflows/windows.yml Uses Open3D-ML’s default branch.
.github/workflows/ubuntu.yml Revises the documentation ML checkout.
.github/workflows/ubuntu-wheel.yml Uses Open3D-ML’s default branch.
.github/workflows/macos.yml Uses Open3D-ML’s default branch.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/open3d/ml/configs.py
Comment thread CMakeLists.txt Outdated
Comment thread cpp/pybind/make_python_package.cmake Outdated
Comment thread .github/workflows/ubuntu.yml Outdated
Comment thread python/setup.py
ssheorey and others added 2 commits August 21, 2026 08:42
Make BUNDLE_OPEN3D_ML an option again, defaulting to ON only when ML ops are
built and OPEN3D_ML_ROOT resolves, so local builds can opt out and CI jobs
without an Open3D-ML checkout configure instead of erroring out. Windows wheels
now bundle Open3D-ML too.

Import the Open3D-ML backed submodules of open3d.ml, open3d.ml.torch and
open3d.ml.tf lazily and gate them on require_ml_extra(), so the ops and layers
stay usable with a core-only install and a missing dependency reports how to
install the ml extra. Wheel tests install that extra.

Keep Turing usable after dropping its SASS by emitting compute_75 PTX, which
also needs a -virtual case when translating architectures for PyTorch.

Fall back to the pybind extension when probing for libc++ in static builds,
where libOpen3D is not packaged.

Co-authored-by: Cursor <cursoragent@cursor.com>
NVIDIA's static CUDA libraries carry device code back to sm_50, ~47MB of
which no GPU that Open3D supports can run. nvprune only accepts static
libraries, not the linked Open3D library, so the imported CUDA targets are
pruned and re-pointed before linking, cached per architecture list.

Also fix the Windows path separator assertion in the TensorBoard plugin
test, which started running there now that Windows wheels bundle Open3D-ML,
and skip the module cleanly when the `ml` extra is not installed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

…7497)

Replace AssertTensorDevice(CPU) with .To(CPU) in InverseTransformation and
TransformIndexer so callers with CUDA/SYCL tensors do not get device mismatch
errors. Both functions read small float64 tensors (3x3 and 4x4) and copy
the data into host-side arrays, so a device transfer is cheap and semantically
correct. This is a general fix that covers all call sites including
VoxelBlockGrid, PointCloud, and Image kernel paths.
Fix compilation error when building with USE_SYSTEM_EIGEN3=ON on macOS with
clang++. The AddPoint template functions used Eigen::ArrayBase<Derived3> as
an unconstrained parameter type, which causes substitution failures when
the compiler instantiates Eigen::ArrayBase for types that don't derive
from it. This manifests under stricter C++17 template resolution when
Eigen is included from a system path (-isystem) rather than as a
project-local header.

Fix:
- Add std::enable_if constraint requiring Derived3 to be derived from
  Eigen::ArrayBase<Derived3>
- Change parameter from 'const Eigen::ArrayBase<Derived3>&' to
  'const Derived3&' (semantically identical since Derived3 IS-A ArrayBase)

Applied to both Accumulator::AddPoint and AccumulatorBackprop::AddPoint.
Previously BUNDLE_OPEN3D_ML=ON hardcoded GIT_TAG origin/main in the
ExternalProject and ci_utils.sh forced a main branch checkout. This
prevented reproducible builds using matching release tags.

Add OPEN3D_ML_VERSION CMake cache variable (default: main) that
controls the git ref checked out from the Open3D-ML repo. Users can
set -DOPEN3D_ML_VERSION=v0.19.0 for reproducible builds or any other
tag/branch.

Also exposed as a Docker build arg in Dockerfile.ci, forwarded to
cmake, and added to ci_build() in docker_build.sh (defaults to main).

Removed the checkout -b main workaround in ci_utils.sh and
Dockerfile.ci; replaced with fetch --tags so version tags are
available when OPEN3D_ML_VERSION is set to one.
Defer Python callbacks via PostToMainThread instead of invoking them
during ImGui draw/event processing, and pre-cast O3DVisualizer to
py::object at bind time to avoid pybind11 cast blocking after
multiple GIL save/restore cycles in ProcessQueuedEvents.

Fixes #6979
Add SYCL image kernels for bilateral, Sobel, Gaussian, and nearest-neighbor
resize operations used by tensor RGB-D odometry.
Support the tested UInt8, UInt16, and Float32 image types with explicit errors
for unsupported SYCL dtypes, while retaining the existing IPP and NPP paths.
Enable SYCL coverage for point-to-plane, intensity, and hybrid odometry.
Update image tests with full CPU/NPP/SYCL references and dtype coverage.
Build and run the C++ tests on CPU and SYCL, plus the full 3000-frame Lounge
reconstruction workflow with both intensity and hybrid odometry.
Update reconstruction tutorials, C++ and Python examples, and tensor notebooks
to document and accept SYCL alongside CUDA where the tensor path supports it.
Remove duplicated point-cloud setup from the tensor point-cloud notebook and
keep the complete creation example in its single intended cell.
Keep notebook examples executable with the requested Python 3.12 environment;
the cleaned point-cloud setup was run successfully on SYCL.
Preserve SYCL device metadata when loading VoxelBlockGrid files and update the
ray-casting example to transfer loaded grids to the requested device.
Validate the SYCL-loaded grid, ray casting, and focused VoxelBlockGrid tests.
Remove generated outputs from the updated Jupyter notebooks and add the missing
plotting import required by the point-cloud notebook example.
@ssheorey
ssheorey marked this pull request as ready for review August 25, 2026 21:52
@ssheorey
ssheorey requested a balanced review from Copilot August 25, 2026 22:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 300 out of 1875 changed files in this pull request and generated 4 comments.

Comment thread cpp/open3d/t/geometry/kernel/ImageImpl.h Outdated
Comment thread cpp/open3d/pipelines/registration/Registration.cpp
Comment thread docker/Dockerfile.ci Outdated
Comment thread util/ci_utils.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants