[CMake] Problem with using CUDA

Klaudia Algiz algizklaudia at gmail.com
Wed Nov 8 15:43:36 EST 2017


Hello,

I have a problem with using CUDA package in cmake.

I've installed CUDA, version 9.0, downloaded from here:
https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=runfilelocal

and then to my CMakeList.txt file I added line:
  find_package (CUDA REQUIRED)

but while running command cmake .. I was getting the following error:
  CMake Error at /usr/share/cmake-3.5/Modules/FindCUDA.cmake:617 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR
  Call Stack (most recent call first):
  CMakeLists.txt:13 (find_package)

I looked for some information and tried the following command:

   cmake -DCUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda ..

After that I am getting still some errors:

  CMake Error at
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148
(message):
  Could NOT find CUDA (missing: CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS
  CUDA_CUDART_LIBRARY)
  Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388
(_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindCUDA.cmake:949
(find_package_handle_standard_args)
  CMakeLists.txt:13 (find_package)

Can anybody help me with that?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171108/ff8d4235/attachment.html>


More information about the CMake mailing list