1
votes

I am trying to start programming CUDA in windows 10. I have installed Visual Studio 2013 community version and I have also downloaded and installed the CUDA toolkit 7.5 for windows platform from NVIDIA website. The process of installation and integration with visual studio went all well and I could make a new project in Visual Studio to run with CUDA Runtime 7.5. But when i try to build the project, I get some errors including the following:

Error   1   error : The CUDA Toolkit v7.5 directory '' does not exist.
Please verify the CUDA Toolkit is installed properly or define the CudaToolkitDir 
property to resolve this error. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 7.5.targets 511 9   Cuda1

I have checked the following path and I could find the following files there:

List of Files in the BuildCustomization directory

The mentioned "CUDA 7.5.targets" file in located there and i can't understand why it continues to give the following error. I have also set the custom directory path in the project properties to the path mentioned in the error and it didn't work either. I would thank you if you could help me solve this.

2
I do not use Visual Studio Nsight but I think the missing direcory is the 'CUDA Toolkit v7.5' which has not been properly specified in the CudaToolkitDiras system (user) path - pQB
Probably @pQB is right. I have some system variables for CUDA: CUDA_TOOLKIT_ROOT_DIR=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5 , CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5 , CUDA_PATH_V6_5=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v6.5 . Do you have something like this? - Danil Prokhorenko

2 Answers

1
votes

I found the problem and it was with the installation of the CUDA toolkit. To solve this, I did the following:

  • Removed all software installed by this cuda installer, including nvidia toolkit, Nsight for VS, graphics driver, etc manually
  • Removed the folders related to nvidia from "Program files" and "Program files x86" manually
  • Started a fresh installation of CUDA toolkit, using Express mode

Now the code compiles and runs without problems.

0
votes

Found a better solution on University of Newcastle's repo: https://research.ncl.ac.uk/game/mastersdegree/workshops/startingwithcuda/starting_cuda.pdf

It consists of copying your custom Cuda Toolkit dir assignment from the MSVstudio file CUDAxxx.props into the CUDAxxx.targets

The pdf is from Visual Studio 2008 but the same logic applies in 2018 (MVS 2017 Community)

My build worked just fine after following it from the PDF.

Use Another editor (npp or VsCode) as Admin to edit the CUDAxxx.targets file (it does not come associated with MVS). Run the build after saving the CUDAxxx.targets file

'xxx' stands for your CUDA version.

Observation: the question is for CUDA 7.5 and MVS 2013 but the bug persists with custom installations of the CUDA toolkit up to current date (05, DEC,2018) and the solution on the pdf from NCL UK still works.