How to deallocate the device space during executing the program

Hi,

I want to get the singular value of a martix using the function cusolverDnXgesvd, afterward, the function cusolverDnXgetrs will be used to solve the linear system. In my program, the cusolverDnXgesvd will be used only once and other function will be used more times, such as

main program

  istat = cusolverDnXgesvd( parameters )
  do i=1, 10
    istat = cusolverDnXgetrs( parameters )
  end do
end main program

However, I notice that a large memory is taken by cusolverDnXgesvd. May I free the space that occupied by cusolverDnXgesvd:

main program

  istat = cusolverDnXgesvd( parameters )
  free space(cusolverDnXgesvd)
  do i=1, 10
    istat = cusolverDnXgetrs( parameters )
  end do
end main program

I have tried to destroy the handle and stream ,and deallocate the dynamic arrary used in the function. But device still shows a large memory be used by it. May I empty the current device memory? That mean is not to kill the progress, such as what the cudaDeviceReset does.

regards,

Amore.

Are you using OpenACC to manage the device data? If so, our runtime uses a “lazy” method that doesn’t immediately deallocate device memory. Given allocation is very expensive and many programs reallocate memory, we instead reuse a memory. You can set the env var “NV_ACC_MEM_MANAGE=0” to disable this and have runtime immediately free the memory, but the program will incur a performance penalty if there are additional allocations.

If the program is purely using cuSolver, then I’m not sure. We’ll likely need to move your post over to the CUDA library forum where they can be of better assistance.