How to install pytorch from source on orin?

Vinayaka_Hegde: <p>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.</p>
<p>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?</p>
<p>PS: I’ve already checked out the following link given in pytorch github. But, wanted a more detailed explanation</p>
<aside class="onebox discoursetopic" data-onebox-src="https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048">
  <header class="source">
      <img src="https://global.discourse-cdn.com/nvidia/optimized/2X/0/0372ccc95874f71d7fbff64bbbff6f8c69dd850b_2_32x32.png" class="site-icon" width="32" height="32">

      <a href="https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048" target="_blank" rel="noopener nofollow ugc" title="12:51AM - 27 March 2019">NVIDIA Developer Forums – 27 Mar 19</a>
  </header>

  <article class="onebox-body">
    <div class="aspect-image" style="--aspect-ratio:150/80;"><img src="https://global.discourse-cdn.com/nvidia/original/3X/e/4/e41d27491ee72562cf68c340597ca95f587879bd.png" class="thumbnail" width="150" height="80"></div>

<div class="title-wrapper">
  <h3><a href="https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048" target="_blank" rel="noopener nofollow ugc">PyTorch for Jetson</a></h3>
  <div class="topic-category">
      <span class="badge-wrapper bullet">
        <span class="badge-category-bg" style="background-color: #76B900;"></span>
        <span class="badge-category clear-badge">
          <span class="category-name">Autonomous Machines</span>
        </span>
      </span>
      <span class="badge-wrapper bullet">
        <span class="badge-category-bg" style="background-color: #76B900;"></span>
        <span class="badge-category clear-badge">
          <span class="category-name">Jetson &amp;amp; Embedded Systems</span>
        </span>
      </span>
      <span class="badge-wrapper bullet">
        <span class="badge-category-bg" style="background-color: #76B900;"></span>
        <span class="badge-category clear-badge">
          <span class="category-name">Jetson Nano</span>
        </span>
      </span>
    <div class="topic-header-extra">
      <div class="list-tags">
        <div class="discourse-tags">
          <svg class="fa d-icon d-icon-tag svg-icon svg-string"><use href="#tag"></use></svg>
            <span class="discourse-tag simple">opencv</span>
            <span class="discourse-tag simple">kb</span>
            <span class="discourse-tag simple">scikit</span>
            <span class="discourse-tag simple">mxnet</span>
        </div>
      </div>
    </div>
  </div>
</div>

  <p>Below are pre-built PyTorch pip wheel installers for Python on Jetson Nano, Jetson TX1/TX2, Jetson Xavier NX/AGX, and Jetson AGX Orin with JetPack 4.2 and newer.   Download one of the PyTorch binaries from below for your version of JetPack, and...</p>

  <p>
    <span class="label1">Reading time: 318 mins 🕑</span>
      <span class="label2">Likes: 171 ❤</span>
  </p>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>Thanks a lot !!</p>

ptrblck: <p>You would need to install <code>JetPack</code> as well as some requirements mentioned <a href="https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html#prereqs-install">here</a>. This should allow you to build PyTorch from source.</p>

Youssef_Haddouda: <p>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 ?<br>
thanks a lot</p>

ptrblck: <p>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.</p>

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