cudart.lib vs. cudart_static.lib

What is the difference between these 2 static libraries? Is one of them just an import lib whereas the other also contains the code? If yes then does this mean if I link my code with cudart_static.lib I do not need the runtime dlls (cudart*.dll)?

One is set up for dynamic linking. One is set up for static linking.

Yes, if you do static linking against cuda runtime, you do not need the cudart*.dll

static linking is covered in the nvcc manual

This should almost be a static vs dynamic linking thread now :P

The boon of static compilation is that you don’t need to worry about where shared object code may live and I think you eschew the penalties of looking up the function for the first time. This does come at the cost of binary size, however, because static linking copies things directly instead of calling out to pre-existing object code.

Static linking is a bit easier to deal with, especially on Windows where the DLL insanity has produced the need for import libraries. Linux/GCC are very okay with dynamic linking but Windows? Oh God…