# Pytorch installation error

**URL:** <https://forums.developer.nvidia.com/t/pytorch-installation-error/275517>\
**Category:** General Topics & Other SDKs\
**Tags:** tensorflow, jetson-inference\
**Created:** [December 9, 2023, 6:55pm UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517 "2023-12-09T18:55:26Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![sidhu.rana34](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sidhu.rana34](https://forums.developer.nvidia.com/u/sidhu.rana34)\
**Post date:** [December 9, 2023, 6:55pm UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/1 "2023-12-09T18:55:26Z")

</div>

Hi ,  
i have upgrade my cuda from 11,4 to 12.2 using the following steps:  
wget [https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/arm64/cuda-keyring\_1.1-1\_all.deb](https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/arm64/cuda-keyring_1.1-1_all.deb)  
sudo dpkg -i cuda-keyring\_1.1-1\_all.deb  
sudo apt-get update  
sudo apt-get -y install cuda  
sudo gedit ~/.bashrc  
export PATH=/usr/local/cuda-12.2/bin${PATH:+:${PATH}}  
export LD\_LIBRARY\_PATH=/usr/local/cuda-12.2/${LD\_LIBRARY\_PATH:+:${LD\_LIBRARY\_PATH}}  
source ~/.bashrc

after that i am ablr=e to clone the pytorch using the following steps:

```auto
git clone --recursive --branch v2.1.1 http://github.com/pytorch/pytorch

```

```auto
export USE_NCCL=0 && \
export USE_QNNPACK=0 && \
export USE_PYTORCH_QNNPACK=0 && \
export USE_CUDA=1 & \
export USE_NATIVE_ARCH=1 && \
export USE_DISTRIBUTED=1 && \
export USE_TENSORRT=0 && \
export TORCH_CUDA_ARCH_LIST="8.7" 

export PYTORCH_BUILD_VERSION=2.1.1 && \
export PYTORCH_BUILD_NUMBER=1

```

```auto
cd pytorch
pip install -U -r requirements.txt
pip install -U scikit-build
pip install -U ninja
sudo apt remove cmake -y
pip install cmake --upgrade
export TORCH_CUDA_ARCH_LIST="8.7"
python setup.py bdist_wheel 

but when i am trying to clone torchvision
git clone --branch v0.16.1 https://github.com/pytorch/vision torchvision # see below for version of torchvision to download
cd torchvision
export BUILD_VERSION=0.16.1 # where 0.x.0 is the torchvision version  
export TORCH_CUDA_ARCH_LIST="8.7"
python setup.py bdist_wheel

i am getting error that no module named torch .
```

---

<div class="post-metadata">

**Author:** ![rajupadhyay59](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rajupadhyay59](https://forums.developer.nvidia.com/u/rajupadhyay59)\
**Post date:** [December 13, 2023, 12:02am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/2 "2023-12-13T00:02:05Z")

</div>

What machine is it? Jetson? (since i saw arm64, I am assuming it is unless I am wrong)  
If it is Jetson, do not upgrade your CUDA version that way or in any way.  
It is not supposed to be upgraded.

---

<div class="post-metadata">

**Author:** ![sidhu.rana34](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sidhu.rana34](https://forums.developer.nvidia.com/u/sidhu.rana34)\
**Post date:** [December 13, 2023, 1:21am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/3 "2023-12-13T01:21:21Z")

</div>

i have upgraded it from 11.4 to 12.2 nd i am able to install pytorch also but dnt know whether it is cuda version or not and also my system got slow after that could you please suggest me something

---

<div class="post-metadata">

**Author:** ![rajupadhyay59](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rajupadhyay59](https://forums.developer.nvidia.com/u/rajupadhyay59)\
**Post date:** [December 13, 2023, 1:25am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/4 "2023-12-13T01:25:03Z")

</div>

What is your system environment?  
What device? Jetson or x86?  
Give a bit more information please.

If it is jetson, you can upgrade it upto 11.8. (Although I have never tried it)  
Refer these links

> [@Upgrade to latest CUDA on Jetson without upgrading JetPack](https://forums.developer.nvidia.com/t/upgrade-to-latest-cuda-on-jetson-without-upgrading-jetpack/230607):
>
> Starting from CUDA 11.8, Jetson users on JetPack 5.0 and above will have the ability to upgrade to the latest and greatest CUDA versions without the need to update the JetPack version or Jetson Linux BSP. To know more on how to upgrade CUDA on your Jetson device today, read our blog [Simplifying CUDA Upgrades for NVIDIA Jetson Users | NVIDIA Technical Blog](https://developer.nvidia.com/blog/simplifying-cuda-upgrades-for-nvidia-jetson-users/) On the [CUDA 11.8 Downloads](https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.nvidia.com%2Fcuda-downloads&data=05%7C01%7Csuhash%40nvidia.com%7Cd8e5ebfd10c64901731808da94d7d4ee%7C43083d15727340c1b7db39efd9ccc17a%7C0%7C0%7C637985951956451491%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=JJc6WOS%2B6KgO9%2BFeHqu3T%2F6BnhVmVWN%2F2A8Uxqwtx8E%3D&reserved=0) page, download the CUDA installer for “aarch64-Jetson” and follow the installation instructions to upgrade your…

> **[Simplifying CUDA Upgrades for NVIDIA Jetson Users | NVIDIA Technical Blog](https://developer.nvidia.com/blog/simplifying-cuda-upgrades-for-nvidia-jetson-users/)**
>
> With CUDA Toolkit 11.8 and NVIDIA JetPack 5.0, you can upgrade to the latest CUDA release without updating NVIDIA JetPack or Jetson Linux BSP software.

---

<div class="post-metadata">

**Author:** ![sidhu.rana34](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sidhu.rana34](https://forums.developer.nvidia.com/u/sidhu.rana34)\
**Post date:** [December 13, 2023, 2:11am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/5 "2023-12-13T02:11:49Z")

</div>

jetson arm64

---

<div class="post-metadata">

**Author:** ![rajupadhyay59](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rajupadhyay59](https://forums.developer.nvidia.com/u/rajupadhyay59)\
**Post date:** [December 13, 2023, 6:53am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/6 "2023-12-13T06:53:19Z")

</div>

So your Jetpack must be 5.1.1 or 5.1.2

As you can see in that link, the default cuda version is 11.4 and the max you can do is 11.8.

Please refer to those sites when upgrading your cuda version.

---

<div class="post-metadata">

**Author:** ![sidhu.rana34](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sidhu.rana34](https://forums.developer.nvidia.com/u/sidhu.rana34)\
**Post date:** [December 13, 2023, 1:46pm UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/7 "2023-12-13T13:46:54Z")

</div>

hi,  
yes i have installed jetpack 5.1.2 , nd default version is 11.4 ,but i didnt find how to install pytorch for cuda11.4 on nvidia documentation

---

<div class="post-metadata">

**Author:** ![MarkusHoHo](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/markushoho/32/233145_2.png) [@MarkusHoHo](https://forums.developer.nvidia.com/u/MarkusHoHo)\
**Post date:** [December 13, 2023, 2:20pm UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/8 "2023-12-13T14:20:37Z")

</div>

Hi @sidhu.rana34, for Jetson related topics I highly recommend the [dedicated Jetson categories](https://forums.developer.nvidia.com/c/agx-autonomous-machines/jetson-embedded-systems/70).

If you tell us which model exactly you are using, I can point you to the correct sub-forum.

Thanks!

---

<div class="post-metadata">

**Author:** ![rajupadhyay59](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rajupadhyay59](https://forums.developer.nvidia.com/u/rajupadhyay59)\
**Post date:** [December 14, 2023, 12:44am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/9 "2023-12-14T00:44:17Z")

</div>

@sidhu.rana34 Hi  
I believe this link will help you.  
For any kind of installation on jetson, you will probably find an answer in this nvidia developer forum.

> [@PyTorch for Jetson](https://forums.developer.nvidia.com/t/pytorch-for-jetson/72048):
>
> Below are pre-built PyTorch pip wheel installers for Jetson Nano, TX1/TX2, Xavier, and Orin with JetPack 4.2 and newer. Download one of the PyTorch binaries from below for your version of JetPack, and see the installation instructions to run on your Jetson. These pip wheels are built for ARM aarch64 architecture, so run these commands on your Jetson (not on a host PC). You can also use the containers from [jetson-containers](https://github.com/dusty-nv/jetson-containers). PyTorch pip wheels JetPack 6 ▶ PyTorch v2.3.0 ▶ PyTorch v2.2.0 ▶ PyT…

This link shows Pytorch v2.1.0:  
for jetpack 5.1, 5.1.1 and 5.1.2

 ![image](https://global.discourse-cdn.com/nvidia/original/4X/f/c/3/fc3890c1325a74e2d3666a747841942466eef2c5.png)

I believe this link can also help you alot for pytorch installation.

> **[Installing PyTorch for Jetson Platform - NVIDIA Docs](https://docs.nvidia.com/deeplearning/frameworks/install-pytorch-jetson-platform/index.html)**
>
> This guide provides instructions for installing PyTorch for Jetson Platform.

for torchvision if you ever want to do it, follow the first link again or keep searching for it in the forum, you’ll find something.

---

<div class="post-metadata">

**Author:** ![sidhu.rana34](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@sidhu.rana34](https://forums.developer.nvidia.com/u/sidhu.rana34)\
**Post date:** [December 14, 2023, 12:49am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/10 "2023-12-14T00:49:10Z")

</div>

Hi , i am going to use yolov7 model

---

<div class="post-metadata">

**Author:** ![rajupadhyay59](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@rajupadhyay59](https://forums.developer.nvidia.com/u/rajupadhyay59)\
**Post date:** [December 14, 2023, 12:53am UTC](https://forums.developer.nvidia.com/t/pytorch-installation-error/275517/11 "2023-12-14T00:53:51Z")

</div>

That came out of nowhere but you’ll find tons of guides and tutorials and github links related to yolov7 or any yolo version on a jetson, be it tensorrt (c++ or python) or tensorrt with deepstream.

I hope you can do your pytorch installation.

Thanks.
