Inverse solver only works using direct method to solve linear system; GMRES fails