Cuda C# Integration Change My cuda dll no longer functions properly with C# PInvoke


I am having a very odd problem with integrating my C++ unmanaged dll with C#. I am certain that I am calling the dll properly from C# and I am also certain that the dll functions properly. First of all, some information about my setup and issue: I am running a Win 7 x64 multiGPU (two Tesla C2050’s) platform (Cuda SDK 4.0, VS 2008, .NET framework 3.5) and have written a C++ dll to utilize both GPU’s asynchronously. This code runs flawlessly when I have been calling it from my C++ test project. However, I need to call this dll from C# in order to integrate this platform with a display GUI. I have done this (PInvoke) and can call my functions properly, however for some reason, it seems as though the cuda functions (such as cudaMalloc and cudaMemcpy) no longer work (i.e. fail). I have slimmed down my solution to a single GPU, non-threaded application to confirm that the new platform was the cause. I would consider myself an intermediate cuda programmer, so please excuse me if this is a trivial issue. Unfortunately, I can not post any code.

If this is a known issue or a simple fix, please let me know! I have been scratching my head over this for hours and am not sure why the dll calls would work when I call them in C++ and not C#. I am not even passing any variables!

Edit: Even though nobody looked at or replied, I figured I’d put my “solution” (if you can call it that) here. As soon as I switched computers, it worked fine without any code or project change. I am wondering if it could possibly have been VS 2008 SP1, which I had recently installed on this computer and not the other.

The SP1 is required for CUDA development if you use VS2008.