I am using Visual Studio 2017 and CUDA 11.3. I am building for Windows 64-bit.
My “CUDA C/C++” ‘CUDA Runtime’ setting is at the default “Static CUDA runtime library (-cudart static)”.
However, when I look at the linker Command Line, it is showing “cudart.lib” instead of “cudart_static.lib”.
I can see the compile options are correct, but I cannot get it to link with proper lib.
When I use Microsoft’s depends.exe on my final DLL, it shows that it needs the CUDA DLL. Further proof that the DLL is needed: when I install my DLL on a PC without the toolkit it fails because it cannot find the CUDA DLL.
As a test, in ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\lib\x64’ folder, I made a copy of cudart_static.lib and called it cudart.lib. With that, depends.exe properly shows that no CUDA DLL is needed. My DLL runs ok.
I did a search, but couldn’t find an answer to my issue.