8. Let $p$ be a given odd prime, for $i=1$, $2, \cdots, p-1$, denote $r_{i}$ as the remainder of $i^{p}$ modulo $p^{2}$. Then
$$
r_{1}+r_{2}+\cdots+r_{p-1}=
$$
8. $\frac{p^{3}-p^{2}}{2}$.

It is easy to see that
$$
\begin{array}{l}
r_{i}+r_{p-i} \equiv i^{p}+(p-i)^{p} \\
\equiv \mathrm{C}_{p}^{p-1} p \cdot i^{p-1} \equiv 0\left(\bmod p^{2}\right) .
\end{array}
$$

Since $r_{i}, r_{p-i} \in\left(0, p^{2}\right)$, therefore, $r_{i}+r_{p-i}=p^{2}$.
$$
\text { Hence } \sum_{i=1}^{-1} r_{i}=\frac{1}{2} \sum_{i=1}^{n-1}\left(r_{i}+r_{p-i}\right)=\frac{1}{2}(p-1) p^{2} \text {. }
$$