Visual Studio 2015:CUDA 8.0上的代码1退出了MSB3721错误

时间:2017-03-04 20:09:51

标签: c++ cuda visual-studio-2015

我有Visual Studio 2015和最新的CUDA版本8.0.60。

当我在VS中创建CUDA模板时,默认情况下,在调用设备函数时会收到有关"<<< >>>"并且说" s期待表达" 而另一个错误是MSB3721说的是

  

严重级代码描述项目文件行抑制状态   错误MSB3721命令"" C:\ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ bin \ nvcc.exe" -gencode =拱= compute_20,代码= \" sm_21,compute_20 \" --use-local-env --cl-version 2015 -ccbin" D:\ Program Files(x86)\ Microsoft Visual Studio 14.0 \ VC \ bin \ x86_amd64" -I" C:\ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ include" -I" C:\ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v8.0 \ include" --keep-dir x64 \ Debug -maxrregcount = 0 --machine 64 --compile -cudart static -g -DWIN32 -DWIN64 -D_DEBUG -D_CONSOLE -D_MBCS -Xcompiler" / EHsc / W3 / nologo / Od / FS / Zi / RTC1 / MDd" -o x64 \ Debug \ kernel.cu.obj" D:\ c ++ project \ xhfy \ xhfy \ kernel.cu""退出代码1. xhfy C:\ Program Files(x86)\ MSBuild \ Microsoft.Cpp \ v4.0 \ V140 \ BuildCustomizations \ CUDA 8.0.targets 689

我该怎么做才能解决此错误?

感谢。

2 个答案:

答案 0 :(得分:3)

我将我的平台工具集更改为Visual Studio 2013,它运行良好。

答案 1 :(得分:0)

我修改了cmakelists.txt,并且有效。

我有GTX1016,所以我将arch=compute_75,code=sm_75更改为arch=compute_61,code=sm_61