Build the pytorch from source for drive agx xavier

Hi @lijie2019,
please try cloning and building V1.5.0 tag of PyTorch, while following the instructions as you mentioned here PyTorch for Jetson Nano - version 1.5.0 now available, with only 2 addition:

  1. before following the instructions, executing the following command
    sudo dpkg -i /var/cuda-repo-10-2-local-10.2.19/cuda-toolkit-10-2_10.2.19-1_arm64.deb (this will output an error)
    sudo apt --fix-broken -y install
    (this will install all necessary include files, as the Drive platform is not meant for local development rather remote development, so include files are not needed)
  2. apply a patch to the version as follow:
    in file aten/src/ATen/native/quantized/cpu/qnnpack/src/q8gemm/8x8-dq-aarch64-neon.S (line 662)

replace the following lines:

MOV V8.4s, V9.4s
MOV v10.4s, v11.4s
MOV v12.4s, V13.4s
MOV V14.4s, V15.4s
MOV V16.4s, V17.4s
MOV V18.4s, V19.4s
MOV V20.4s, V21.4s
MOV V22.4s, V23.4s

with these:

MOV V8.16b, V9.16b
MOV v10.16b, v11.16b
MOV v12.16b, V13.16b
MOV V14.16b, V15.16b
MOV V16.16b, V17.16b
MOV V18.16b, V19.16b
MOV V20.16b, V21.16b
MOV V22.16b, V23.16b

This has compiled and the wheel was created on my side. also the “Verification” phase passed.

NOTE: please take into account that using PyTorch is not optimized for the Drive Platform, and using the TensorRT framework is the right way in order to best utilize the HW accelerators of the Drive AGX and by that get the best performance with DNN.

Please consider watching the following NVIDIA webinar for automotive customers:
Integrating DNN Inference into Autonomous Vehicle Applications with NVIDIA DriveWorks SDK

Thanks