Building Pytorch from source for Drive AGX

Please provide the following info (check/uncheck the boxes after clicking “+ Create Topic”):
Software Version
DRIVE OS Linux 5.2.0
DRIVE OS Linux 5.2.0 and DriveWorks 3.5
[*] NVIDIA DRIVE™ Software 10.0 (Linux)
NVIDIA DRIVE™ Software 9.0 (Linux)
other DRIVE OS version
other

Target Operating System
[*] Linux
QNX
other

Hardware Platform
[*] NVIDIA DRIVE™ AGX Xavier DevKit (E3550)
NVIDIA DRIVE™ AGX Pegasus DevKit (E3550)
other

SDK Manager Version
1.5.0.7774
other

Host Machine Version
[*] native Ubuntu 18.04
other

Hi,

Understand Drive AGX is not optimal for development, but I want to use Pytorch for pre-processing. I follow PyTorch for Jetson and Build the pytorch from source for drive agx xavier to build the Pytorch from the source. It failed as follow:
[2909/4360] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/onnx/backend.cc.o
FAILED: caffe2
/CMakeFiles/torch_cpu.dir/onnx/backend.cc.o
/usr/bin/c++ -DAT_PARALLEL_OPENMP=1 -DCPUINFO_SUPPORTED_PLATFORM=1 -DFXDIV_USE_INLINE_ASSEMBLY=0 -DHAVE_MALLOC_USABLE_SIZE=1 -DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1 -DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DNNP_CONVOLUTION_ONLY=0 -DNNP_INFERENCE_ONLY=0 -DONNX_ML=1 -DONNX_NAMESPACE=onnx_torch -D_FILE_OFFSET_BITS=64 -Dtorch_cpu_EXPORTS -Iaten/src -I…/aten/src -I. -I…/ -isystem …/cmake/…/third_party/googletest/googlemock/include -isystem …/cmake/…/third_party/googletest/googletest/include -isystem …/third_party/protobuf/src -isystem …/third_party/XNNPACK/include -I…/cmake/…/third_party/benchmark/include -isystem …/cmake/…/third_party/eigen -isystem /home/nvidia/miniconda3/envs/py36/include/python3.6m -isystem /home/nvidia/miniconda3/envs/py36/lib/python3.6/site-packages/numpy/core/include -isystem …/cmake/…/third_party/pybind11/include -isystem /opt/rocm/hip/include -isystem /include -isystem …/cmake/…/third_party/cub -Icaffe2/contrib/aten -I…/third_party/onnx -Ithird_party/onnx -I…/third_party/foxi -Ithird_party/foxi -I/usr/local/cuda-10.2/include -I…/caffe2/…/torch/csrc/api -I…/caffe2/…/torch/csrc/api/include -I…/caffe2/aten/src/TH -Icaffe2/aten/src/TH -I…/caffe2/…/torch/…/aten/src -Icaffe2/aten/src -Icaffe2/…/aten/src -Icaffe2/…/aten/src/ATen -I…/caffe2/…/torch/csrc -I…/caffe2/…/torch/…/third_party/miniz-2.0.8 -I…/aten/src/TH -I…/aten/…/third_party/catch/single_include -I…/aten/src/ATen/… -Icaffe2/aten/src/ATen -I…/third_party/miniz-2.0.8 -I…/caffe2/core/nomnigraph/include -isystem include -I…/third_party/FXdiv/include -I…/c10/… -I…/third_party/cpuinfo/include -I…/third_party/NNPACK/include -I…/third_party/pthreadpool/include -I…/third_party/FP16/include -Wno-deprecated -fvisibility-inlines-hidden -fopenmp -DNDEBUG -DUSE_XNNPACK -DUSE_INTERNAL_THREADPOOL_IMPL -O2 -fPIC -Wno-narrowing -Wall -Wextra -Werror=return-type -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds -Wno-unknown-pragmas -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-result -Wno-strict-overflow -Wno-strict-aliasing -Wno-error=deprecated-declarations -Wno-stringop-overflow -Wno-error=pedantic -Wno-error=redundant-decls -Wno-error=old-style-cast -fdiagnostics-color=always -faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized -fno-math-errno -fno-trapping-math -Werror=format -Wno-stringop-overflow -O3 -DNDEBUG -DNDEBUG -fPIC -DCUDA_HAS_FP16=1 -D__NEON__ -DUSE_GCC_GET_CPUID -DTH_HAVE_THREAD -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wno-write-strings -Wno-unknown-pragmas -Wno-missing-braces -Wno-maybe-uninitialized -fvisibility=hidden -O2 -DCAFFE2_BUILD_MAIN_LIB -pthread -std=gnu++14 -MD -MT caffe2/CMakeFiles/torch_cpu.dir/onnx/backend.cc.o -MF caffe2/CMakeFiles/torch_cpu.dir/onnx/backend.cc.o.d -o caffe2/CMakeFiles/torch_cpu.dir/onnx/backend.cc.o -c …/caffe2/onnx/backend.cc
…/caffe2/onnx/backend.cc:11:10: fatal error: onnx/optimizer/optimize.h: No such file or directory
#include “onnx/optimizer/optimize.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

There is no such file “onnx/optimizer/optimize.h” in the source code. MKL is not available for aarch64, wound it affect the PyTorch compilation and usage?

Dear @xu.yan,
Have you installed ONNX?

Hi @xu.yan ,

As you may know that Pytorch isn’t officially tested on DRIVE AGX.
We aren’t sure if we can help on this. But did you follow Build the pytorch from source for drive agx xavier - #4 by shayNV for v1.5.0?