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 ?
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 ?
– 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” ?
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: