Jetson Xavier NX 安装 Open3D

这只是笔记:

在jetson 上按装一些东西真的是太坑了,一点都不友好,现在大多数现成的东西都是为x86,x64的,对于arm架构的处理器就要自己编译

如果直接在jetson上安装

pip3 install open3d-python

运行时就会保证错,因为下载编译好的是for x64的

.local/lib/python3.6/site-packages/open3d/linux/open3d.so: cannot open shared object file: No such file or directory

解决方式如下

1. 克隆git源代码(完整clone)

git clone --recursive https://github.com/intel-isl/Open3D

2.新建build目录

mkdir build
cd build

3.编译

结果发现现在的cmake版本太低了,编译不了

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) \
>     ..
CMake Error at CMakeLists.txt:10 (cmake_minimum_required):
  CMake 3.17 or higher is required.  You are running version 3.10.2

4.更新cmake

下载cmake

mkdir -p ~/tools/
cd ~/tools/
wget https://github.com/Kitware/CMake/releases/download/v3.19.2/cmake-3.19.2.tar.gz
tar xvf cmake-3.19.2.tar.gz
cd cmake-3.19.2

然后(不太懂, 大佬可以留言交流一下)

./bootstrap --prefix=/usr

编译安装

make
sudo make install

测试

cmake --version
cmake version 3.19.2

5. cmake open3d

 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= /usr/bin/python3\
    ..

因为默认是Python2, 无法在此环境下编译,只支持Python3,所以-DPYTHON_EXECUTABLE= /usr/bin/python3\

jetson的强项就是cuda, 所以cuda要on

6. 编译

make -j6

Jetson nx 是6核, j6,卡,等......几个小时

[ 98%] Building CXX object examples/cpp/CMakeFiles/Image.dir/Image.cpp.o
[ 98%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/visualization/renderoption.cpp.o
[ 99%] Linking CXX executable ../../bin/examples/Image
[ 99%] Built target Image
Scanning dependencies of target PCDFileFormat
[ 99%] Building CXX object examples/cpp/CMakeFiles/PCDFileFormat.dir/PCDFileFormat.cpp.o
[100%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/visualization/utility.cpp.o
[100%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/visualization/viewcontrol.cpp.o
[100%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/visualization/visualization.cpp.o
[100%] Linking CXX executable ../../bin/examples/PCDFileFormat
[100%] Building CXX object cpp/pybind/CMakeFiles/pybind.dir/visualization/visualizer.cpp.o
[100%] Built target PCDFileFormat
[100%] Linking CXX shared module ../../lib/Release/Python/cpu/pybind.cpython-36m-aarch64-linux-gnu.so
[100%] Built target pybind

7. 测试一下

make tests -j$(nproc)
./bin/tests --gtest_filter="-*Reduce*Sum*"

会得到以下结果,很多...

[----------] 4 tests from TransformationEstimation/TransformationEstimationPermuteDevices
[ RUN      ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeRMSEPointToPoint/0
[       OK ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeRMSEPointToPoint/0 (2 ms)
[ RUN      ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeTransformationPointToPoint/0
[       OK ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeTransformationPointToPoint/0 (26 ms)
[ RUN      ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeRMSEPointToPlane/0
[       OK ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeRMSEPointToPlane/0 (2 ms)
[ RUN      ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeTransformationPointToPlane/0
[       OK ] TransformationEstimation/TransformationEstimationPermuteDevices.ComputeTransformationPointToPlane/0 (10 ms)
[----------] 4 tests from TransformationEstimation/TransformationEstimationPermuteDevices (41 ms total)

[----------] Global test environment tear-down
[==========] 847 tests from 68 test suites ran. (27113 ms total)
[  PASSED  ] 846 tests.
[  SKIPPED ] 1 test, listed below:
[  SKIPPED ] RGBDImage.CreateFromNYUFormat

  YOU HAVE 210 DISABLED TESTS

jtop会发现cuda是开启的, 说明安装运行都是可行的

8. 下载c++包, Python包

make install
make install-pip-package -j$(nproc)

9. 运行一下GUI看看吧

./bin/Open3D/Open3D

注意: 所有的命令都是在open3d文件夹或者子文件夹下运行

参考:http://www.open3d.org/docs/release/arm.html#install-dependencies

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值