The CUDA Toolkit v10.0 directory '' does not exist.

I’m having difficulty getting CUDA 10.0 to work with Visual Studio 2017 (15.8.6).

Steps:

  • Existing install of CUDA 9.2 and VS2017
  • Updated Visual Studio 2017 to version 15.8.6
  • Downloaded and ran the CUDA 10.0 installer
  • Express Install
  • Observed that the installer detected VS2017 but not VS2016, VS2015, etc (correct).
  • Selected the option to “Open Samples” on the last page.
    • This opened C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0
  • Opened Samples_vs2017.sln
  • Right clicked on “vectorAdd” example and selected “Build”
  • VS complained about a missing Windows API
  • Right clicked on “vectorAdd” -> Retarget Projects -> WinSDK 10.0.17134.0 -> Ok
  • Right clicked on “vectorAdd” example and selected “Build”
  • Received the following error:
The CUDA Toolkit v10.0 directory '' does not exist.  Please verify the CUDA Toolkit is installed properly or define the CudaToolkitDir property to resolve this error.	vectorAdd	C:\Program Files (x86)\Microsoft Visual Studio017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations\CUDA 10.0.targets	536

I have tried clearing all nvidia-related environment variables, restarting, and reinstalling CUDA 10.0, but I had the same outcome as above. I’ll continue to chip away at this but visual studio is not my strongest dev environment so any help or speculation would be greatly appreciated.

Got it. Steps:

  • Right clicked on “vectorAdd” example > Properties
  • Configuration Properties > CUDA C/C++ > Common
  • Edited “CUDA Toolkit Custom Dir”
  • Set to “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0” (no quotes)
  • Right clicked on “vectorAdd” example > Build
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Dude thanks a lot! Been stuck on this for a while

@jjoonathan Your suggestion helped me as well. Thanks :)

thanks a lot dude! This helped me too :D

Jjoonathan, You rock!

Hey, NVidia, please fix this! I don’t want to do this for all 161 projects!

Notepad++ to the rescue!
Your directories may be different, but I’m on Windows 7 using cuda 10
Open Notepad++
crtl-shft-F to open find in files dialog.
Paste in the Find What box.
Paste C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0 in the Replace With box.
Paste C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0 in the Directory box.
Check In all sub-folders.
Set search mode to Normal (Don’t want that \NVIDIA to be interpreted as a line feed…)
Hit Replace in Files button.
Voila - all done!

I had the same problem and the above solution worked!