Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (found suitable exact version "10.2")

Dear Team,

I have a jetson nano 4gb B01 with 16gb emmc. I installed the os, then CUDA and other tools through sdkmanager. I used a flash script to change rootfs to external usb drive.(Change Root File System to SD Card Directly).

After booting from usb drive, i upgraded opencv to 4.5.1. On trying to install ncnn, the cmake fails with the following error

cmake -DCUDAToolkit_ROOT=/usr/local/cuda-10.2 -D CMAKE_TOOLCHAIN_FILE=../toolchains/jetson.toolchain.cmake         -D NCNN_DISABLE_RTTI=OFF         -D NCNN_BUILD_TOOLS=ON         -D NCNN_VULKAN=ON         -D CMAKE_BUILD_TYPE=Release ..

CMake Warning at CMakeLists.txt:279 (message):
  The compiler does not support armv8.2 fp16.  NCNN_ARM82 will be OFF.


-- Target arch: arm 64bit
CMake Error at /usr/local/share/cmake-3.19/Modules/FindPackageHandleStandardArgs.cmake:218 (message):
  Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_INCLUDE_DIRS
  CUDA_CUDART_LIBRARY) (found suitable exact version "10.2")

jtop (jetson-stats) also shows CUDA, Opwncv with CUDA: YES
The cuda paths are as below:

nvidia@ubuntu:~$ ls /usr/local/cuda*
/usr/local/cuda:
bin        doc       include  nvvm     share    version.json
cuda       EULA.txt  lib64    nvvmx    targets  version.txt
cuda-10.2  extras    nvml     samples  tools

/usr/local/cuda-10:
bin        doc       include  nvvm     share    version.json
cuda       EULA.txt  lib64    nvvmx    targets  version.txt
cuda-10.2  extras    nvml     samples  tools

/usr/local/cuda-10.2:
bin        doc       include  nvvm     share    version.json
cuda       EULA.txt  lib64    nvvmx    targets  version.txt
cuda-10.2  extras    nvml     samples  tools

Opencv was built using CUDA so CUDA is ofcourse installed but for some reason cmake for ncnn is not able to read it.
I have also added it to the path in bashrc.
I have no idea where to go from this.

Hi,

Would you mind checking the below script?

We have checked it on Nano before and doesn’t meet the CUDA issue you mentioned.
Thanks.

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