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.

1 Like

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 ==========
1 Like

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!

I had this same issue trying to compile instant-ngp in VS 2019 and Cuda 11.6. Just like the error said (The CUDA Toolkit v11.6 directory ‘’ does not exist. ) . If you look at “CUDA 11.6.props” (which you should have copied to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\BuildCustomizations) it says… GetRegistryValueFromView(‘HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\GPU Computing Toolkit\Cuda$(CudaToolkitVersion)’, ‘InstallDir’, null, RegistryView.Registry64, RegistryView.Registry32)) and the “InstallDir” value at this registry location ( ‘HKEY_LOCAL_MACHINE\SOFTWARE\NVIDIA Corporation\GPU Computing Toolkit\Cuda\11.6’) was missing… I added “InstallDir” as a string value=“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.6” and this compile error was resolved.

3 Likes

I had the same problem with CUDA 11.7 and the solution from @lawleenaja worked for me !

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.