GPU编程_The CUDA Toolkit v8.0 directory '' does not exist.

最近在搞GPU编程时,使用vs2015编译cuda程序 但是却出现如下的错误

GPU编程_The CUDA Toolkit v8.0 directory '' does not exist.

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 8.0.targets(514,9): error : The CUDA Toolkit v8.0 directory '' does not exist.  Please verify the CUDA Toolkit is installed properly or define the CudaToolkitDir property to resolve this error.
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

我所使用的是  编译的文件为 vs2015创建cuda项目所自带的文件 kernel.cu,同时代码中也有错误,解决方案是:

环境:

      windows 7

      VS2015

      cuda 8..0

1,调试>"项目"属性

GPU编程_The CUDA Toolkit v8.0 directory '' does not exist.


2,CUDA C/C++ 然后设置 CUDA Toolkit Custom Dir 的路径为 你的cuda安装路径

GPU编程_The CUDA Toolkit v8.0 directory '' does not exist.

3,设置之后错误也没了,重新编译运行  就正常了

GPU编程_The CUDA Toolkit v8.0 directory '' does not exist.