How to install pytorch from source on Jetson AGX Orin in a virtual environment (e.g. conda) running python 3.10?

Some context:
cat /etc/nv_tegra_release prints out:

R35 (release), REVISION: 4.1, GCID: 33958178, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 1 19:57:35 UTC 2023

I tried to build pytorch from source on a conda environment running python 3.10 as follows:

export USE_NCCL=0 ; \

export USE_DISTRIBUTED=1 ;
export USE_QNNPACK=0 ;
export USE_PYTORCH_QNNPACK=0 ;
export TORCH_CUDA_ARCH_LIST=“8.7” ;
export PYTORCH_BUILD_VERSION=2.0.1 ;
export PYTORCH_BUILD_NUMBER=42
python setup.py bdist_wheel

But i get this error message:

[642/6109] Building C object confu-deps/XNNPACK/CMakeFiles…prod.dir/src/pf32-gemm/pf32-gemm-32x32-minmax-neonsme2.c.o
FAILED: confu-deps/XNNPACK/CMakeFiles/microkernels-prod.dir/src/pf32-gemm/pf32-gemm-32x32-minmax-neonsme2.c.o
/usr/bin/cc -DFXDIV_USE_INLINE_ASSEMBLY=0 -DXNN_ENABLE_ARM_BF16=0 -DXNN_ENABLE_ARM_DOTPROD=1 -DXNN_ENABLE_ARM_FP16_SCALAR=1 -DXNN_ENABLE_ARM_FP16_VECTOR=1 -DXNN_ENABLE_ARM_I8MM=0 -DXNN_ENABLE_ARM_SME2=1 -DXNN_ENABLE_ARM_SME=1 -DXNN_ENABLE_ASSEMBLY=1 -DXNN_ENABLE_AVX256SKX=0 -DXNN_ENABLE_AVX256VNNI=0 -DXNN_ENABLE_AVX256VNNIGFNI=0 -DXNN_ENABLE_AVX512AMX=0 -DXNN_ENABLE_AVX512F=1 -DXNN_ENABLE_AVX512FP16=0 -DXNN_ENABLE_AVX512SKX=1 -DXNN_ENABLE_AVX512VBMI=1 -DXNN_ENABLE_AVX512VNNI=1 -DXNN_ENABLE_AVX512VNNIGFNI=1 -DXNN_ENABLE_AVXVNNI=0 -DXNN_ENABLE_AVXVNNIINT8=0 -DXNN_ENABLE_CPUINFO=1 -DXNN_ENABLE_DWCONV_MULTIPASS=0 -DXNN_ENABLE_GEMM_M_SPECIALIZATION=1 -DXNN_ENABLE_HVX=1 -DXNN_ENABLE_KLEIDIAI=0 -DXNN_ENABLE_MEMOPT=1 -DXNN_ENABLE_RISCV_VECTOR=1 -DXNN_ENABLE_SPARSE=1 -DXNN_ENABLE_VSX=1 -I/home/nvidia/code/pytorch/third_party/XNNPACK/include -I/home/nvidia/code/pytorch/third_party/XNNPACK/src -I/home/nvidia/code/pytorch/third_party/pthreadpool/include -I/home/nvidia/code/pytorch/third_party/FXdiv/include -isystem /home/nvidia/code/pytorch/third_party/protobuf/src -O3 -DNDEBUG -std=c99 -fPIC -Wno-psabi -O2 -pthread -fno-math-errno -march=armv8.2-a+sve+sve2 -MD -MT confu-deps/XNNPACK/CMakeFiles/microkernels-prod.dir/src/pf32-gemm/pf32-gemm-32x32-minmax-neonsme2.c.o -MF confu-deps/XNNPACK/CMakeFiles/microkernels-prod.dir/src/pf32-gemm/pf32-gemm-32x32-minmax-neonsme2.c.o.d -o confu-deps/XNNPACK/CMakeFiles/microkernels-prod.dir/src/pf32-gemm/pf32-gemm-32x32-minmax-neonsme2.c.o -c /home/nvidia/code/pytorch/third_party/XNNPACK/src/pf32-gemm/pf32-gemm-32x32-minmax-neonsme2.c
cc1: error: invalid feature modifier ‘sve2’ in ‘-march=armv8.2-a+sve+sve2’
cc1: note: valid arguments are: fp simd crypto crc lse fp16 rcpc rdma dotprod aes sha2 sha3 sm4 fp16fml sve profile rng memtag sb ssbs predres; did you mean ‘sve’?
[651/6109] Building C object confu-deps/XNNPACK/CMakeFiles…/qd8-f16-qb4w-gemm-1x16-minmax-neonfp16arith-mlal-lane.c.o
ninja: build stopped: subcommand failed.

Hi,
Here are some suggestions for the common issues:

1. Performance

Please run the below command before benchmarking deep learning use case:

$ sudo nvpmodel -m 0
$ sudo jetson_clocks

2. Installation

Installation guide of deep learning frameworks on Jetson:

3. Tutorial

Startup deep learning tutorial:

4. Report issue

If these suggestions don’t help and you want to report an issue to us, please attach the model, command/step, and the customized app (if any) with us to reproduce locally.

Thanks!

Hi,

It looks like you have a similar issue as the below link.
Please check if the WAR can also fix your issue.

For Orin, you can also consider upgrading the software to JetPack 6.1 which supports Python 3.10 by default.
Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.