CMake unable to find CUDA on AGX

Please provide the following info:
Hardware Platform: DRIVE AGX Xavier™ Developer Kit
Software Version: DRIVE Software 10
Host Machine Version: native Ubuntu 18.04
SDK Manager Version: 1.2.0.6733

Hi,

I’m having a problem trying to compile this sekonix_camera GMSL ROS-wrapper on the target machine.

CMake seems to be unable to find CUDA, catkin build brings:

CMake Error at /home/nvidia/driver_ws/src/sekonix_camera/cmake/FindCUDA.cmake:655 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
  CMakeLists.txt:19 (find_package)

I added set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda-10.2) to the CMakeLists.txt but that didn’t solve the problem:

CMake Error at /home/nvidia/driver_ws/src/sekonix_camera/cmake/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find CUDA (missing: CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS
  CUDA_CUDART_LIBRARY)
Call Stack (most recent call first):
  cmake/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindCUDA.cmake:1016 (find_package_handle_standard_args)
  CMakeLists.txt:21 (find_package)

What path should I set CUDA_NVCC_EXECUTABLE, CUDA_INCLUDE_DIRS and CUDA_CUDART_LIBRARY to; or is there something else wrong?

Also I’m quite confused becuase calling nvcc doesn’t work:

$ nvcc --version
-bash: nvcc: command not found

I actually installed CUDA during flashing. Also, it seemed to be installed at /usr/local/cuda

Thanks in advance!

Best regards,
Thilo

I’m not sure of your specific problem, but if I can offer 2 pieces of advice.

I recently was working with setting up PyTorch on a newly formatted Xavier, and I found that the latest version of the JetPack created some odd package version issues. I don’t recall if it was related to openCV or cuda…The solution for me was to use an earlier version of Jetpack, perhaps 1 or 2 versions prior to the latest. This fixed my issues, at this time.

Secondly, although nvcc --version does not report anything, this is likely a PATH issue. Check out this StackOverflow: https://askubuntu.com/questions/885610/nvcc-version-command-says-nvcc-is-not-installed

This may work, right now: /usr/local/cuda --version

1 Like

Dear @t.mueller,
Do you still have this issue? If so, could you double check compiling DW samples first to confirm if things are setup correctly?

Dear @t.mueller,
Could you provide any update?

Dear @SivaRamaKrishnaNV,

checking for the DW samples was the right hint. After reflashing the AGX, we got it to compile.

@mwiegant
It was indeed a PATH issue, after reflashing /usr/local/cuda-10.2/bin/nvcc --version worked for us.

Thank you both for your advice!
Thilo