use agmg as solver