Pytorch 2.0.0a0 wheel needs update to work with torchvision

I have Jetpack 5.1 installed on AGX Orin: R35 (release), REVISION: 2.1 and pytorch 2.0.0a0+8aa34602.nv23.3 from https://developer.download.nvidia.com/compute/redist/jp/v51/pytorch/torch-2.0.0a0+8aa34602.nv23.03-cp38-cp38-linux_aarch64.whl. It works fine. Building torchvision from source from GitHub - pytorch/vision: Datasets, Transforms and Models specific to Computer Vision fails due to outdated torch/utils/cpp_extension.py file, producing this error:

  File "/home/nick/yolo8/.venv/lib/python3.8/site-packages/torch/utils/cpp_extension.py", line 1786, in _get_cuda_arch_flags
    raise ValueError(f"Unknown CUDA arch ({arch}) or GPU not supported")
ValueError: Unknown CUDA arch (8.7+PTX) or GPU not supported

Replacing the cpp_extension.py file with the most current one from pytorch/cpp_extension.py at main · pytorch/pytorch · GitHub solves the problem. Could the maintainers build the most current binary of PyTorch 2.0, in order to avoid this problem?

1 Like

Hi,

Thanks for reporting this to us.

Is the cpp_extension.py located in PyTorch or TorchVision?
Could you share a way to reproduce the unknown CUA arch error?

Thanks.

Correct cpp_extension.py file is located at pytorch/cpp_extension.py at main · pytorch/pytorch · GitHub. Old (incorrect) file is installed by pytorch wheel.

After installing pytorch, do this:

sudo apt install libpng-dev libjpeg-dev
git clone https://github.com/pytorch/vision
cd vision
python3 setup.py install

Thanks @pauljurczak, we found what happened is that the PyTorch commit (#13ebff) that fixed this issue didn’t make it into the v2.0.0 branch, which is what we had been basing our v2.0 builds off of. We’ll get this fixed in the upcoming release of the next PyTorch wheel (23.05) - sorry about that. For now, please revert to manually patching it, or use the l4t-pytorch container which has it fixed too.

is this PyTorch wheel(23.05) released? please do send the links to download for the same if release

@gamingjugal21 it’s not been officially released yet, but you can try this rebuilt one here: https://nvidia.box.com/shared/static/i8pukc49h3lhak4kkn67tg9j4goqm0m7.whl

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.