Hi NVIDIA Jetson team,
I’m unable to get any CUDA-enabled PyTorch (source-built or wheels) to import on JetPack 6.2 (Orin NX 16GB) due to a missing cuSPARSE symbol:
ImportError: /home/nvidia/XEYE/.venv/lib/python3.10/site-packages/torch/lib/libtorch_cuda.so:
undefined symbol: cusparseSetMatDiagType, version libcusparse.so.12
This happens immediately on import torch:
import torch
print(torch.version)
print(torch.cuda.is_available())
System Info
$ cat /etc/nv_tegra_release
R36 (release), REVISION: 4.1, GCID: 36213792, BOARD: t186ref, EABI: aarch64, DATE: Wed Oct 23 15:03:35 UTC 2024$ nvcc --version
Cuda compilation tools, release 12.6, V12.6.77$ python --version
Python 3.10.12$ uname -a
Linux nvidia-desktop 5.15.0-1031-nvidia #31 SMP PREEMPT_DYNAMIC Wed Oct 23 15:03:35 UTC 2024 aarch64
Current cuSPARSE State
$ ls -l /usr/local/cuda-12.6/lib64/libcusparse.so.12*
lrwxrwxrwx 1 root root 65 Oct 24 08:43 /usr/local/cuda-12.6/lib64/libcusparse.so.12 → /usr/local/cuda/targets/aarch64-linux/lib/libcusparse.so.12.5.4.2
-rw-r–r-- 1 root root 102204552 Oct 24 07:36 /usr/local/cuda-12.6/lib64/libcusparse.so.12.5.4.2
What I’ve Tried (Complete History)
1. Prebuilt Wheels from Jetson AI Lab
pip install torch==2.8.0 --index-url https://pypi.jetson-ai-lab.dev/jp6/cu126
→ torch-2.8.0-cp310-cp310-linux_aarch64.whl
→ Fails with: libcusparse.so.12: cannot open shared object file
→ Fixed via: sudo apt install cuda-libraries-12-6 + symlink
→ Still fails with undefined symbol: cusparseSetMatDiagType
pip install torch-2.5.0a0+872d972e41.nv24.08-cp310-cp310-linux_aarch64.whl
→ Same error: undefined symbol: cusparseSetMatDiagType
2. Built PyTorch from Source
git clone --recursive GitHub - pytorch/pytorch: Tensors and Dynamic neural networks in Python with strong GPU acceleration
cd pytorch
export USE_CUDA=1 TORCH_CUDA_ARCH_LIST=8.7 MAX_JOBS=4
python setup.py develop
→ Build succeeded
→ Same error on import
3. Attempted cuSPARSE Upgrade
sudo apt install --reinstall cuda-libraries-12-6
sudo apt full-upgrade -y
→ Latest result:
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
→ Still on libcusparse.so.12.5.4.2
4. Manual .deb Extraction
Downloaded cuda-cusparse-dev-12-6_12.6.68-1_arm64.deb
Extracted libcusparse.so.12.6.68
Copied and fixed symlinks
Symbol still missing — no change
5. Other Attempts
cuda-toolkit-12-6, cuda-compat-12-6, cusparseLt → no effect
sudo ldconfig, reboot → no change
Question
- How do I force-install libcusparse.so.12.6.x on JetPack 6.2?
- Is this a known ABI mismatch between Jetson wheels/source and L4T?
- Should source builds be avoided on JP 6.2?
- Is there a patched L4T update or special .deb with updated cuSPARSE?
I need CUDA acceleration for Detectron2 + custom kernels. Happy to use wheels if they work. I’ve been working on this for 4 days now and i still can’t make it work. Any help would be much appreciated. Thanks!