Cannot compile newly crated Cuda project

Answered

Hey,

I'm trying to start a Cuda project with CLion.

I'm on Windows 11, using the Visual Studio toolchain:

nvcc is on the path:

> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2021 NVIDIA Corporation
Built on Mon_May__3_19:41:42_Pacific_Daylight_Time_2021
Cuda compilation tools, release 11.3, V11.3.109
Build cuda_11.3.r11.3/compiler.29920130_0

Immediately after creating a new "Cuda Executable" project with the default settings I get the following error in the CMake log:

C:\Users\Karel\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\211.7442.42\bin\cmake\win\bin\cmake.exe -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - NMake Makefiles" C:\Users\Karel\Desktop\untitled
-- The CUDA compiler identification is unknown
-- Detecting CUDA compiler ABI info
CMake Error in C:/Users/Karel/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_1fd33".


CMake Error in C:/Users/Karel/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeTmp/CMakeLists.txt:
CUDA_ARCHITECTURES is empty for target "cmTC_1fd33".


CMake Error at C:/Users/Karel/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/211.7442.42/bin/cmake/win/share/cmake-3.19/Modules/CMakeDetermineCompilerABI.cmake:48 (try_compile):
Failed to generate test project build system.
Call Stack (most recent call first):
C:/Users/Karel/AppData/Local/JetBrains/Toolbox/apps/CLion/ch-0/211.7442.42/bin/cmake/win/share/cmake-3.19/Modules/CMakeTestCUDACompiler.cmake:19 (CMAKE_DETERMINE_COMPILER_ABI)
CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
See also "C:/Users/Karel/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Karel/Desktop/untitled/cmake-build-debug/CMakeFiles/CMakeError.log".

[Failed to reload]

 

I tried various things to fix this:

None of these options solved my issue.

What could be going wrong here? Thanks!

2 comments
Comment actions Permalink

Hello!

Please select amd64 in the Architecture field of the toolchain. It should help with the default CUDA project.

0
Comment actions Permalink

I had the exact same problem as OP, and selecting amd64, in addition to setting Visual Studio as the default (as opposed to MinGW) in architecture fixed it for me.

However, this seems to be a bug, why did it default to x86? Shouldn't it be obvious to CLion that my computer is amd64 architecture?

0

Please sign in to leave a comment.