How to set CC (CUDA Compute Capability) 5.0 in Cmake

Hi
I am a new bee in this field. so pardon my naive question.
I am using CUDA version 11040
windows 10
and 2 GPU:NVIDIA Quadro M1200 and Intel HD graphics 630.
And having the error : CUDA Error: no kernel image is available for execution on the device while running darknet. To solve this error I need to set CC (CUDA Compute Capability) 5.0 in Cmake.
Can anyone please suggest to me How can I set CC (CUDA Compute Capability) 5.0 in Cmake?

Regards
Sharmin

Hi @sharmin.sultana.sheuly90
This question might be better suited for CUDA Programming and Performance - NVIDIA Developer Forums forum branch. I have moved it there.

Hi @Robert_Crovella
Thanks a lot.

I performed the below procedure :
a. Located CMakeLists.txt file in C:\Program Files\CMake\share\cmake-3.21\Modules\FortranCInterface
b. Added the lines : set_property(TARGET myTarget PROPERTY CUDA_ARCHITECTURES 50)
target_link_libraries(FortranCInterface PUBLIC myTarget)
However, still the CMAKE_CUDA_ARCHITECTURES: 52

I am totally new with this. Dont know where to set the CMAKE variable.

Regards
Sharmin

Cmake is not a product that is provided by, or developed or maintained by NVIDIA. I’m not an expert on Cmake.

There are lots of questions on Cmake, and that one that I linked was found with a simple google search. You’ll note that depending on which Cmake version you are using, the methodology for building CUDA has changed, perhaps multiple times. The answer I linked indicates multiple different paths to do the same thing.

If I had to guess, without having your whole project to look at, it seems that maybe you are not editing the proper CmakeLists.txt file. You seem to be setting the one for FortranCInterface which is a library that your target depends on. Probably you should be setting the one also for your target.