Emile D.
Emile D.

Reputation: 642

Cuda with cmake

I am trying to compile a existing CMake project using Cuda v8.0 that I found online. To do that, I use CMake GUI version. (I am currently running Windows 10, with Visual Studio 2017). The "Configure" step always givs me the following error message:

No CMAKE_CUDA_COMPILER could be found.

I have cuda 8.0 installed (altogether with other Cuda versions that I removed from my path), CuDNN also in my path. And I expect at some points to generate Visual studio project files that I could then use to compile the project...

What could cause that error?

EDIT

Upon request, I uploaded the CMakeOutput.log there : https://framabin.org/?c532b10d2a4aef54#NkJZItfUfPwMP6BHCiP5DhQS40duM4AhsKR+bWHN0tE=

Upvotes: 3

Views: 7127

Answers (2)

Robin Qiu
Robin Qiu

Reputation: 5731

For me, this issue was caused by nvcc(x64 version) doesn't support x86 platform and was fixed by specifying the platform for cmake:

$build> cmake .. -G"Visual Studio 15 2017 Win64"

Upvotes: 0

Emile D.
Emile D.

Reputation: 642

Alright! With @raul-laasner help, I think I have the solution of my problems!

  1. The first one was indeed that my Cuda version was not correctly identified. And I am not sure at this stage that one was found at all. My environment variables where probably ignored also. I had to specify the CMAKE_CUDA_COMPILER option to "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/bin/nvcc.exe".
  2. Then, the problem was that I was using a too recent version of Visual Studio. For starters, Cuda v8.0 is not compatible with Visual Studio 2017: Cuda 8.0 with Visual Studio 2017. But even with the most recent version of Cuda, my Visual Studio is too recent. Meaning: NVIDIA lags behind when it comes to the Visual Studio versions... And now, Microsoft plans to update the _MSC_VER on most of the upgrade. Thus, I had two choices:

    • Downgrade Visual Studio to a compatible version.
    • Use more recent version of Cuda (9.2) and modify the c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include\crt\host_config.h to change the upper limit of the _MSC_VER verification.

By doing the second option, I managed to configure and compile the project. I am not sure though that I won't have later problems with this "hacky" way. But at least, I've been on a further step!

Upvotes: 2

Related Questions