CUDA 9.1 cannot install due to failed Visual Studio Integration

Based on the previous answers, I came up with this manual procedure to install the visual studio integration without having to change my graphics driver (currently 397.64):

All the files needed for the Visual Studio integration are located in your_CUDA_9.1_zip\CUDAVisualStudioIntegration (see oregonduckman’s answer on the first page of this thread). I will refer to this directory simply as “” from now on. I tried executing the two installers (see evgeniy.mamchenko’s answer above) in this directory, with no success. After examining the other files in this directory, I realized that \CUDAVisualStudioIntegration.nvi is really an xml file telling the installer how to install the visual studio integration. I then used the file to figure out where the files need to go and how Visual Studio needs to be configured. This way, I could install the integration manually.

I could create the default CUDA 9.1 project in VS 2017 community. And after fixing some issues (see https://devtalk.nvidia.com/default/topic/1028669/cuda-setup-and-installation/how-to-get-visual-studio-2017-to-use-cuda-9-1-/ as there seems to be a problem with the newest standard c++ headers being incompatible with CUDA 9.1; In a nutshell, I now use the 2015 toolset instead of 2017) I could compile and run the program.

Here are the detailed steps I took:

  1. Install CUDA 9.1 without Visual Studio integration.

  2. Open \CUDAVisualStudioIntegration.nvi in a text editor. The interesting stuff happens after line 120.

  3. All tags with phase=installMSTools10 to phase=installMSTools14 indicate copying files to integrate CUDA into MsBuild. The tags tell you to copy files. The source property tells you which file (inside \ in your zip). The target property tells where the file needs to go. If some of the target folders don’t exist, don’t worry; then you most likely don’t have all supported MsBuild versions installed, simply install for those you have. The target paths contain path variables defined at the top of the file, go have a look there to find the exact location where MsBuild is installed on your machine.

  4. The next three tags indicate how the same files as above need to be copied into some Visual Studio folder. Only do this for the version of visual studio you are using (see condition properties on the tags). The root of the target directories will be the install directory of Visual studio 2017 (pro/enterprise/community).

  5. The seven large junks (phase=“installVSWizards”) below the previous installation step tell you to copy all the files in \extras\visual_studio_integration\CudaProjectVsWizards into some AppData folder. Only do this for the versions of Visual Studio you have installed or those you want the integration to be installed (see the condition properties of the tags).

  6. Right after the last big junk, you will notice tags. Those with action=“CreateCustomShortcut” tell you to create shortcuts to some files. Again only do this for the Visual Studio version you have installed. root\location\name is the name of the shortcut to create and target is the file to be linked. In a nutshell, you will have to link two files that you just copied into Appdata per Visual Studio installation.

  7. Ignore all tags with when=uninstall below. These are only needed for uninstalling.

  8. The tags tell you to run Visual Studio from the command line with specific parameters. Do this for every installed version (or every version you want to have the integration installed). Basically, go find the executable directory of visual studio, open an elevated cmd prompt and type “devenv /setup”. The setup option will tell Visual studio to install new extensions by following the previously created shortcuts.

  9. That’s it for installing. Now you should be able to launch Visual Studio and create CUDA 9.1 projects with Visual Studio 2017.

  10. See https://devtalk.nvidia.com/default/topic/1028669/cuda-setup-and-installation/how-to-get-visual-studio-2017-to-use-cuda-9-1-/ to actually get Visual Studio compiling CUDA code (again another issue, when does it end?).

I hope this helps. After trying to reset my driver back to some older version for a few days with no success, this did it for me.

worked for me by evgeniy.mamchenko’s post
I installed CUDA 9.0.176 with vs 2017(15.7.2)
But a new problem is I cannot install CUDA 9.0 Patch 1,it says;
CUBLAS Development not installed
CUBLAS Runtime not installed
not only execute cuda_9.0.176.1_windows.exe but also setup.exe after extract by WinRAR

Patch 2 no these failed messages
So,can I only install Patch 2,but no Patch 1?

This saved me and works for me!
Thanks a lot.

Maybe the installation fails because of permisson issues? Had to run almost everythin as admin.

Got CUDA now integrated with Visual Studio after a whole day of work…NVIDIA should really move and fix these issues…

Hi,sebi.garmier,manuel3.schmidt

Where can I find the AppData folder in the step 5?
just ${{CommonAppData}} in the nvi file
Is C:\ProgramData ?
But under C:\ProgramData,there are only two dir:
NVIDIA
NVIDIA Corporation
but no NVIDIA GPU Computing Toolkit
DO I have to create this dir manually? and then copy those files?

I put it here:
C:\ProgramData
This was motivated by this:
https://www.microsoft.com/en-us/wdsi/help/folder-variables

I created a new folder inside of the NVIDIA Corporation folder named NVIDIA GPU Computing Toolkit.

Cheers

Manuel

I believe CommonAppData refers to the standard Appdata folder of the current user. It can be found by hitting Win+R (run window pops up) and entering %Appdata%. This will open an explorer window with the Appdata folder. Usually it is C:\users\your_username\AppData\Roaming.

However, you can probably install the files in any location you like, as long as visual studio can find and read the files there using the shortcuts created in step 6.

Regards

Sébastien

thanks to manuel3.schmidt and sebi.garmier
I do create the new dir under C:\ProgramData and now worked for me.
Maybe the shortcut can link to anywhere you put the extras DIR

same problem here

but the solution which @oregonduckman provided worked for me

thanks a lot bro…i owe a big time (three days )

thank you very much. “pagr12” guide me to here and all share you idea man. you are the best.

Here is what worked for me, thank you everyone that has provided information in this and other threads. I’m pasting in the steps I took and and taking none of the credit.

FYI - the most important thing here is to use the right versions, and to think about what you’re doing as you follow the below instructions rather than blindly following them.

Steps to follow:
Step 1:
source: https://devtalk.nvidia.com/default/topic/1032800/cuda-setup-and-installation/visual-studio-integration-failed-/post/5259687/#5259687

Step 1: Install the standard VGA driver:
1. Bring up the Windows Device Manager. You can do that my right-clicking on the Start button and then select Device Manager.
2. Expand the "Display Adapter" list, right-click on the GeForce card and then select "Update Driver Software".
3. Click "Browse my computer for driver software".
4. Then click the "Let me pick from a list of device drivers on my computer".
5. Uncheck the "Show compatible hardware" option.
6. Under the "Manufacture" scroll to the top and select the "(Standard display type)" and then click "Next". If you are running multiple GPUs then repeat steps #2 - #6 for each GPU.
7. Restart Windows. This will basically load the standard VGA driver.

step 2:

  • Uninstall Visual Studio 17

step 3:

step 4:

step 5:

  • Run the installer for Visual Studio 2017 15.4.5 from file downloaded in Step 3. Under ‘Individual Components’ select ‘VC++ 2015.3 v140 toolset for desktop (x86,x64)’. Under ‘Workloads’ select ‘Desktop development with C++’. Hit install and get that installed.

step 6:

  • Run the CUDA installer you got in step 4. Hit next a few times, this time everything should complete without a problem.

source for steps 3-6: https://devtalk.nvidia.com/default/topic/1033111/cuda-setup-and-installation/cuda-9-1-cannot-install-due-to-failed-visual-studio-integration/post/5259574/#5259574

As install, select custom.
In check components, ONLY CUDA without Visual Studio Extension.

and Next, Next, …

Thx~ c90.shonai

Last version of VS2017 is not supported yet so the solution is here: https://stackoverflow.com/questions/50042186/cannot-install-cuda-toolkit-9-1-85-on-windows-7-64-bit

Thanks. Saved me a lot of time.

uncheck visual studio integration and install, and it will be good

Problem solved !!

Since Windows 10 was not responding to my uninstall request, i used Revo uninstaller to remove all remaining programs (using revo uninstaller free version), aand then it worked !!

This is apparently still a problem with CUDA 10.0 on Windows 10 with VS 2013. Not finding a path to solution, but I haven’t attempted the Revo tool yet. CUDA 8.0 was working, and now nothing is.

CUDA on Windows is a side distraction - most of my work is on Linux, but the Windows/VS tools have [had] some advantage. I’m just gonna have to set that aside and struggle with my stone knives and bear skins.

try revo uninstaller and tell us if it fixes your issue

for me it solved it

Because I don’t have a life, and because these things do tend to keep me up at night, I continued to beat on it. Two things I did to get cuda_samples_v10.0/1_Utilities/deviceQuery to build:

  1. installed Windows SDK

This got me past the “windows.h” issue.

The next level of error I got was “could not open” kernel32.lib and a warning “Could not find WindowsSDKDir variable from the registry.”

  1. changed the “Platform Toolset” in the properties to WindowsXP

I found this solution earlier:

https://stackoverflow.com/questions/22188919/windows-sdk-registry-variable-not-found

*** and now deviceQuery builds and runs

HOWEVER - cannot build bandwidthTest, or 0*/matrixMul - complains about

"Error 2 error : couldn’t get arguments: The parameter is incorrect cuda_samples_v10.0\1_Utilities\bandwidthTest\CUDACOMPILE bandwidthTest
"Could not find WindowsSDKDir variable in registry

The oregonduckman solution works for resolving the NVIDIA CUDA 10.0 installer problem with Windows 10 and VS2013 as well. Once REVO has cleaned things up, the installer works without complaint.

The recommendation is to just use REVO on the 30 day trial to do this. REVO Pro is just $29.95 for the “portable” version - if you have to deal with swarmy Windows applications at all the first hour you save will pay for this (and anybody how says they haven’t spent at least an hour trying to uninstall and reinstall a Windows application is probably lying).

That having been said, NVIDIA CUDA 10.0 Windows 10 VS2013 still fails to build the solution for Samples/1_Utilities/bandwidthTest. More looking to be done.