Torch import error nvidia-jetpack (6.2.2)

I have been unable to get torch working on the Jetson AGX Orin 64GB dev kit.

  • Ubuntu 22.06 LTS
  • JetPack 6.2.2
  • CUDA12.6
  • Python 3.10.12

I followed the steps provided in Installing PyTorch for Jetson Platform but have been unable to get it working.

I installed cuSPARSELt 0.9.0 directly, due to an error

bash ./install_cusparselt.sh
+ mkdir tmp_cusparselt
+ cd tmp_cusparselt
+ [[ 12.6 =~ ^12\.[1-4]$ ]]
+ [[ 12.6 == \1\1\.\8 ]]
+ tar xf .tar.xz
tar: .tar.xz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

After manual installation

I used the wheel provided in Jetson_AI_Stack (PyTorch 2.8.0) as well as jp6/cu126 index (torch-2.11.0).

but both similar error with libcupti.so.12
ImportError: libcupti.so.12: cannot open shared object file: No such file or directory

The goal would be to do some segmentation with SAM2.

I was able to get SAM2 working with container dustynv/pytorch:2.7-r36.4.0

Installing SAM2 also needed a few tweeks

The default url is pypi.jetson-ai-lab**.dev** needs to be changed to .io