Cuda Toolkit目录不存在

jay*_*tea 4 c++ cuda visual-studio-2010

我有cuda 4.1和visual studio 2010的问题.当我想编译.cu文件时,我收到以下错误:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 4.1.targets(249,9): error : The CUDA Toolkit  directory '' does not exist.  Please verify the CUDA Toolkit is installed properly or define the CudaToolkitDir property to resolve this error.
Run Code Online (Sandbox Code Playgroud)

我得到了一个干净的Windows 7安装,只有vs2010,CUDA Toolkit v4.1和在VirtualBox中运行的NVIDIA GPU计算SDK(和git).

我试图在"CUDA Toolkit Custom Dir"的项目属性中指定工具包目录,但这没有任何区别.即使在全新的VBox中也会发生此错误.

谢谢你的帮助!

jay*_*tea 7

好吧,我自己得到了:我使用的项目是使用cuda 4.0设置的,因为我安装了v4.1,它没有正确更新.要更新它,只需在自定义构建步骤中禁用并启用"CUDA 4.1(.targets,.props)".

  • 嗨,我看到了同样的问题.通过'更新它只需在自定义构建步骤中禁用并启用"CUDA 4.1(.targets,.props)".你的意思是取消选中cuda 4.0并检查CUD 4.1吗?在我的例子中,我VS2010的旧项目使用的是CUD 4.0,自定义构建设置为使用CUDA 4.0,但我仍然看到该消息. (2认同)

小智 5

我在VS 2017上使用Cuda 9.1获得了相同的设置。为我解决的是将“ CUDA Toolkit自定义目录”设置为与CUDA_PATH相同。请参阅以下链接:https : //docs.nvidia.com/nsight-visual-studio-edition/3.2/Content/CUDA_Properties_Config.htm, 在“公共”部分的项目#1中。