CUDA 11.2 SDK Incorrect Detection Under Windows

Hi All,

I am experiencing a problem configuring a C++/CUDA project under Windows 10 / VS 2019 / CMake 3.20.1 (and a bunch of previous versions)

The PC has installed CUDA 11.2 and no trace of CUDA 10.2 (not under Program files not any environment variable).

A CMakeLists script with an ENABLE_LANGUAGE(CUDA) statement finds the CUDA 11.2 nvcc compiler, but then selects CUDA 10.2 (which is not present on the system). If I manually change the value of the path to CUDA, CMake will still overwrite it with a path to version 10.2. I have tried also defining CUDA_TOOLKIT_ROOT_DIR but to no avail.

I am attaching a screenshot, as I think it shows interesting information.

Has anyone encountered similar problems?

Thanks for any advise,

Best Regards,

Andrea

Cc: @robert.maynard

It looks like that you haven’t installed the Visual Studio CUDA integration components for CUDA 11.2 and therefore it is finding the old MSBuild prop files for 10.2.

You should be able to find the old MSBuild files in the following path to confirm that they are installed.

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\BuildCustomizations

Hi Rob,

Thanks for the advise. I have disintalled CUDA 11.2, double checked that no components for VS were left, reinstalled the current version of CUDA which is now 11.3, Verified that the components for VS 2019 were installed by checking the list of installed programs. I have also looked at the path you have provided and the components seem to be there:

But I keep getting the same error:

Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.3/bin/nvcc.exe - skipped

If there is any advise I will gladly take it, otherwise I will try to dig into the CMake modules.

Thanks and Best Regards,

Andrea

That isn’t an error, CMake will skip certain steps when it already knows the information that step would have provided. In thise case we can skip a compiler check since we already invoked the compiler earlier.

Could you post any following error message you are getting.

Testing locally with CUDA 11.3 and VS 2019 and I am not seeing any issues generating CUDA projects with CMake 3.20.1.

Hi Rob,

I sincerely appreciate your time and effort. I am having two issues, one minor, and one major. The minor is that CUDA 10.2 is detected. CUDA 10.2 was previously installed on that system, but was removed using uninstall. There is no trace of it under C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA, or in the environment variables, or under the VS plugins. The major issue is that if I manually set CUDA_TOOLKIT_ROOT_DIR to the path to CUDA 11.3 (either in the GUI or using set statements in the CMake files), CMake overrides my choice with the path to CUDA 10.2, but as CUDA 10.2 is not present on the system, than I cannot compile the project.

Do you have any idea of why CMake would override the path I specify?

Thanks for any advise,

Best Regards,

Andrea

Hi Rob,

I have still worked on investigating the issue, but I confirm it persists:

  • I have un-installed any copy of CUDA / NVIDIA Toolkits
  • Un-installed VS 2019
  • Rebooted
  • Installed VS 2019
  • Rebooted
  • Installed CUDA 11.3
  • Rebooted

Cmake still detects CUDA 10.2 (but not CUDA 10.2 toolkit exists on the system), and does not let me point it to CUDA 11.3 - if I type in the path to CUDA 11.3 it will revert to 10.2 if I hit Configure or Generate.

Can you kindly point me to which CMake module file I should be looking into in order to understand what is going on?

Thanks and Best Regards,

Andrea

Hello,

Just to add one more data point: I have created a new virtual machine from scratch with Windows 10 Pro 64bit, then installed VS 2019 Community Edition with C++ tools, rebooted, installed CUDA 11.3 and CMake 3.20.2.

CMake still detects the CUDA 10.2 toolkit and and does not let me select CUDA 11.3 - I believe there is really something wrong with the CUDA module of CMake as CUDA 10.2 is not present on the system, nor was ever present - in order to make sure of this, I have installed everything from scratch on a fresh Windows VM.

I would be happy to conduct other tests if useful.

Best Regards,

Andrea