CUDA and Static Libraries

I am developing an application that must be distributed as a single monolithic executable. I have been experimenting with CUDA version 2.1. I am at a point of either integrating NVIDIA CUDA support into my application or abandoning the effort. Are there static CUDA libraries available that can be linked into my application rather than DLL’s to enable me to move forward with this integration? The DLL that is in question right now is the cudart.dll. It would be great to get an equivalent cudart.lib with static code rather than just the dynamic code. Is there any such distribution?

You’re going to have to use the driver API. There is no static cudart for various reasons, and I don’t expect that to change anytime soon.

I appreciate the quick response. I was pretty sure that your response was going to be that there are no static libraries. Is there a short explanation as to why?

Are there any good examples of programming the Driver API? For example, I’ve been using the CUDA boxFilter project for testing. Is there an equivalent box filter example using just the Driver API or something else that is as comprehensive as that example?

The way CUDART is organized internally doesn’t lend itself well to becoming a static library.

You can look at deviceQueryDrv and other examples like simpleTextureDrv for how to program the driver API. You can use bin2c (included with the toolkit) to easily integrate cubins. The main disadvantage is you don’t get <<<…>>> and have to do some configuration calls before a launch.