I'm trying to install CUDA, but I get a message saying "No supported version of visual studio was found". I think that this is because I am using Visual Studio 2017 (Community), and CUDA currently only supports up to Visual Studio 2015. Unfortunately, Microsoft will not allow me to download old versions of Visual Studio without paying a subscription fee.
Is there a way I can get around the compatibility issue with VS 2017, or can I not use CUDA?
Latest update (correct as of 06/12/2018) latest Cuda version is 9.2 and latest Visual Studio version is 2017.7 do NOT work together. The instructions provided in solution above don't work. Here is what worked for me:
Go to Individual Components. Click on Windows 10 SDK 10.0.15063 enter image description here
Download cuda Toolkit from the official website: https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exelocal
For people seeing this latter.
First, try to just install CUDA 10 (CUDA Toolkit 10.0).
If it still doesn't work without any mods make sure that you have as many VC++ toolsets as you see on the list. Check out this video, stop at 8:41 and compare the lists.
If for some reason you have to use CUDA 9.0 - 9.2 you will need to jump some hoops:
If you have very customized cmd based build, hunt
#if _MSC_VER
(in.../CUDA/.../include/crt/host_config.h
) and remove trailing|| _MSC_VER > ...
CUDA 8.0
withVisual Studio 2017
you need to install additional components for Visual Studio 2017.Click on the Start Menu and type Visual Studio Installer. Open Visual Studio Installer
Open
Individual components
tab and selectVC++ 2015.3 v140 toolset
under
Compilers, build tools and runtimes
..NET Framework 3.5
if you didn't have it installed.Nvda.Build.CudaTasks.v8.0.dll
assembly dependents on MS .NET Framework 3.5.Open Classical Control Panel, go to
Programs and features
and press
Turn Windows features on or off
. Check .NET Framework 3.5 and press OK.CUDA toolkit
distribution and extract it somewhere on your disk.CUDA toolkit
installed, do it now. If you have onlyVisual Studio 2017
installed, unselectVisual Studio integration
checkbox.Now you want receive the
"No supported version of visual studio was found"
error.But in order to successfully build Cuda toolkit projects in Visual Studio 2017 you also need to follow steps 5 and 6.
CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions
folder in your extracted distribution, copy all the files and paste them to
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\BuildCustomizations:
Cuda
projects to recognize NVidia's build tasks fromVisual Studio 2017
. Open your.vcxproj
file in a text editor and find all occurrences ofCUDA 8.0.props
. Replace the macro at the beginning of the string with$(VCTargetsPath14)
so that XML snippet would look as follows:Don't forget to edit the custom targets path at the end of the file:
Make sure to double check your path conifuration!
If you use
nvcc
from command prompt you might not be callingcl.exe
fromVisual Studio
folder!Now you can build your Cuda project from Visual Studio 2017.
Parts of this solution are from Oleg Tarasov blog.
I wanted to edit my CUDA programs using a text editor (i.e. Sublime) and compile them from the command prompt but I ran into an nvcc compiler error. I installed Visual Studio 2017 with Windows 10 OS but after compiling, it said "only version of VS 2012, 13, 15 and 17 are allowed." So what I did was to intall VC++ 2015 toolkit from the installation package of the VS 2017 installer (refer to the image of the top post). I didnt go through his entire process instead, I only copied the path of my cl.exe file from the newly created VS 14.0 folder to the environment variable. The .exe can be found here:
Hope this helps!
I ran into the same issue using CUDA 9.1 and VS2017 Enterprise.
After changing the VC++ compiler to v140 (instead of 141) everything runs fine.
Already had flags
But it wouldn't stop showing the error.
No idea why, but trying to run it on VS2015 lead to errors about v141 not being installed... so because of some twisted logic I tried to not use v141 where it was installed... and everything worked!!
Leaving this here as it may help someone else in the same situation. (although I really don't understand the why, how, when, who or what of the solution.
At the moment, Microsoft still seems to be making VS2015 Update 2 community edition available. You have to join the "dev essentials" program, but it seems to be free.
I was able to download the installer from here recently.
Update: CUDA 9 RC was made available yesterday at developer.nvidia.com to registered developers, and it has support for VS 2017.