Cuda not working on NVIDIA Jetson

I’m trying to get cuda working on Nvidia Jetson AGX Xavier with PyTorch but torch.cuda.is_available() keeps returning false. I have installed Cuda 11.4 along with the standard Jetpack (v5.1.3-b29) installation. I have also installed Python 3.9, PyTorch 2.0.1 compiled with Cuda 11.8 and TorchVision 0.15.

I would appreciate any help I can get in solving this issue. Thanks in advance.

Did you install the PyTorch binaries from here or somewhere else?

No, for this current installation I installed from the PyTorch website wrt to this comment on a old topic.

I had previously installed PyTorch from the link you gave but instead of using cuda 11.4 that came standard with Jetpack 5.1.3. I flashed the Jetson without cuda and installed cuda 11.8 and 12.1 separately. It didn’t work in both cases. I will try installing PyTorch again from the link you gave with my current cuda installation.

The linked post does not mention the Jetson platform, so install the binaries from the link I’ve posted or run an L4T container.

Installing PyTorch from the above link worked. torch.cuda.is_available() returns True. Thanks for the help!

Below are the current settings,
Jetpack - v5.1.3-b29
Cuda - 11.4
Python - 3.8
PyTorch - 2.1.0
Torchvision - 0.16.1