Unsupported CUDA 9 error in Visual Studio 2017

I recently updated my VS 2017, and now I can’t even create a default CUDA project (one that contains a vector add-on).

I suspect 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 

Other errors are irrelevant and will disappear after fixing this. Please note that I can create and run simpleCUFFT from CUDA samples.

Before the upgrade, I was able to create a default CUDA project, but I was not able to create a CUDA Sample project. I updated my VS2017 using the VS installer and installed the CUDA SDK 10.0.15063.0. Screenshot attached screenshot with installed components.

Please let me know if further information is required. I know the topic, and since I use the latest CUDA toolkit, I don’t need to make changes to host_config.h.

Thank you Michael

Edit: My version of VS (as shown in the VS installer) is 15.5.0 My version of nvcc is release 9.0, V9.0.176

Edit2: I tried changing host_config.h line 133 to:

  #if _MSC_VER < 1600 || _MSC_VER > 1912 

This error is no longer displayed, however, a lot of "expression must have a constant value" errors appear in the type_trails file. I do not know how to fix this.

+11
source share
4 answers

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

1) Make sure you have VC ++ 2015.3 v140 toolset (it can be installed from the Internet or from the Visual Studio installer)

2) In the project properties (general) β†’ Platform Toolbox, select Visual Studio 2015 (v140).

Editing (05/21/2008): I just updated Visual studio 2017 to the latest version 15.7.1. Now I can select the VS 2017 v141 toolkit and it works great.

+19
source

In update VS 15.4.3 Updated Microsoft version number of their CL compiler to 14.12 ( https://www.visualstudio.com/ru-ru/news/releasenotes/vs2017-relnotes#15.4.4 )

This is why CUDA 9.0.176 refuses to compile. Today, NVIDIA upgraded CUDA to 9.1.85, so just upgrade just upgrade CUDA to 9.1 https://developer.nvidia.com/cuda-downloads

+2
source

I am using CUDA 9.2 and VS 2017 (version 15.7.5). A simple change to host_config.h (usually in C: \ Program Files \ NVIDIA GPU Computing Toolkit \ CUDA \ v9. * \ Include \ crt, can be found in the VS output from the assembly) works for me.

Change the line

 #if _MSC_VER < 1600 || _MSC_VER > 1913 

in

 #if _MSC_VER < 1600 || _MSC_VER > 1914 

or something similar, depending on the version of cl.exe

+2
source

For anyone reading this question, update it in CUDA 10. It works right out of the box. There is no need to install previous compiler toolkits and the like mentioned in other answers. Just download CUDA 10, install it, and uninstall previous versions of CUDA. Then create a new CUDA 10 project and post your code. This will work.

If you get errors, do not forget to set compute_xx,sm_xx accordingly, in the Project Properties β†’ CUDA C / C ++ β†’ Device β†’ Code Generation.

+1
source

Source: https://habr.com/ru/post/1273849/


All Articles