Updating Jetson AGX Orin with Jepack 5.1.2 to CUDA 11.8 and PyTorch installation from source

konegen: <p>Hello everyone,</p>
<p>I am trying to run <strong>Seamless Streaming</strong> from Meta on my NVIDIA Jetson AGX Orin 64GB. For this, I am using the model from Hugging Face, which is also used in the GitHub repository.</p>
<p>The two main components I need to install are <strong>PyTorch</strong> and <strong>fairseq2</strong>. As indicated in the <code>setup.py</code>, I need <strong>fairseq2 version 0.2</strong>.</p>
<p>For fairseq2 (v0.2.1), the README states the following requirements:</p>
<ul>
<li>Python 3.8 to 3.11</li>
<li>PyTorch 2.1.0 or 2.1.1</li>
<li>CUDA 11.8 or 12.1</li>
</ul>
<p>I then checked which Jetpack versions are compatible. I decided to use <strong>Jetpack 5.1.2</strong> and flashed my Jetson Orin with it. However, Jetpack 5.1.2 installs <strong>CUDA 11.4</strong> by default. According to this NVIDIA page, CUDA can easily be updated.</p>
<p>Next, I downloaded and installed <strong>CUDA 11.8</strong> from this NVIDIA website.</p>
<p>Here are the steps I followed:</p>
<pre><code class="lang-auto">wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/arm64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-tegra-repo-ubuntu2004-11-8-local_11.8.0-1_arm64.deb
sudo dpkg -i cuda-tegra-repo-ubuntu2004-11-8-local_11.8.0-1_arm64.deb
sudo cp /var/cuda-tegra-repo-ubuntu2004-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda
</code></pre>
<p>I then added the CUDA path to my <code>.bashrc</code> as shown in this NVIDIA documentation:</p>
<pre><code class="lang-auto">export PATH=/usr/local/cuda-11.8/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib64:$LD_LIBRARY_PATH
</code></pre>
<p>I found that the precompiled PyTorch <code>.whl</code> files are built for CUDA 11.4. Therefore, PyTorch for CUDA 11.8 must be built from source.</p>
<p>I created a Conda environment with Python 3.8:</p>
<pre><code class="lang-auto">conda create --name seamless python=3.8
</code></pre>
<p>Then, I followed these steps to install PyTorch from source:</p>
<pre><code class="lang-auto">git clone --recursive --branch v2.1.0 http://github.com/pytorch/pytorch
cd pytorch

export USE_NCCL=0
export USE_DISTRIBUTED=0
export USE_QNNPACK=0
export USE_PYTORCH_QNNPACK=0
export TORCH_CUDA_ARCH_LIST="7.2;8.7"

export PYTORCH_BUILD_VERSION=2.1.0
export PYTORCH_BUILD_NUMBER=1

sudo apt-get install python3-pip cmake libopenblas-dev libopenmpi-dev 

pip install -r requirements.txt
pip install scikit-build
pip install ninja

python setup.py bdist_wheel
</code></pre>
<p>Then I installed the <code>.whl</code> file from the build folder:</p>
<pre><code class="lang-auto">pip install pytorch...
</code></pre>
<p>Everything seemed to go well, and I confirmed CUDA 11.8 was installed using:</p>
<pre><code class="lang-auto">nvcc --version
</code></pre>
<p>However, when I check within my environment, I get the following:</p>
<pre><code class="lang-auto">python
import torch
print(torch.version.cuda)
</code></pre>
<p>This still shows <strong>CUDA 11.4</strong>.</p>
<p>Why is CUDA 11.4 still being displayed when I am using CUDA 11.8? Could someone help me figure out what I might be doing wrong?</p>
<p>Here is also the post at <a href="https://forums.developer.nvidia.com/t/updating-jetson-agx-orin-with-jepack-5-1-2-to-cuda-11-8-and-pytorch-installation-from-source/326927/1" rel="noopener nofollow ugc">NVIDIA forum</a> with some links to some information.</p>
<p>Thank you in advance for your assistance!</p>

konegen: <p>Hi everyone, I got an answer that works from here:</p><aside class="onebox discoursetopic" data-onebox-src="https://forums.developer.nvidia.com/t/updating-jetson-agx-orin-with-jepack-5-1-2-to-cuda-11-8-and-pytorch-installation-from-source/326927/4">
  <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/updating-jetson-agx-orin-with-jepack-5-1-2-to-cuda-11-8-and-pytorch-installation-from-source/326927/4" target="_blank" rel="noopener nofollow ugc" title="09:49AM - 13 March 2025">NVIDIA Developer Forums – 13 Mar 25</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/updating-jetson-agx-orin-with-jepack-5-1-2-to-cuda-11-8-and-pytorch-installation-from-source/326927/4" target="_blank" rel="noopener nofollow ugc">Updating Jetson AGX Orin with Jepack 5.1.2 to CUDA 11.8 and PyTorch...</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">Robotics &amp;amp; Edge Computing</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 Orin NX</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">pytorch</span>
            <span class="discourse-tag simple">cuda</span>
        </div>
      </div>
    </div>
  </div>
</div>

  <p>@AastaLLL thank you very much!  After the installation of CUDA and exports of the paths to CUDA 11.8, I get following:  nvcc --version nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2022 NVIDIA Corporation Built on...</p>


  </article>

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

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