Distributing/using CUDA inside a plugin?

I have some CUDA code that I want to use inside a plugin into another application, which itself is not CUDA enabled.

Unfortunately, if I link with and use cudart.dll, it can’t be found when my plugin is loaded into the host application.

It sounds like what I want is to use the dynamic linked driver api (as used in the matrix demo). I tried this approach, but I still get unresolved symbols from my compiled .cu code.

Note that I need my plugin to run even if a CUDA-enabled driver is not present, and I can’t get away with sprinkling CUDA DLLs through the file-system. If I distribute any extra files, they need to be along-side my plugin.

Is there an easier way to do this?

Now that I have read through some of the CUDA documentation the different APIs here are starting to make sense. Guess I should have done that first. (I inherited this code)

Looks like I’ll need to package my CUDA code into a auxillary DLL that gets loaded by my plugin - then I should be able to bundle the necessary runtime DLLs along with that extra DLL.