In gradient nanocrystalline metals, the grain size variation usually comes with the compressive residual stress induced by mechanical surface treatments such as surface mechanical attrition and severe shot peening. This paper focused on the fracture of gradient nanocrystalline metals with the residual stress that is introduced during the mechanical surface treatment. The J-integral of a mode I crack in the gradient nanocrystalline metal with different residual stress was calculated using finite element method. ABAQUS/Python scripts were developed to automatically create the gradient material, exert the residual stress and calculate the J-integral. By employing the empirical residual stress formula of sinusoidal decay type, a parametric study was carried out to investigate the effects of two characteristic features of residual stress, i.e., the magnitude and the compressive zone depth, on the calculated J-integral. The results reveal that J-integral is significantly influenced by the residual stress. Specifically, the J-integral will decrease as the magnitude of residual stress increases. As the compressive zone depth increases, the J-integral first decreases and then increases. This indicates that the induced residual stress, along with the surface grain size variation, contributes jointly to the enhanced toughness of the gradient nanocrystalline metals.