Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM build Jetson Xavier still not working. #2519

Closed
Fred3D-tech opened this issue Oct 20, 2020 · 9 comments
Closed

ARM build Jetson Xavier still not working. #2519

Fred3D-tech opened this issue Oct 20, 2020 · 9 comments
Labels
arm build/install Build or installation issue

Comments

@Fred3D-tech
Copy link

You closed an issue without solving it.
Information needed:
All of the dependencies are installed.

(base) fred@fred-desktop:/Open3D/build$ g++ --version
g++ (Ubuntu/Linaro 7.5.0-3ubuntu1
18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

(base) fred@fred-desktop:/Open3D/build$ clang++ --version
clang version 7.0.0-3
ubuntu0.18.04.1 (tags/RELEASE_700/final)
Target: aarch64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

(base) fred@fred-desktop:~/Open3D/build$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

(base) fred@fred-desktop:~/Open3D/build$ uname -a
Linux fred-desktop 4.9.140-tegra #1 SMP PREEMPT Thu Jun 25 21:22:12 PDT 2020 aarch64 aarch64 aarch64 GNU/Linux

cmake
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DBUILD_CUDA_MODULE=ON
-DBUILD_GUI=ON
-DBUILD_TENSORFLOW_OPS=OFF
-DBUILD_PYTORCH_OPS=OFF
-DBUILD_UNIT_TESTS=ON
-DCMAKE_INSTALL_PREFIX=~/open3d_install
-DPYTHON_EXECUTABLE=$(which python)
..
make -j$(nproc)

[ 41%] Building CXX object cpp/open3d/visualization/CMakeFiles/visualization.dir/shader/ImageShader.cpp.o
In file included from /home/fred/Open3D/cpp/open3d/core/linalg/MatmulCPU.cpp:27:0:
/home/fred/Open3D/cpp/open3d/core/linalg/BlasWrapper.h:37:22: error: variable or field ‘gemm_cpu’ declared void
inline void gemm_cpu(CBLAS_LAYOUT layout,
^~~~~~~~~~~~

@Fred3D-tech
Copy link
Author

what is this reference to CBLAS_LAYOUT ?

@Fred3D-tech
Copy link
Author

Fred3D-tech commented Oct 20, 2020

it looks like there is a cblas dependency should be installed.

@sanskar107 sanskar107 added arm build/install Build or installation issue labels Oct 21, 2020
@Fred3D-tech
Copy link
Author

Fred3D-tech commented Oct 21, 2020

using before sudo apt-get install lsb-core
you get :

(base) fred@fred-desktop:~$ lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

but it does not change anything.
I still get this error:
[ 43%] Building CXX object cpp/open3d/geometry/CMakeFiles/geometry.dir/PointCloudSegmentation.cpp.o
In file included from /home/fred/Open3D/cpp/open3d/core/linalg/MatmulCPU.cpp:27:0:
/home/fred/Open3D/cpp/open3d/core/linalg/BlasWrapper.h:37:22: error: variable or field ‘gemm_cpu’ declared void
inline void gemm_cpu(CBLAS_LAYOUT layout,
^~~~~~~~~~~~
I tried different cmake options but nothing works...
What is this CBLAS_LAYOUT reference? it looks like something else should be installed.

@yxlao
Copy link
Collaborator

yxlao commented Oct 21, 2020

This is a problem related to a specific system configuration. Try starting from a fresh OS. We cannot provide support for a specific configuration.

If you like us to look further into it, please provide a Dockerfile base on arm64v8/ubuntu:18.04 containing all of your build scripts. See https://www.stereolabs.com/docs/docker/building-arm-container-on-x86/ and https://hub.docker.com/r/arm64v8/ubuntu for reference.

@isl-org isl-org deleted a comment from Fred3D-tech Oct 24, 2020
@thvis
Copy link

thvis commented Dec 10, 2020

Hi,

I do not know if it fits exactly your problem with installing on jetson xavier, but I was able to compile open3d from source on Jetson Nano B01 and got it finally work with python3. I was also struggling to install it, but after many tries here is what I did:

General considerations
1. Swap Memory
I increased the swap memory on jetson nano (this might just been a precaution, because my nano freezed a couple of times when I tried compiling different packages from source, maybe because of lack of memory. Here you find how to do, but I guess it is not an issue on xavier.

2. Compiler Jobs
My nano crashed a lot of times, when I tried to compile with all CPU cores. So I never forced more than 3 make jobs on nano ( make -j3 )

3. Python
In my case, I wanted to use open3d with python3 (more exactly python3.6.9) so I set python3 as my standard python with sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
and also pip3 as standard pip with sudo update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
You might say, switiching standard python version to python3 was not nescessary because you could specify the python executable you want to use. Yes, but I tried it and it did not work out, as during the process, there might was a problem when it comes to loading dependencies and so on.

4. update cmake
I got cmake version 3.10 with my jetpack image, so I needed to update by:
sudo apt remove --purge cmake
hash -r
sudo snap install cmake --classic I got version 3.19 then.

Installation process
0. Install dependencies
sudo apt-get update -y
sudo apt-get install -y apt-utils build-essential python3-dev xorg-dev libglu1-mesa-dev libblas-dev liblapack-dev liblapacke-dev libsdl2-dev libc++-7-dev libc++abi-7-dev libxi-dev clang-7 libjpeg-dev gfortran

1. clone repo
git clone --recursive https://github.com/intel-isl/open3d

2. downgrade open3d version
the latest version could not be compiled, I had luck with version v0.11.0.
So I did: git checkout v0.11.0

3. go to repo directory
cd open3d and mkdir build && cd build

4. run cmake
I used following cmake flags. Especially important for me was cuda support.
cmake \ -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS=ON \ -DBUILD_CUDA_MODULE=ON \ -DBUILD_GUI=ON \ -DBUILD_TENSORFLOW_OPS=OFF \ -DBUILD_PYTORCH_OPS=OFF \ -DBUILD_UNIT_TESTS=ON \ -DCMAKE_INSTALL_PREFIX=~/open3d_install \ -DPYTHON_EXECUTABLE=$(which python) \ ..

5. run make
make -j3 As mentioned, more then make jobs on jetson nano was too much for the little fellow. Takes approx. 2h on jetson nano.

**6. make tests just in case **
make tests -j3
./bin/tests --gtest_filter="-*Reduce*Sum*" works for me

7. Install c++ lib
I did NOT use sudo make install BUT sudo checkinstall (Here you find some information about, it really helps to keep your system clean as it makes a deb package for installation. especially if you try to install a lot of things from source).

8. Install python binding
When I tried to make the pip package I encountered many errors. The solution was to install as many dependencies I could encounter before hand. In my case it was:
python3 -m pip install Cython
python3 -m pip install -U numpy
python3 -m pip install -U matplotlib
Then make install-pip-package -j3

After all that it finally worked for me. Hope it helps.

@interactivetech
Copy link

I ran into the same issue, and @thvis solution worked for me!

@Toxiiin
Copy link

Toxiiin commented Mar 11, 2021

One way to avoid unexpected dependency conflicts would be to use for example the l4t-base docker image (https://ngc.nvidia.com/catalog/containers/nvidia:l4t-base) from NVIDIA and build open3d inside of it. While compiling it in this environment i did not faced any issues.

@AncientRemember
Copy link

AncientRemember commented May 11, 2021

v0.12.0 has a bug in 3rdparty/finddependences.cmake
https://github.com/intel-isl/Open3D/blob/313315d9790c36e22bb5bb034e9c7d7f470cdf73/3rdparty/find_dependencies.cmake#L926

delete x86_64 will resolve it,the realease process don't take care arm64

@yxlao
Copy link
Collaborator

yxlao commented Jan 25, 2022

We have recently added static OpenBLAS support and Docker builder (#4552, #4651), as well as pre-compiled Open3D Python wheel for ARM64. Using the Docker build script is a safe bet as it takes care of the system dependency automatically.

To get Open3D Python wheel on ARM64:

  • Option 1: pip install open3d to get the stable release.
  • Option 2: Compile ARM64 wheel with Docker. This is recommended if you only need the Python wheel.
  • Option 3: Compile ARM64 wheel directly. You'll need to take care of the system dependencies. In general, we recommend building from a clean OS and only installing the required dependencies by Open3D. It has been reported by users that some globally installed packages (e.g. TBB, Parallel STL, BLAS, LAPACK) may cause compatibility issues if they are not the same version as the one used by Open3D.

I am closing this issue for now. Please open a new issue if you run into new problems.

@yxlao yxlao closed this as completed Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arm build/install Build or installation issue
Projects
None yet
Development

No branches or pull requests

7 participants