= Solution
There is a natural isomorphism
$$
\operatorname{Hom}_{kG}(P,U)
\cong\operatorname{Hom}_{kG}(P\otimes_kU^*,k),
$$
obtained by evaluating a homomorphism against a covector. Since $P$ is a direct summand of a free module and tensoring a free $kG$-module with $U^*$ using the diagonal action again gives a free module, $P\otimes U^*$ is a <projective module>.
Lift this projective module to an $\mathcal O G$-lattice. Projectivity makes the dimension of the homomorphism space equal to the multiplicity of the trivial representation after extending scalars to $K$. The lifted ordinary character vanishes on p-singular elements, while on p-regular elements it is the product
$$
\chi_P(g)\chi_{U^*}(g)=\chi_P(g)\chi_U(g^{-1}).
$$
Ordinary character orthogonality and the substitution $g\mapsto g^{-1}$ therefore give
$$
\boxed{
\dim\operatorname{Hom}_{kG}(P,U)
=\frac1{|G|}\sum_{g\ p\text{-regular}}
\chi_P(g^{-1})\chi_U(g).}
$$
Equivalently, this is the <Brauer character inner product> between the <projective character> of $P$ and the Brauer character of $U$.
Back to article page