How to install pytorch from source on orin?

Hi, I want to install pytorch from source on one of the Jetson orins. Currently, I have been able to install pytorch (normal) on Windows and Orin. Additionally, I am in the process of installing pytorch (from source) on my Windows.

Now, I wanted to know how to install pytorch (from source) on a Jetson Orin since I would need to modify the source code and recompile it multiple times. How different is - installing Pytorch (from source) on an Orin from windows since Orin used ARM and Windows uses x86 what could be some of the issues when one tries to port from Windows to Orin?

PS: I’ve already checked out the following link given in pytorch github. But, wanted a more detailed explanation

Thanks a lot !!

You would need to install JetPack as well as some requirements mentioned here. This should allow you to build PyTorch from source.

Hello, I want to install a specific version of pytorch ( PyTorch 2.1.2 with CUDA 11.8) on a jetson orin, since you mentioned you have a succeded to install pytorch (normal) on orin. Can you please tell me how did you do that ?
thanks a lot

You would need to stick to the CUDA version spported by JetPack and could then follow the build instructions posted in the first link or just download the binaries.

thank you for your answer. It installed successfully.
Pytorch v2.2.0 , Jetpack 6.0 ,Torchvision v0.17.1 , python 3.10. for a jetson orin.
If someone had the same issue!

Hello @ptrblck,

I was trying to install PyTorch from source, from the.whl I am not able to use distributed packages, I guess those are not installed when installing with .whl. So I was trying to install from source, but I am worried about which version? I can check out to v2.x.x, but are they compatible with Jetson?
Typical .whl file version will be .nv* but if I download from source, the version would be . So, will this be compatible, or is there any specific branch that I should use?

Jetson Orin does not support distributed applications which is why the wheel is not building the distributed backend.

Yes, every release from the past few years is compatible with Jetson devices (I don’t know exactly when Orin support was added but could look it up if needed).

Hello @ptrblck

Is it just that installing from .whl does not support distrubuted or even by installing from source does not support? If not with jetson orin is distributed supported with Xavier?

If you are trying to build from source you could try to enable Gloo as a CPU backend for multi-node use cases (I’m not deeply familiar with Gloo), but I don’t believe there was NCCL support for sm_87 in Jetpack, which is why NCCL is disabled in the wheel build.