CMake error on CUDA toolkit

Problem

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):
  Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
  CMakeLists.txt:20 (find_package)

Solution

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 2.8.12.2 and Ubuntu 14.04

Advertisements

2 thoughts on “CMake error on CUDA toolkit”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s