Skip to content

Cannot install Open3D Python library when building from source (Pytorch 2.1.0+cu121 & Python 3.10) #6552

Open
@kidpaul94

Description

@kidpaul94

Checklist

Steps to reproduce the issue

I first cloned Open3D by:

git clone https://github.com/isl-org/Open3D.git
cd Open3D

Then, I build Open3D (on Ubuntu 22.04, with CUDA 12.1) with:

mkdir build
cd build
git clone https://github.com/isl-org/Open3D-ML.git
cmake -DBUILD_CUDA_MODULE=ON -DGLIBCXX_USE_CXX11_ABI=OFF  -DBUILD_PYTORCH_OPS=ON -DBUNDLE_OPEN3D_ML=ON -DOPEN3D_ML_ROOT=Open3D-ML  ..


After changing CMakeLists.txt in Open3D folder so that I can use C++17 to doing make -j$(nproc),

make -j$(nproc)
sudo make install
sudo make python-package

Error message

[  0%] Performing update step for 'open3d_ml'
HEAD is now at 1d1fe7a boundingbox.py: Changed np.int to np.int32 to make compatible with new versions of numpy (#624)
[  0%] No patch step for 'open3d_ml'
[  1%] No configure step for 'open3d_ml'
[  1%] No build step for 'open3d_ml'
[  1%] No install step for 'open3d_ml'
[  1%] Completed 'open3d_ml'
[  1%] Built target open3d_ml
[  1%] Built target copy_html_dir
[  1%] Built target ext_assimp
[  2%] Built target ext_cutlass
[  3%] Built target ext_eigen
[  3%] Built target ext_nanoflann
[  3%] Built target 3rdparty_glew
[  3%] Built target ext_turbojpeg
[  4%] Built target ext_jsoncpp
[  5%] Built target 3rdparty_liblzf
[  6%] Built target ext_boringssl
[  7%] Built target ext_curl
[  8%] Built target ext_zlib
[  8%] Built target ext_libpng
[  8%] Built target 3rdparty_rply
[  8%] Built target 3rdparty_tinyfiledialogs
[ 10%] Built target ext_tinygltf
[ 11%] Built target ext_tinyobjloader
[ 12%] Built target ext_qhull
[ 13%] Built target 3rdparty_qhull_r
[ 15%] Built target 3rdparty_qhullcpp
[ 15%] Built target ext_fmt
[ 16%] Built target ext_poisson
[ 17%] Built target ext_imgui
[ 17%] Built target 3rdparty_imgui
[ 18%] Built target ext_filament
[ 18%] Built target ext_zeromq
[ 18%] Built target ext_cppzmq
[ 20%] Built target ext_msgpack-c
[ 21%] Built target ext_vtk
[ 21%] Built target ext_directxmath
[ 22%] Built target ext_directxheaders
[ 23%] Built target ext_uvatlas
[ 24%] Built target ext_tbb
[ 25%] Built target ext_parallelstl
[ 26%] Built target ext_mkl_include
[ 27%] Built target ext_mkl
[ 28%] Built target ext_ippicv
[ 28%] Built target ext_stdgpu
[ 30%] Built target ext_embree
[ 31%] Built target ext_webrtc
[ 31%] Built target ext_webrtc_all
[ 32%] Built target ext_civetweb
[ 34%] Built target glfw
[ 35%] Built target webrtc_server
[ 35%] Built target camera
[ 45%] Built target core
[ 50%] Built target data
[ 53%] Built target geometry
[ 56%] Built target io
[ 56%] Built target ml_contrib
[ 58%] Built target pipelines
[ 60%] Built target tgeometry
[ 62%] Built target tgeometry_kernel
[ 63%] Built target tio
[ 64%] Built target tpipelines
[ 65%] Built target tpipelines_kernel
[ 67%] Built target utility
[ 68%] Built target ShaderLinker
[ 68%] Built target ShaderEncoder
[ 71%] Built target shader
[ 77%] Built target visualization
[ 80%] Built target materials
[ 84%] Built target GUI
[ 84%] Built target Open3D
[ 91%] Built target open3d_torch_ops
[100%] Built target pybind
[100%] Generating python ops.py and return_types.py
Traceback (most recent call last):
  File "/home/hojun/Work/Open3D/cpp/pybind/generate_torch_ops_wrapper.py", line 32, in <module>
    import torch
ModuleNotFoundError: No module named 'torch'
make[3]: *** [cpp/pybind/CMakeFiles/python-package.dir/build.make:75: lib/ml/torch/python/ops.py] Error 1
make[2]: *** [CMakeFiles/Makefile2:4147: cpp/pybind/CMakeFiles/python-package.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:4154: cpp/pybind/CMakeFiles/python-package.dir/rule] Error 2
make: *** [Makefile:1242: python-package] Error 2

Open3D, Python and System information

- Operating system: Ubuntu 22.04
- Python version: Python 3.10.12
- Open3D version: output from python: latest
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc 11.4.0 / clang 14.0.0

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    build/installBuild or installation issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions