Problem with PyTorch on AGX Xavier (no libcurand.so.10)

I want to use yolov5 on AGX Xavier, but encountered a problem with PyTorch (no libcurand.so.10). What can I do to fix it without reflashing Jetson (I only have ssh to it, but no physical access)?


When try to import torch (installed torch-1.10.0-cp36-cp36m-linux_aarch64.whl), there is this error:

jetson@jetson:~/Desktop$ python3
Python 3.6.9 (default, Jun 29 2022, 11:45:57)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jetson/.local/lib/python3.6/site-packages/torch/__init__.py", line 196, in <module>
    _load_global_deps()
  File "/home/jetson/.local/lib/python3.6/site-packages/torch/__init__.py", line 149, in _load_global_deps
    ctypes.CDLL(lib_path, mode=ctypes.RTLD_GLOBAL)
  File "/usr/lib/python3.6/ctypes/__init__.py", line 348, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libcurand.so.10: cannot open shared object file: No such file or directory
>>>

So libcurand.so.10 is not found. And that’s true. It’s not existent in cuda-10.2 directory:

jetson@jetson:/usr/local/cuda-10.2/lib64$ ls
libcudadevrt.a         libcupti.so.10.2.75     libnppicc.so.10.2.1.89   libnppif.so.10         libnppist.so            libnppitc_static.a
libcudart.so           libnppc.so              libnppicc_static.a       libnppif.so.10.2.1.89  libnppist.so.10         libnpps.so
libcudart.so.10.2      libnppc.so.10           libnppicom.so            libnppif_static.a      libnppist.so.10.2.1.89  libnpps.so.10
libcudart.so.10.2.89   libnppc.so.10.2.1.89    libnppicom.so.10         libnppig.so            libnppist_static.a      libnpps.so.10.2.1.89
libcudart_static.a     libnppc_static.a        libnppicom.so.10.2.1.89  libnppig.so.10         libnppisu.so            libnpps_static.a
libcuinj64.so          libnppial.so            libnppicom_static.a      libnppig.so.10.2.1.89  libnppisu.so.10         libnvperf_host.so
libcuinj64.so.10.2     libnppial.so.10         libnppidei.so            libnppig_static.a      libnppisu.so.10.2.1.89  libnvperf_target.so
libcuinj64.so.10.2.89  libnppial.so.10.2.1.89  libnppidei.so.10         libnppim.so            libnppisu_static.a      libnvToolsExt.so
libculibos.a           libnppial_static.a      libnppidei.so.10.2.1.89  libnppim.so.10         libnppitc.so            libnvToolsExt.so.1
libcupti.so            libnppicc.so            libnppidei_static.a      libnppim.so.10.2.1.89  libnppitc.so.10         libnvToolsExt.so.1.0.0
libcupti.so.10.2       libnppicc.so.10         libnppif.so              libnppim_static.a      libnppitc.so.10.2.1.89  stubs

I have JetPack 4.4 installed.

jetson@jetson:~$ cat /etc/nv_tegra_release
# R32 (release), REVISION: 4.4, GCID: 23942405, BOARD: t186ref, EABI: aarch64, DATE: Fri Oct 16 19:37:08 UTC 2020
jetson@jetson:~$ sudo apt-cache show nvidia-jetpack
Package: nvidia-jetpack
Version: 4.4.1-b50
Architecture: arm64
Maintainer: NVIDIA Corporation
Installed-Size: 194
Depends: nvidia-cuda (= 4.4.1-b50), nvidia-opencv (= 4.4.1-b50), nvidia-cudnn8 (= 4.4.1-b50), nvidia-tensorrt (= 4.4.1-b50), nvidia-visionworks (= 4.4.1-b50), nvidia-container (= 4.4.1-b50), nvidia-vpi (= 4.4.1-b50), nvidia-l4t-jetson-multimedia-api (>> 32.4-0), nvidia-l4t-jetson-multimedia-api (<< 32.5-0)
Homepage: http://developer.nvidia.com/jetson
Priority: standard
Section: metapackages
Filename: pool/main/n/nvidia-jetpack/nvidia-jetpack_4.4.1-b50_arm64.deb

Also there is no libcurand-10-2 (or any other libcurand) when checking apt (with and without sudo)

jetson@jetson:~$ sudo apt list --installed | grep libcurand-10-2

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Solved!

Solution was installing a cuda toolkit:

sudo apt-get install cuda-toolkit-10-2

Then got another problem while importing torch or numpy in python (Illegal instruction (core dumped))
That was solved by:

export OPENBLAS_CORETYPE=ARMV8

Hope that it will be useful

Thanks for the sharing!

1 Like

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