Debugging in 3.2 on linux is hard without device emulation mode ?

Hi, I’m trying to debug a program. The only information I’m getting back at runtime is as follows :

cortex.cu(521) : cudaSafeCall() Runtime API error : invalid argument.

Obviously, this is barely useful, since I don’t know which argument is invalid or how it might be invalid. I attempted to compile in emulation mode, to see if the error persisted, but now it looks like emulation mode doesn’t exist in 3.2.

So, what do you guys suggest ? How am I going to debug this ?

Sincerely,

mrule.

I thought this error, which was associated with cudaMemcpy, was confined to one program, but it appears that all the source code that I am presently migrating from an earlier version of CUDA is affected. Did the API change ?

You know what, this is what I think is going on :

– the old version did a memcopy with too many bytes specified, writing into some place it shouldn’t
– this bug was silent in previous versions, maybe because the adjacent buffer just happened to be a scratch buffer that was re-initialized later, so no harm done
– the new runtime includes some sort of array bounds checking for memory copies, which is good

Does this theory hold up ? If it is correct, would it be too difficult to change the error to “array index out of bounds” or something more descriptive than “invalid argument” ?

I don’t know off-hand if we added additional checks in 3.2, but it wouldn’t surprise me.

Did you ever find out what was going on?
I’m having the same problem when migrating my code to 3.2.
It compiles fine in 3.0, but when I use 3.2 the first cudaMalloc that gets called returns an invalid argument statement.
I don’t see how that’s possible, since this is all the call is:

SC( cudaMalloc((void**)&m_pSimInput_CUDA, 3 * 256 * 320 * sizeof(unsigned char)) );

where m_pSimInput is in the class header:
unsigned char *m_pSimInput_CUDA;

and SC is just a macro for CUDA_SAFE_CALL

All of the SDK examples compile and run just fine of course.

Solved, was using some binaries compiled pre-Fermi of course. I forgot I was linking to them…