I am trying to build pytorch with python 3.9 version from the source as we dont have ready made .whl file for python 3.9.
Could please provide me .whl file for python 3.9 compatible with pytorch 2.1.0 for Jetpack 5.1.2,
so that we can install it easily. As we getting below error when we try to follow the steps provided in the above link
Also under the apply patches section from the above link, I dont see a patch for our Jetpack 5.1.2 version.
Kindly provide the patch for Jetpack 5.1.2 to be applied as part of installation step.
Apply Patch
Select the patch to apply from below based on the version of JetPack you’re building on. The patches avoid the “too many CUDA resources requested for launch” error (PyTorch issue #8103 , in addition to some version-specific bug fixes.
Currently, we only provide the package for the default Python version.
For JetPack 5.1.2, it’s Python 3.8 so please build it from the source if Python 3.9 is required.
Also, Before installing this Pytorch v 2.1.0 with Python 3.9, I will uninstall my previous Pytorch v2.1.0 with Python 3.8, I had installed with the available wheel file as per the thread( Which provides pytorch installation steps).
The command to uninstall completely and safely so that, it wont effect other related software components is:
> $ sudo pip3 uninstall -y torch
Please confirm, if this uninstallation command is fine, or should we do some purging or manually delete some folders to completely remove the pytorch related folders.
**$ git clone --recursive --branch v2.1.0 GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration ** $ cd pytorch //Set Build Options $ export USE_NCCL=0 $ export USE_DISTRIBUTED=0 # skip setting this if you want to enable OpenMPI backend $ export USE_QNNPACK=0 $ export USE_PYTORCH_QNNPACK=0 $ export TORCH_CUDA_ARCH_LIST=“5.3;6.2;7.2;8.7” # or “7.2;8.7” for JetPack 5 wheels for Xavier/Orin $ export PYTORCH_BUILD_VERSION=2.1.0 # without the leading ‘v’, e.g. 1.3.0 for PyTorch v1.3.0 $ export PYTORCH_BUILD_NUMBER=1
But I am getting below error for the last command “$ python3.9 setup.py bdist_wheel” as per the steps provided in the link:
root@linux:/home/cabs-willet/Downloads/pytorch# python3.9 setup.py bdist_wheel
Building wheel torch-2.1.0
Traceback (most recent call last):
File “/home/cabs-willet/Downloads/pytorch/setup.py”, line 339, in
cmake = CMake()
File “/home/cabs-willet/Downloads/pytorch/tools/setup_helpers/cmake.py”, line 40, in init
self._cmake_command = CMake._get_cmake_command()
File “/home/cabs-willet/Downloads/pytorch/tools/setup_helpers/cmake.py”, line 67, in _get_cmake_command
raise RuntimeError(“no cmake or cmake3 with version >= 3.18.0 found”)
RuntimeError: no cmake or cmake3 with version >= 3.18.0 found
Pls let us know how to fix these errors and successfully install pytorch for python3.9
Also there was a new requirement from customer to install MiniConda/Conda
I installed MiniConda. Is it due that it is referring to 3.18 version?
How to uninstall MiniConda just in case if that is the issue?
I am getting the below error when trying to install the .whl file that was generated for python3.9:
root@linux:/home/cabs-willet/Downloads/pytorch/dist# pip3 install numpy torch-2.1.0-cp39-cp39-linux_aarch64.whl ERROR: torch-2.1.0-cp39-cp39-linux_aarch64.whl is not a supported wheel on this platform.
Thanks a lot for these steps to build cmake 3.22 even though bit late. I will document this and try out later in case it is needed.
I was able to install cmake 3.20 by following these steps some how by fixing so many errors related to CUDA later on:
Is the Pytorch package for Python 3.9 built by yourself or downloaded from the website?
Since online packages are usually not built with CUDA support.
root@linux:/home/cabs-willet/Downloads/pytorch/dist# pip3 install numpy torch-2.1.0-cp39-cp39-linux_aarch64.whl
ERROR: torch-2.1.0-cp39-cp39-linux_aarch64.whl is not a supported wheel on this platform.
Based on the error, could you check if the below command helps?
It was built by myself.During to be this process I got some error related to CUDA saying two versions of CUDA etc, I resolved those by editing the corresponding config files and proceed further to complete the build and installation finally.
That is my post only. After linking the python to 3.9 version Pytorch wheel file got installed.