I tried @pagr solution and that didn’t work for me.
Nvidia GTX 1080i
Latest VS Studio 2017 installed late Nov 2018
Cuda 10 local exe installer
- Use the windows add/remove program to remove any previous Nvidia cuda installations you might have. Under step 2 from pagr12 I mistakenly just deleted these which leaves you with a corrupt registry. To fix that - I went and reinstalled Cuda 8 in my case, then used windows remove programs to correctly remove all of them.
- Run the Cuda 10 installer, accept license etc. But don’t proceed yet.
- Copy the path where the installation files are to be expanded.
- Go to the path mentioned above, and find the folder “CUDAVisualStudioIntegration” and copy it to one of your own locations.
- Go to Custom Install.
- Deselect the two options under development for Visual Studio Integration and Insight.
- Complete the install. Hopefully at least this works and you get passed it.
- Run the installer in the folder you grabbed from step 3 above.
- Even after this… might not be good - so dig into CUDAVisualStudioIntegration\extras\visual_studio_integration\MSBuildExtensions and grab the files there. Copy them to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\BuildCustomizations
- Restart Visual Studio.
CUDA will put the samples in C:\ProgramData\NVIDIA Corporation\CUDA Samples\v10.0 which is a weird directory - Windows didn’t show this when I went to C: in win explorer… so type it in and you can get there. Here there will be permission problems if you try and open the solution in visual studio - so right click on the CUDA Samples directory - hit properties, go to advanced and give Full Access permissions to your “Users” group. Now try and open the VS 2017 solution.
- Note you should probably just change the samples install dir to something custom when doing install.
MORE problems - the ‘target’ windows driver is messed up - to fix this, right click top level solution and select retarget projects… let that finish. Save everything and ensure no problems.
Next issue - trying to run device query in debugger I was getting issue on many dlls: cannot find or open the pdb file"… do this:
Tools->Options->Debugging->Symbols : Check “Microsoft Symbol Server”
Couple more options to help with this one – see
If you get issue about toolkit not found… go to project (not solution) and right click, properties, Configuration, cuda, and fix Toolkit Custom Dir… probably with:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
Also ensure that the above directory …/bin and …/libnvvp are in your PATH.
Right click, debug device query – for me saying:
cudaGetDeviceCount returned 35
-> CUDA driver version is insufficient for CUDA runtime version
Result = FAIL
Digging – seems I have my old Cuda8 dlls in the C:\windows\system32 directory.
Yea – so this one took me a long time to resolve. Here’s what finally did it after I had done everything above.
On Install -> Custom, I could see the version of my display driver, and GEForce Experience, and HD Audio were all newer than what came with my Cuda 10 install.
So I uninstalled those 3 things using windows add/remove programs. Then I went and downloaded a version of Nvidia Display driver for my card that was at or before the version mentioned in the Cuda Custom Install.
Couple computer restarts.
Now install cuda again. If you did everything above you don’t need to get samples again. Just make sure and uncheck VS Studio Integration in the custom install. That still didn’t work.
So after that and another restart – I was able to run my deviceQuery but this time with
CUDA Device Query (Runtime API) version (CUDART static linking)
cudaGetDeviceCount returned 30
-> unknown error
Result = FAIL
In running cuda custom install – it confirmed that new/current versions were the same across the board. So at least nvidia thinks it installed everything.
So I went into GEForce Experience – did the update driver again, selected everything – and as soon as that was done – my deviceQuery in visual studio, and on command line worked perfectly
This solution only took me about 8 hours of my life. Nice work Nvidia!