Is there a reason as to why/when this error occurs?
I haven’t been able to trace when this occurs but it does occur within the kernel.
Any ideas?
Thanks.
Is there a reason as to why/when this error occurs?
I haven’t been able to trace when this occurs but it does occur within the kernel.
Any ideas?
Thanks.
What does occur? Maybe its a good idea to tell what error occurs while doing what…
Maybe a output of the program / compiler and some code will help.
I guess ccuser is thinking of cudaError_enum, I have similar issues.
For Example, my application (WinXP, VS2005) works fine and produces valid results, but whenever I close it, I get an
Microsoft C++ exception: cudaError_enum at memory location blah
What does that error generally mean?
I don’t think it is that hard to search the forum:
http://forums.nvidia.com/index.php?showtop…=cudaerror_enum
You’re totally right. But I read that thread before and it doesn’t provide a solution to my problem. My allocation and deallocation works similarly to the SDK ones, so the issues discussed in that thread do not apply in my opinion.
Anyway here’s the piece of code that produces the cudaError_enum on application exit. Any idea?
float foo()
{
float time=0;
cudaEvent_t start,stop;
CUDA_SAFE_CALL(cudaEventCreate(&start));
CUDA_SAFE_CALL(cudaEventCreate(&stop));
CUDA_SAFE_CALL(cudaEventRecord(start,0));
// blah
CUDA_SAFE_CALL(cudaEventRecord(stop,0));
CUDA_SAFE_CALL(cudaEventElapsedTime(&time,start,stop));
CUDA_SAFE_CALL(cudaEventDestroy(start));
CUDA_SAFE_CALL(cudaEventDestroy(stop));
return time;
}
br
Where are you getting the error from?
Looking at your code, you call cudaEventElapsedTime before the stop event actually occurs. You need to call the event synchronize function to ensure that stop has actually passed before getting the elapsed time.
Although, according to the docs this is supposed to return cudaErrorInvalidValue
I’ve added cudaEventSynchronize() after every call of cudaEventRecord(), which did not help.
Then I’ve thrown out everything except the creation and deletion of the events - the error remains the same.
float foo()
{
float time=0;
cudaEvent_t start,stop;
CUDA_SAFE_CALL(cudaEventCreate(&start));
CUDA_SAFE_CALL(cudaEventCreate(&stop));
CUDA_SAFE_CALL(cudaEventDestroy(start));
CUDA_SAFE_CALL(cudaEventDestroy(stop));
return time;
}
This raises cudaError_enum at memory location blah on application exit. If I throw out the event stuff and perform my computations without them, it works.
Conclusion: I’m going to use the Win HPC for time-measurement (just like cutil does)…
br
That is very weird.
I’m having the same problem: everything runs fine (output seems to be valid), but on exit (after main return statement) the following error is outputted:
First-chance exception at 0x7c812a5b in CudaDeCSA.dll: Microsoft C++ exception: cudaError_enum at memory location 0x0013fc78..
As i’ve read in the other posts, an error, that visual studio does not understand, occures somewhere in the code.
Does anyone have a good idea as how to find where this error occures? I’ve placed CUDA_SAFE_CALL and CUT_CHECK_ERROR with every cudaMemcpy. This doesn’t detect anything. How do i detect a problem in the kernel execution? Should the following find an error in an executed kernel:
cudaError_t err = cudaGetLastError();
if( cudaSuccess != err)
fprintf(stderr, "Error with cuda csaBatchedDecrypt!");
Where can I find official information about this error? Nothing is mentioned in the programming guide.
I’ve really run out of ideas to track this bug down.
Are you sure you are running in debug mode and thus enabling those macros from cutil.h? They will only produce debugging code if _DEBUG is defined, otherwise you’ll end up with
#else // not DEBUG
#define CUT_BANK_CHECKER( array, index) array[index]
// void macros for performance reasons
# define CUT_CHECK_ERROR(errorMessage)
# define CUT_CHECK_ERROR_GL()
# define CUT_CONDITION( val)
# define CU_SAFE_CALL_NO_SYNC( call) call
# define CU_SAFE_CALL( call) call
# define CUDA_SAFE_CALL_NO_SYNC( call) call
# define CUDA_SAFE_CALL( call) call
# define CUT_SAFE_CALL( call) call
# define CUFFT_SAFE_CALL( call) call
# define CUT_SAFE_MALLOC( mallocCall ) mallocCall
As for the kernel invocation error message, I agree that you do the right thing - You may want to get the error message too with cudaGetErrorString(err).