The inconsistent shifts in the RMSD graphs

The RMSD generation in gromacs is providing inconsistent shifts over the period of simulation. How can this problem be fixed? Attaching an RMSD graph for reference. Please help me out.

You have to clean up the trajectory over which you are computing the RMSD. This is usually done with gmx trjconv and specific -pbc flags such as whole or nojump etc. Take a look at the manual.