  In this work, we investigate gravitational baryogenesis in the framework of
$f(P)$ gravity to understand the applicability of this class of modified
gravity in addressing the baryon asymmetry of the Universe. For the analysis,
we set $f(P) = \alpha P$ where $\alpha$ is the model parameter. We found that
in $f(P)$ gravity, the CP-violating interaction acquires a modification through
the addition of the nontopological cubic term $P$ in addition to the Ricci
scalar $R$ and the mathematical expression of the baryon-to-entropy ratio
depends not only on the time derivative of $R$ but also the time derivative of
$P$. Additionally, we also investigate the consequences of a more complete and
generalized CP-violating interaction proportional to $f(P)$ instead of $P$ in
addressing the baryon asymmetry of the Universe. For this type of interaction,
we report that the baryon-to-entropy ratio is proportional to $\dot{R}$,
$\dot{P}$ and $f^{'}(P)$. We report that for both of these cases, rational
values of $\alpha$ and $\chi$ generate acceptable baryon-to-entropy ratios
compatible with observations.
