Different cuda versions installed and cuda unavailable | Jetson Orin NX

Hi,

I was facing a problem regarding the install of cuda compatible torch. I followed the usual procedure in PyTorch for Jetson.

However, each time I get False when running torch.cuda.is_available()

I tried different torch and torchvision versions each time respecting the compatibility matrix, but still doesn’t work.

Now i ran few other commands and I’m not sure if the my current cuda is 11.4 or 12.1:

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Sun_Oct_23_22:16:07_PDT_2022
Cuda compilation tools, release 11.4, V11.4.315
Build cuda_11.4.r11.4/compiler.31964100_0

orin_nano@nano-desktop:/$ jetson_release -v
Software part of jetson-stats 4.2.3 - (c) 2023, Raffaello Bonghi
Model: NVIDIA Orin NX Developer Kit - Jetpack 5.1.1 [L4T 35.3.1]
NV Power Mode[0]: MAXN
Serial Number: [XXX Show with: jetson_release -s XXX]
Hardware:

  • 699-level Part Number: 699-13767-0000-300 K.1
  • P-Number: p3767-0000
  • Module: NVIDIA Jetson Orin NX (16GB ram)
  • SoC: tegra23x
  • CUDA Arch BIN: 8.7
  • Codename: P3768
    Platform:
  • Machine: aarch64
  • System: Linux
  • Distribution: Ubuntu 20.04 focal
  • Release: 5.10.104-tegra
  • Python: 3.8.10
    jtop:
  • Version: 4.2.3
  • Service: Active
    Libraries:
  • CUDA: 12.1.66
  • cuDNN: 8.6.0.166
  • TensorRT: 5.1.1
  • VPI: 2.2.7
  • Vulkan: 1.3.204
  • OpenCV: 4.5.4 - with CUDA: NO

Maybe it is the source of my problem. how to correct it ? or do I have to reflash it using SDK manager ?

I just repeated the installs on a Jetson Orin AGX this time and it worked perfectly under Cuda 11.4.

Does the torch install procedure not work with Orin NX ?

Hi @nisso94, you have CUDA 12.1 installed, but those PyTorch wheels were built for CUDA 11.4. Instead, either use CUDA 11.4 or re-build PyTorch against CUDA 12.1. Or you can use l4t-pytorch container that already has the compatible versions installed.

Ok thanks,

then I guess the first step would be to rebuild cuda compiler in order to have 12.1 in nvcc --version before rebuilding PyTorch, am I right ?

@nisso94 you should just have /usr/local/cuda-12.2/bin in your $PATH, or make it link to /usr/local/cuda. Then nvcc --version 12.2 should be your default version.

Ok. If I think this is due to a bad installing of 12.1. If I want to only have 11.4 what can I do please ? I want to delete any other cuda version and correctly reinstall 11.4 in order to not have multiple versions anymore.

@nisso94 I would probably just re-flash the device to get it back in a known-working state, but otherwise you probably want to remove/purge those packages via apt as opposed to just deleting the directories.

1 Like

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