0

我试图让 CUDA 与 catkin (ros) 一起工作,这基本上是 cmake。我还没有 .cu 文件。作为第一步,我想CUDA添加find_package

find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  image_transport
  roscpp
  message_generation
  CUDA
)

在此之后,cmake 系统会给出以下错误:

CMake Error at /opt/ros/hydro/share/catkin/cmake/catkinConfig.cmake:75 (find_package):
  Could not find a configuration file for package CUDA.

  Set CUDA_DIR to the directory containing a CMake configuration file for
  CUDA.  The file will have one of the following names:

    CUDAConfig.cmake
    cuda-config.cmake

我可以确认我系统上的 CUDA 工作正常。我可以成功运行 cuda 示例:bandwidthTest 和 deviceQuery。我有 cuda-5.5 在/usr/local/cuda-5.5/.

[eeuser@roadrunner bin]$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2013 NVIDIA Corporation
Built on Wed_Jul_17_18:36:13_PDT_2013
Cuda compilation tools, release 5.5, V5.5.0

我还可以确认使用 cmake 安装了 FindCUDA。

[eeuser@roadrunner bin]$ locate FindCUDA
/usr/share/cmake-2.8/Modules/FindCUDA
/usr/share/cmake-2.8/Modules/FindCUDA.cmake
/usr/share/cmake-2.8/Modules/FindCUDA/make2cmake.cmake
/usr/share/cmake-2.8/Modules/FindCUDA/parse_cubin.cmake
/usr/share/cmake-2.8/Modules/FindCUDA/run_nvcc.cmake
4

1 回答 1

2

这是错误的用法

find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  image_transport
  roscpp
  message_generation
  CUDA
)

而是将其用作 -

FIND_PACKAGE(CUDA REQUIRED)
find_package(catkin REQUIRED COMPONENTS
  cv_bridge
  image_transport
  roscpp
  message_generation
)
于 2015-05-20T07:24:47.220 回答