Error 500 related to cuMemGetAddressRange

In my program, I called cuMemGetAddressRange() but get 500 error (CUDA_ERROR_NOT_FOUND).
This error happens sometimes but is not reproducible for each test.
I used latest cuda 6.0 and Driver Version is 331.75 (through nvidia-smi command)
What might be the reason for this error?

BTW, cuInit is called and device memory has been allocated.

Thanks a lot.

Referring to the documentation:

http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__TYPES.html#group__CUDA__TYPES_1ggc6c391505e117393cc2558fff6bfc2e990696c86fcee1f536a1ec7d25867feeb

CUDA_ERROR_NOT_FOUND = 500 This indicates that a named symbol was not found. Examples of symbols are global/constant variable names, texture names, and surface names.

Although that is not actually listed as one of the possible return error codes:

http://docs.nvidia.com/cuda/cuda-driver-api/group__CUDA__MEM.html#group__CUDA__MEM_1g64fee5711274a2a0573a789c94d8299b

Returns

CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE

It may be coming from a previous operation, however:

Note:
Note that this function may also return error codes from previous, asynchronous launches.

You might want to build some harness around this call, and capture the specific pointer or data passed to it when the error occurs. You may also want to add an extra error check prior to the function call to see if the error is present from a previous CUDA operation.

Thanks for the suggestion, I will try that.