Visual Studio 2017的CUDA 9不支持的错误 [英] CUDA 9 unsupported error with Visual Studio 2017

查看:507
本文介绍了Visual Studio 2017的CUDA 9不支持的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近更新了VS 2017,现在我什至无法构建默认的CUDA项目(带有矢量附加项的项目).

I've recently updated my VS 2017 and now I cannot even build a default CUDA project (the one with the vector addition).

我怀疑这是由于以下错误引起的:

I suspect that this is due to the following error:

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.

The other errors are irrelevant and will disappear once I fix this one. Note, that I am able to build and run simpleCUFFT from CUDA samples.

在更新之前,我能够构建默认的CUDA项目,但无法构建CUDA示例项目.我已经使用VS安装程序更新了VS2017并安装了CUDA SDK 10.0.15063.0.随附的屏幕截图和已安装的组件.

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中进行更改.

Please let me know if any additional information is required. I am aware of the following topic and since I am using the latest CUDA toolkit, I don't need to make changes in host_config.h.

谢谢, 米哈伊尔

我的VS版本(如VS安装程序中所示)是15.5.0 我的nvcc版本是9.0版,V9.0.176

My VS version (as displayed in VS installer) is 15.5.0 My nvcc version is release 9.0, V9.0.176

Edit2:我尝试将host_config.h第133行更改为:

I've tryied to change host_config.h line 133 to:

  #if _MSC_VER < 1600 || _MSC_VER > 1912

此错误不再显示,但是,在type_trails文件中显示了一堆错误表达式必须具有恒定值".我不知道如何解决它.

This error does not show up anymore, however, a bunch of errors "expression must have a constant value" show up in the file type_trails. I have no clue how to fix it.

推荐答案

经过一段痛苦的时光,我得以解决问题.这是有类似问题的人的答案:

After some painful time, I was able to solve the problem. Here is the answer for those who have a similar problem:

1)确保您具有VC ++ 2015.3 v140工具集(可以从Web或Visual Studio安装程序安装)

1) Make sure that you have VC++ 2015.3 v140 toolset (can be installed either from web or Visual Studio installer)

2)在项目属性(常规)->平台工具集中,选择Visual Studio 2015(v140).

2) In the project properties (general) -> Platform toolset choose Visual Studio 2015 (v140).

编辑(5/21/2018):我刚刚将Visual Studio 2017更新为最新版本15.7.1.从现在开始,我可以选择VS 2017 v141工具集,并且效果很好.

Edit (5/21/2018): I've just updated Visual studio 2017 to the latest version 15.7.1. From now on, I can choose VS 2017 v141 toolset and it works fine.

这篇关于Visual Studio 2017的CUDA 9不支持的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆