Pytorch(Cuda is False) is for Jetpack 6.1 on Jetson Orin Agx

I am struggling with install Pytoch and torchvision for latest Jetpack 6.1 on Jetson Orin AGX Developer Kit.
I am working with yolo and it runs with cpu but I need cuda support with pytorch.
Please, Can anyone help me with step by step guides.
Thank you!

dalab@ubuntu:~/vision$ python
Python 3.10.12 (main, Nov 6 2024, 20:22:13) [GCC 11.4.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import torch
print(“CUDA Available:”, torch.cuda.is_available())
CUDA Available: False
print(“Device Name:”, torch.cuda.get_device_name(0) if torch.cuda.is_available() else “CUDA not available”)
Device Name: CUDA not available
x = torch.rand(3, 3).cuda()
Traceback (most recent call last):
File “”, line 1, in
File “/home/dalab/.local/lib/python3.10/site-packages/torch/cuda/init.py”, line 310, in _lazy_init
raise AssertionError(“Torch not compiled with CUDA enabled”)
AssertionError: Torch not compiled with CUDA enabled
print(“Tensor on GPU:”, x)
Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘x’ is not defined
exit()
dalab@ubuntu:~/vision$ cd …
dalab@ubuntu:~$ python3 -c “import torchvision; print(torchvision.version)”
0.20.1
dalab@ubuntu:~$ python3 -c “import torch; print(torch.version); print(torch.cuda.is_available())”
2.5.1
False
dalab@ubuntu:~$

This post has a link to Pytorch 2.5 wheel that was built with Cuda 12.6. This worked for me.

1 Like

Yes as whitesscott suggest please download prebuilt wheel from this website.

You could also refer to this doc to get more information about YoloV11 using Pytorch.
https://elinux.org/Jetson/L4T/TRT_Customized_Example#YoloV11_using_Pytorch

Thanks

Thanks.
However, I address this issue already. I built TorchVision from source code on GitHub .
And I posted one documentation on GitHub to guide others who is struggling just like me.

2 Likes

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