CUDA not working with VS 2017 update?

I recently upgraded my install of VS 2017 and now I’m getting many errors about my host compilers not supporting CUDA.

Nothing else really changed. I’m using the CUDA 9 RC and it was working perfectly with VS 2017 but then this update happened and now everything seems broken T_T

Anyone else having similar issues?

take a look here:

[url]https://devtalk.nvidia.com/default/topic/1022648/cuda-setup-and-installation/cuda-9-unsupported-visual-studio-version-error/[/url]

I would guess that MSFT issued an update to VS 2017 shortly after CUDA 9 RC came out.

I have the latest update of VS2017 Community (15.3.1), and CUDA 9.0 RC downloaded and installed today. I fixed the error in host_config.h referenced by @txbob, and I successfully compiled and ran both deviceQuery and bandwidthTest.

I’m jealous of you, BarryCuda.

With VS2017, I’m receiving the following errors:

Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25506 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

tmpxft_00001ab4_00000000-1.cpp
nvcc fatal   : Host compiler targets unsupported OS.
delete this;

[deleted]

Holy crap, the forums are so broken right now. Must’ve been written in Ruby (hey-oh!).

But I also made the relevant changes to my host_config.h as well:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\include\crt>type host_config.h | find /i "1911"
#if _MSC_VER < 1600 || _MSC_VER > 1911

Also, all hope is not lost. My project builds appropriately for the CUDA 9 toolkit using VS 2015. I was able to compile my project and pass my tests so I’m still able to continue programming.

I also have the exact same problem as MutantJohn.

At first i’m getting the following message.

fatal error C1189: #error:  -- unsupported Microsoft Visual Studio version! Only the versions 2012, 2013, 2015 and 2017 are supported!

After changing line 133
from

#if _MSC_VER < 1600 || _MSC_VER > 1910

to

#if _MSC_VER < 1600 || _MSC_VER > 1911

After that it throws the following error

nvcc fatal   : Host compiler targets unsupported OS.

are you compiling a 64-bit project?

[deleted]

I’m not the only one who’s having this issue!!!

Yeaaaaaaaaaaaaaah!!!

Awesome.

I’m currently not compiling a 64 bit project. Currently just 32 bit for me.

Edit:

Doesn’t matter if we’re using 64 bit or not. I just tried in the Developer Command Prompt both ways and they both had the same behavior.

@MutantJohn: Did you look at the CUDA Installation Guide? Support for 32-bit projects is limited.

1.1.1. x86 32-bit Support
Native development using the CUDA Toolkit on x86_32 is unsupported. Deployment
and execution of CUDA applications on x86_32 is still supported, but is limited to use
with GeForce GPUs. To create 32-bit CUDA applications, use the cross-development
capabilities of the CUDA Toolkit on x86_64.

I’m compiling a 64-bit project

@rvhelden: What O/S are you compiling for? The message seems to be saying the host compiler (that would be, e g, C/C++) is not targeting an O/S which it supports. I suppose there is some way you tell nvcc which O/S to target, and maybe it is passing that information back to the host compiler.

I’m on Windows 10, using a 64 bit Developer Command Prompt.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build>vcvars64.bat
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.0.26730.8
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x64'

...>nvcc \path\to\cuda\source.cu
Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25506 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

tmpxft_00000824_00000000-1.cpp
nvcc fatal   : Host compiler targets unsupported OS.

For the record, everything was working until MS upgraded VS. Not sure what happened but 2017 support seems shaky in the RC. Ooh, does the RC come with full support for C++14? It’d be nice to use generic lambdas and the like.

This Works!! But I did alone… Nvidia have Crazy “if” conditions

I’m having the same issue as MutantJohn. I’m using Visual Studio 2017 Update 3.3 (so version 15.3.3) and I see this when I run nvcc from the CUDA 9.0 RC:

1>Microsoft (R) C/C++ Optimizing Compiler Version 19.11.25507.1 for x64
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>
1>tmpxft_00003fcc_00000000-1.cpp
1>nvcc fatal   : Host compiler targets unsupported OS.

My guess is nvcc is built to check for _MSC_VER > 1910, similar to the host_config header. Since VS 15.3 brought that up to 1911, it’s breaking. Hopefully this will be resolved in the next RC for CUDA 9.