Interaction of slip with grain boundary and its role in cavity nucleation