我最近更新了 VS 2017,现在我什至无法构建默认的 CUDA 项目(带有向量加法的项目)。
我怀疑这是由于以下错误造成的:
Severity Code Description Project File Line Suppression State
Error C1189 #error: -- unsupported Microsoft Visual Studio version!
Only the versions 2012, 2013, 2015 and 2017 are supported! ver2
c:\program files\nvidia gpu computing
toolkit\cuda\v9.0\include\crt\host_config.h 133
其他错误无关紧要,一旦我修复了这个错误就会消失。请注意,我能够从 CUDA 示例构建并运行 simpleCUFFT。
Before the update I was able to build the default CUDA project but I was not able to build the CUDA Sample project. I've updated my VS2017 using VS installer and installed CUDA SDK 10.0.15063.0. Attached is the screenshot with the installed components.
如果需要任何其他信息,请告诉我。我知道下列的由于我使用的是最新的 CUDA 工具包,因此我不需要在 host_config.h 中进行更改。
谢谢,
米哈伊尔
编辑:
我的 VS 版本(如 VS 安装程序中所示)是 15.5.0
我的nvcc版本是release 9.0,V9.0.176
Edit2:我尝试将 host_config.h 第 133 行更改为:
#if _MSC_VER < 1600 || _MSC_VER > 1912
这个错误不再出现,但是,文件 type_trails 中出现了一堆错误“表达式必须具有常量值”。我不知道如何解决它。