CUDA Set Device Failed CUDA 10.2 Windows 10

I am trying to get back into CUDA with my GeForce 920M on Windows 10. I initially installed CUDA 11.0, but found that it was not compatible with my card. I then installed CUDA 10.2, and when attempting to run the sample code in Visual Studio, I receive the error “cudaSetDevice failed! Do you have a CUDA-capable GPU installed?addWithCuda failed!”. However, when I open the CUDA devicequery, it correctly identifies my card. I have tried un-installing, deleting, and re-installing CUDA, and still keep getting the same error.

In case anyone has a similar problem, I was able to finally get CUDA to run again on my computer. I needed to first downgrade from VS 2019 to VS 2017. I deleted all CUDA and drivers from my computer. Then I had to download and install the most up-to-date version of the driver (which was from April of 2019), and then I installed CUDA 10.1 from February of 2019. I wanted to make sure the driver was more current than the CUDA edition because when I tried to do the opposite, CUDA could not find the driver.

With this current set-up I was able to replicate my work from when I last ran CUDA, so I am looking forward to diving back into it!

1 Like