Unable to use cuda with visual studio 2022

I have tried to run many small sample cuda programs in visual studio 2022, including the VS sample code. They all take an exception at a cuda call, saying that I am passing an invalid parameter. This happens on all programs, not at the same cuda call.

I’m sure that I do not have the system set up properly, but have no idea what needs to be done. Can anyone give a list of instructions for setting up visual studio for cuda from scratch - including what has to be downloaded, set up, etc? I have tried some step by steps from the web, and they all give me this same error. Must be doing something basic wrong.

I usually get caught in “whaddy mean you didn’t do xyz? Even babies in their cribs know you’re supposed to do that! Of course nobody told you!” I suspect this problem may be one of those.

https://quasar.ugent.be/files/doc/cuda-msvc-compatibility.html

I came to know that specific CUDA versions use specific VS version. please check in given link.

1 Like

this may help

According to the CUDA 12.1 Installation Guide for Windows MSVC Version 193x / Visual Studio 2022 17.0 is supported (see Table 2). It is not clear what you mean by

As far as I know, MSVS Intellisense still does not understand CUDA syntax for kernel invocations and marks those with red squiggles. This can be ignored. If you get an actual compilation error, please cut & paste it here.

As for general installation instructions, that is what the installation guides are for.