Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake 3.4.3 Can't find CUDA on windows

Tags:

c++

cuda

cmake

I am trying to build something with CMake (it has to be an older version because of the project) and when I run it I get this error:

CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.4/Modules/FindCUDA.cmake:617 (message):
  Specify CUDA_TOOLKIT_ROOT_DIR
Call Stack (most recent call first):
  libethash-cuda/CMakeLists.txt:3 (FIND_PACKAGE)

I have looked everywhere online but I only find solutions for Linux.

like image 407
Igal Flegmann Avatar asked Jun 23 '17 15:06

Igal Flegmann


1 Answers

So, my CMake (v3.7.0) found the toolkit automatically. It's located in:

C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0

In general, I've found on Windows it has difficulty finding the SDK which is in:

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v8.0

To set CUDA_TOOLKIT_ROOT_DIR in CMake on windows, open up cmake-gui, run "configure" once then go to "advanced:"

enter image description here

Scroll down until you see CUDA_TOOLKIT_ROOT_DIR:

And set it to your CUDA toolkit directory (which is probably C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0 if you're using CUDA version 8.0)

enter image description here

like image 55
merelyMark Avatar answered Nov 06 '22 20:11

merelyMark