Rings virtually satisfying a polynomial identity