  We investigate the $I=1$ $\pi \pi$ interaction using the HAL QCD method in
lattice QCD. We employ the (2+1)-flavor gauge configurations on $32^3 \times
64$ lattice at the lattice spacing $a \approx 0.0907$ fm and $m_{\pi} \approx
411$ MeV, in which the $\rho$ meson appears as a resonance state. We find that
all-to-all propagators necessary in this calculation can be obtained with
reasonable precision by a combination of three techniques, the one-end trick,
the sequential propagator, and the covariant approximation averaging (CAA). The
non-local $I=1$ $\pi \pi$ potential is determined at the
next-to-next-to-leading order (N$^2$LO) of the derivative expansion for the
first time, and the resonance parameters of the $\rho$ meson are extracted. The
obtained $\rho$ meson mass is found to be consistent with the value in the
literature, while the value of the coupling $g_{\rho \pi \pi}$ turns out to be
somewhat larger. The latter observation is most likely attributed to the lack
of low-energy information in our lattice setup with the center-of-mass frame.
Such a limitation may appear in other P-wave resonant systems and we discuss
possible improvement in future. With this caution in mind, we positively
conclude that we can reasonably extract the N$^2$LO potential and resonance
parameters even in the system requiring the all-to-all propagators in the HAL
QCD method, which opens up new possibilities for the study of resonances in
lattice QCD.
