cusparseScsrsv_analysis : CUSPARSE_STATUS_ALLOC_FAILED

I try to analyze matrix A (number of rows is 220, number of non-zero elements is 588). But the cusparseScsrsv_analysis returned the value: CUSPARSE_STATUS_ALLOC_FAILED. And my platform is win32 vs2012 and GT240M(512MB). When I run my program, the GPU memory usage is only 270MB . There is a lot of memory that can be allocated and why the cusparseScsrsv_analysis function failed?

If you want an answer, you are going to need to post the source code(use code blocks).cuSPARSE is tricky and particular call is usually a 2-step process:

Also that GPU is rather old and for laptops, so do not expect too much from it.