Encoding ARGB format input buffers

I am trying to send ARGB format input buffers to NVIDIA encoder.
But it does not returns from the call to nvEncLockInputBuffer() function.
Sometimes it returns from this call but then it does not return from nvEncUnlockInputBuffer() or nvEncodePicture() call.

What might be the reason for this???