Compiling torchvision 0.19.0 for torch 2.4.0a0+07cecf4168.nv24.05.14710581

Dear all,
I have installed pytorch 2.4 2.4.0a0+07cecf4168.nv24.05.14710581 using the guide here

I got the message that I also need torchvision

ERROR: pip’s dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
sam-2 1.0 requires torchvision>=0.18.1, which is not installed.
timm 1.0.8 requires torchvision, which is not installed.
torchpack 0.3.1 requires torchvision, which is not installed.

I was not able to to find prebuilt torchvision for torch 2.4 at

I tried to install torchvision 0.19 using this guide (see installation section)

I selected the branch release/0.19
I got the following error while compiling

aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DWITH_CUDA -I/home/luigi/quaesta/torchvision/torchvision/csrc -I/data1/env/sam2p310/lib/python3.10/site-packages/torch/include -I/data1/env/sam2p310/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/data1/env/sam2p310/lib/python3.10/site-packages/torch/include/TH -I/data1/env/sam2p310/lib/python3.10/site-packages/torch/include/THC -I/usr/local/cuda/include -I/data1/env/sam2p310/include -I/usr/include/python3.10 -c /home/luigi/quaesta/torchvision/torchvision/csrc/ops/nms.cpp -o build/temp.linux-aarch64-cpython-310/home/luigi/quaesta/torchvision/torchvision/csrc/ops/nms.o -g0 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE="_gcc" -DPYBIND11_STDLIB="_libstdcpp" -DPYBIND11_BUILD_ABI="_cxxabi1016" -DTORCH_EXTENSION_NAME=_C -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++17
/home/luigi/quaesta/torchvision/torchvision/csrc/ops/nms.cpp: In function ‘void vision::ops::TORCH_LIBRARY_FRAGMENT_init_torchvision_3(torch::Library&)’:
/home/luigi/quaesta/torchvision/torchvision/csrc/ops/nms.cpp:22:5: error: ‘class torch::Library’ has no member named ‘set_python_module’
22 | m.set_python_module(“torchvision._meta_registrations”);
| ^~~~~~~~~~~~~~~~~
error: command ‘/usr/bin/aarch64-linux-gnu-gcc’ failed with exit code 1

This infor may be useful

Package: nvidia-jetpack
Source: nvidia-jetpack (6.0)
Version: 6.0+b106
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 6.0+b106), nvidia-jetpack-dev (= 6.0+b106)
Homepage: Jetson - Embedded AI Computing Platform | NVIDIA Developer
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_6.0+b106_arm64.deb
Size: 29296
SHA256: 561d38f76683ff865e57b2af41e303be7e590926251890550d2652bdc51401f8
SHA1: ef3fca0c1b5c780b2bad1bafae6437753bd0a93f
MD5sum: 95de21b4fce939dee11c6df1f2db0fa5
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8

Package: nvidia-jetpack
Source: nvidia-jetpack (6.0)
Version: 6.0+b87
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-jetpack-runtime (= 6.0+b87), nvidia-jetpack-dev (= 6.0+b87)
Homepage: Jetson - Embedded AI Computing Platform | NVIDIA Developer
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_6.0+b87_arm64.deb
Size: 29298
SHA256: 70be95162aad864ee0b0cd24ac8e4fa4f131aa97b32ffa2de551f1f8f56bc14e
SHA1: 36926a991855b9feeb12072694005c3e7e7b3836
MD5sum: 050cb1fd604a16200d26841f8a59a038
Description: NVIDIA Jetpack Meta Package
Description-md5: ad1462289bdbc54909ae109d1d32c0a8

Thanks for your help.

Hi,

We can build TorchVision 0.19.0 on JetPack 6 without issue.
Here are the steps for your reference:

PyTorch

$ python3 -m pip install --no-cache https://developer.download.nvidia.com/compute/redist/jp/v60/pytorch/torch-2.4.0a0+f70bd71a48.nv24.06.15634931-cp310-cp310-linux_aarch64.whl

cuSPARSELt

$ wget https://developer.download.nvidia.com/compute/cusparselt/0.6.2/local_installers/cusparselt-local-tegra-repo-ubuntu2204-0.6.2_1.0-1_arm64.deb
$ sudo dpkg -i cusparselt-local-tegra-repo-ubuntu2204-0.6.2_1.0-1_arm64.deb
$ sudo cp /var/cusparselt-local-tegra-repo-ubuntu2204-0.6.2/cusparselt-*-keyring.gpg /usr/share/keyrings/
$ sudo apt-get update
$ sudo apt-get -y install libcusparselt0 libcusparselt-dev

TorchVision

$ git clone  https://github.com/pytorch/vision torchvision
$ cd torchvision/
$ git checkout v0.19.0
$ python3 setup.py install --user
...
Using /usr/lib/python3/dist-packages
Finished processing dependencies for torchvision==0.19.0a0+48b1edf

Thanks.

Thank you very much, as you mentioned the problem is that we needed pytorch 2.4 … nv24.07 and not nv24.05 to compile torchvision 0.19.0

nv24.07 which requires as you listed to have cuSPARSELt installed separately

best,
Luigi

Hi,

Do you mean you need PyTorch 2.4 specifically?
But TorchVision 0.19 is not working with that PyTorch version?

Thanks.

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