CUDA DLL dependencies

I have a problem and not sure how to solve this…
My application links with the cudart.lib. When Windows loads the .EXE also tries to load all the modules that the .EXE uses ( msvcrt.dll, kernel32.dll, cudart.dll, blah blah ).

The problem is that if I haven’t installed the CUDA toolkit a nice window dialog appears with “Sorry, I can’t find the cudart.dll DLL”. Is there any way to detect CUDA dynamically and then only load the cuda DLLs IF is installed? When not installed I wan’t to go to a CPU software path…

If the answer is negative… could you do this using a COM interface or with a mechanism similar to wglGetProcAdress?


As explained by baarts in a previous thread (strange cudart.dll null pointer), loading CUDA DLLs dynamically is currently not supported:

That will hopefully be fixed in the next release.

In the meantime, my recommendation is to use implicit linking and always include cudart.dll and its dependencies with your application. This way users won’t have to install the CUDA Toolkit in order to use it.

Yep yep I know loading CUDA from a DLL is atm now supported but I was referring to a .EXE.

So can I really deploy all the cudart.dll, cuda.dll, fatZip.dll and ptxcomp.dll with my app without violating the EULA CUDA-toolkit redistributable license? Appararently that will violate the EULA.txt:

We have the same issues to deal with and are also interested in finding out what the CUDA DLL redistribution policy is. Our apps have to work on machines that may or may not have CUDA installed, and in some cases, may or may not even have a video card or OpenGL installed, or even a windowing system.


Hi all,

We’re currently working out a distribution policy. This will go into effect when we release CUDA version 1.0.

We didn’t actually plan on anyone redistributing CUDA until we get to release 1.0. If you have a product that depends on redistributing CUDA soon, please get in touch with me. (forum private message works)


Has a redistribution policy been fully decided yet? The only word regarding redistribution of cuda files applies to Linux/FreeBSD, when I am primarily interested in the Windows platform.

Any update on this? I could not find anything relevant in the latest CUDA SDK license.

Not much point writing CUDA for now since I can’t ship anything using it!

AFAIK you’ll have no problems with redistributing cudart.dll. The only thing NVIDIA asks about is to place redistributed DLLs into application directory, not in system directories.

With CUDA 1.1 there’s no need to redistribute cuda.dll as it’s now renamed (nvcuda.dll) and included in driver. So, if your application uses only Driver API you don’t need to redistribute anything.

That’s good to hear - where is this spelled out in a license?

I think I need to still update our license terms to properly reflect this.
AndreiB is correct (as usual). You are free to redistribute our DLL’s from the CUDA toolkit and CUDA SDK, just please install them into your own program’s local directory, not in some common area.

And we ask that you do not redistribute the old cuda.dll or the replacement nvcuda.dll. This is now installed by all 169.xx or newer drivers.

Any update on this issue? If CUDA is to be integrated into commercial products we need to know where nVidia stands.

If a product is a SDK that copies DLL’s into a system directory, is it OK to copy the CUDA DLL’s into the same directory?

Do not copy DLLs into system directories; it will lead to badness for other apps and potentially messing up the driver installation.