I’m trying to use cusolver on fortran and I succeeded using a 3 by 3 matrix. However, when I try to use a larger, sparse matrix (348k by 348k), the program crashes with what I suspect was insufficent memory.

I tried with -stack=50000000

Would anyone please advise?

```
real, allocatable :: A(:,:),ATest(:,:)
real, allocatable :: B(:,:)
real, allocatable :: X(:,:)
integer, allocatable::Ipiv(:)
integer, target::Lwork
real, allocatable :: IRN(:), JCN(:), val(:)
......
open(121, file='Input.dat')
read(121, *) lda, ldb, nnz ! <--- 348780, 348780, 4492548
allocate(A(lda,ldb))
allocate(ATest(lda,ldb))
allocate(B(n,1))
allocate(X(n,1))
allocate(Ipiv(lda))
allocate(IRN(nnz))
allocate(JCN(nnz))
allocate(val(nnz))
A_size = SIZEOF(A)
B_size = SIZEOF(B)
X_size = SIZEOF(X)
Ipiv_size = SIZEOF(Ipiv)
devInfo_size = SIZEOF(devInfo)
Lwork_size = SIZEOF(Lwork)
do i=1, nnz
read(121, *) IRN(i), JCN(i), val(i)
col = IRN(i)
row = JCN(i)
A(row,col) = val(i)
print *, row," ",col, " ", val(i) !<----- error happens when col > 8000
enddo
close(121)
```

Thank you.