Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Cmake Error: No CUDA toolset found

I was doing a project about image processing. I installed darknet, OpenCV and NVIDIA GPU Computing Toolkit\CUDA\v10.2. I was able to get build on OpenCV, but when trying to get build on darknet, it gives the following errors and I couldn't find the solution even though I searched for hours.

CMake Error at C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake:367 (message):
  No CUDA toolset found.
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeDetermineCompilerId.cmake:32 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  C:/Program Files/CMake/share/cmake-3.17/Modules/CMakeDetermineCUDACompiler.cmake:72 (CMAKE_DETERMINE_COMPILER_ID)
  CMakeLists.txt:60 (enable_language)
like image 301
Varian Wrynn Avatar asked Sep 15 '25 06:09

Varian Wrynn


1 Answers

My solution to the No CUDA toolset found problem was to add the following to the CMake command:

-DCMAKE_GENERATOR_TOOLSET="cuda=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2"

As well as copying the 4 VS integration files (from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2\extras\visual_studio_integration\MSBuildExtensions) to both:

  • C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Microsoft\VC\v170\BuildCustomizations
  • and C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\BuildCustomizations

After all this CMake was happy with CUDA and started compiling. I didn't reinstall CUDA or anything.

like image 185
Roy Shilkrot Avatar answered Sep 18 '25 10:09

Roy Shilkrot