Torch.cuda.is_available() returns False

I’m on a Jetson nano and I need to use pytorch cuda, apparently during installation everything goes well, but when checking torch.cuda.is_available it returns False, in addition the version of torch is not cuda, but the default. (I used pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118)

At first I thought it could be my cuda version, which by default was 10.2, but then I installed 11.8 (https://developer.nvidia.com/cuda-11-8-0-download-archive?target_os=Linux&target_arch = aarch64-jetson&Compilation=Native&Distribution=Ubuntu&target_version=20.04&target_type=deb_local)
no problem: nvcc: NVIDIA(R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Wed_Sep_21_10:43:33_PDT_2022
Cuda Build Tools, Version 11.8, V11.8.89
Build cuda_11.8.r11.8/compiler.31833905_0

Still the problem persists

Hi @gabrielmurilocicotoste6, please install one of the PyTorch wheels from this topic that were compiled for JetPack 4 and CUDA 10.2:

You probably will have to revert the changes you made with CUDA 11.8 back to 10.2, because not only is CUDA 11 not supported on JetPack 4 (note that the Ubuntu package version for what you installed was 20.04, while JetPack 4 is on 18.04), but the PyTorch wheels for JetPack 4 were also built against 10.2 and you would get a similar error if you tried running PyTorch wheels built against a different major version of CUDA.

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