I'm looking for recommendations for a simple GPU linear equation system solver that is a dropin replacement for scipy.linalg.solve. Right now, I'd rather not go the Petsc/TriLinos/Slate route. Surprisingly, Google doesn't seem to give a definitive answer.

torch.linalg.solve seems to be promising, but that page doesn't give a definitive answer on whether it uses the GPU.

  • $\begingroup$ Consider whether single or double precision floating point arithmetic is needed (what is the condition number of your system) and whether your GPU has strong double precision performance if that is necessary. $\endgroup$ May 11 at 13:58
  • $\begingroup$ MAGMA has LAPACK-like routines for both dense and sparse matrix systems. Not sure if this is exactly what you're looking for. $\endgroup$ May 11 at 14:57
  • $\begingroup$ Are you looking for a direct solver, or iterative solvers? $\endgroup$ May 11 at 20:31
  • $\begingroup$ At this point, direct. $\endgroup$
    – NNN
    May 12 at 3:24

1 Answer 1


Scipy.linalg.solve calls LAPACK routines to do direct factorization of a dense system of linear equations.

For Nvidia CPU’s, these routines are provided in the CuLA linear algebra library. So, you want a python interface to the CuLA library. A quick google search shows that scikit-cuda includes wrappers for this purpose.

  • 1
    $\begingroup$ As mentioned in a comment, the Magma library could also be used, except that I’m not aware of a python interface to Magma. $\endgroup$ May 12 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.