Debuging CUDA kernels called from .NET code in VS2008, emulation mode

Posted by Danny Varod on Stack Overflow See other posts from Stack Overflow or by Danny Varod
Published on 2009-10-10T03:22:28Z Indexed on 2010/05/29 13:22 UTC
Read the original article Hit count: 641

Filed under:
|
|
|
|

CUDA has an option to compile code in emulation mode, which is supported in the .rules file they provide.

I have C# .NET 3.5 SP1 code that calls a native dll, using DllImport, the native dll is compiled via VS2008 using nvcc and its function is to transfer memory from and to CUDA and to invoke CUDA kernels.

When the CUDA kernels are correct, everything runs fine, but when there is a bug, I can only step in to the code until the title of the kernels and see the parameters they receive. (I enabled debugging native code in the startup-project's debug options.)

I have tried compiling with emulation mode, however I get the CUDA error "mixed device execution" when calling the CUDA memcopy host-->device. I tried switching the alloc+dealloc+memcopy with their equivalent non-CUDA versions, but then the same error occurs when invoking the kernels.

What did I do wrong in my attempt to using the debug-emulation mode?

P.S. I tried this on Vista x64 SP1 + VS2008, with the same solution complied in both x86 and x64, neither worked in emulation mode, both worked in non-emulation mode.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about visual-studio