I use CUDA 10.2 with MS VC++ 2019, and I have two closely related questions. I am trying to avoid having to distribute the runtime dll cudart64_102.dll along with my app. In the Build Properties I specify “static CUDA runtime library” and in the linker input I add cudart.lib. But when I try to run my app on a computer without this runtime dll it fails to start because cudart64_102 is missing! Huh? Isn’t that the whole point of static linking, to avoid the runtime dll? If I include this dll my app runs perfectly, even on fairly old machines.
When I studied the example code I saw that the examples link with cudart_static.dll. Thinking that must be the solution, I substituted this linker input for cudart.dll. Now my app starts okay (no missing dll error), but even on very modern machines, cudaGetDeviceCount() fails with the error “CUDA driver version is insufficient for CUDA runtime version.” So I’m no better off!