0
votes

I have a C++ static library project that compiles without any errors, nor it shows any errors in the Error list window. So all seems to be working OK. Except that when I try to open the source (CTRL + left click on a library or library specific item), then the file of an incorrect version is opened. Why?

To elaborate. I have CUDA 9.1, CUDA 9.2 and CUDA 10.2 installed on my PC. My project has following CUDA Linker config:

  • Additional Libary Directories: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib\x64;%(AdditionalLibraryDirectories)

  • Additional Dependencies: cudart.lib;%(AdditionalDependencies)

In the CUDA linker's Command line I have:

"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\bin\nvcc.exe" -dlink -o x64\Debug\Core3.device-link.obj -Xcompiler "/EHsc /nologo /Zi " -L"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.2\lib\x64" cudart.lib

In the CUDA C/C++'s Command line I have:

enter image description here

So, it looks OK. But in the code, when I click on any of the includes - they point to 9.2 source. Example:

#include <cuda.h> 
#include "cuda_runtime.h"
#include <device_launch_parameters.h> 

the path is: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\ v9.2 \include

enter image description here enter image description here

Furthermore I have checked the environment variables. All good. Also checked which props files are used in .vcxproj file. Properties CUDA 10.2.props are used everywhere.

So my question is - why does the IntelliSence still thinks that I am using an older version of CUDA? And more importantly - how do I make him use a proper, 10.2 version?

EDIT 1: more information requested in comments. Include directories - defaults used.

enter image description here enter image description here enter image description here Variable check: enter image description here enter image description here

1
You did not show configured include dir - from your VS solution or directly your VS installation. Seems that one of these is pointing to 9.2 version.Neywat
@Neywat could you elaborate on or directly your VS installation? Where should I check? Regarding the first - I have edited the post and attached Include Directories config, if that is what you meant. Defaults are used.Alex
By VS installation, I was refering to options dialog > VC++ Directories. If your project don't override paths, then they are the same. For your project, does C/C++ item or CUDA C/C++ item have other include paths configured ?Neywat
@Neywat by convention defaults are used in places that I have not mentioned in original post. :) As a proof - see edit. I have attached multiple pictures from the project settings, including these that you have asked about. Please check. p.s. stackoverflow community/mods please don't ban me if there are too many pictures..Alex
Sorry for that, I was checking the obvious :). I suppose you tried to delete the intellisense database (saved my life couple of times). If you use precompiled headers, it can also cause strange behavior.Neywat

1 Answers

0
votes

@Neywat has suggested removing the IntelliSense folder and it worked.

I had to remove the whole .vs folder in solution directory though.

The question remains though - is this a known issue and is the Microsoft team aware of it? What are the recommendations in regards to .vs folder lifetime? Should we clean-it up from time to time?