emudebug error CudaMalloc failed in emudebug mode.


I am using Cuda in an existing project (and so without using templates). I have no problem with release and debug configuration mode but I try to configure my project for emudebug and emurelease.

I have created these 2 new configuration : emudebug based on debug and emurelease based on release mode and for each .cu file added –deviceemu (for these 2 conf.) in the command line.

The compilation is good but the execution fail when I call : CUDA_SAFE_CALL(cudaMalloc((void**) &utVariable, uiSize));

Hi Martin,

as I’m stumbling over the same problem - have you had any success in resolving this issue?

if yes, would be nice if you could let me know what the problem was.


anybody else experienced that?

to be more specific, here’s my problem again - execution (not compilation) fails in emuDebug mode (but is fine in normal debug mode) for following line:

CUDA_SAFE_CALL(cudaMemcpy(Data_d, Data_h, size, cudaMemcpyHostToDevice));

note: when calling cudaMemcpy directly (without CUDA_SAFE_CALL), execution succeeds;

what’s more (and this is my real problem), the debugger does not stop at a breakpoint in my kernel in VS

all I changed from Debug to EmuDebug mode was to add the -deviceemu option to the nvcc command line (in the custom build step in VS)

thanks in advance!

Unfortunately, I have not success in resolving this issue.
I am always blocked with this problem.

Anabody else??


You say you’re not using the SDK templates. Did you compare against them very carefully? Are you defining all the right constants? Look at the definition of the CUDA_SAFE_CALL() macro to see what it is doing and what #ifdefs etc. surround it.

This isnt related to the problems above, but i fixed my Debug and EmuDebug compilation problems in Visual Studio by removing the
“_DEBUG” from the preprocessor directive under Project Properties -> CUDA settings.

I see the same peoblem, the system hangs if I add the -deviceemu to the compile option…

Does anyone know about the cause for this? Thanks.

I’ve had this problem before and errors were saying you cannot mix device and emulation modes. I worked around it by removing the CUDA_SAFE_CALL macros. It would run past that point, but ultimately it was due to one of my linked libraries that wasn’t compiled in emulation mode.