Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

CMake error on CUDA toolkit

📅 2014-May-29 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ cmake, cuda, error ⬩ 📚 Archive


I installed CUDA using this command:

$ sudo apt install nvidia-cuda-dev

I tried to compile a CUDA program using CMake and got this error:

CMake Error at /usr/share/cmake/Modules/FindCUDA.cmake:488 (message):
Call Stack (most recent call first):
  CMakeLists.txt:20 (find_package)


Turns out that nvidia-cuda-dev does not install the CUDA toolkit or SDK. Though it is named like a development package in Linux typically is, it is not.

To install the CUDA toolkit use:

$ sudo apt install nvidia-cuda-toolkit

The CMake compile error went away after this :)

Tried with: CUDA 5.5, CMake and Ubuntu 14.04

© 2022 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘📧