[tex]\huge\boxed{4\ \text{kg/m$^3$}}[/tex]
We know that [tex]\rho=m\div V[/tex], where [tex]\rho[/tex] is density, [tex]m[/tex] is mass, and [tex]V[/tex] is volume.
Substitute in the values we know and solve:
[tex]\begin{aligned}\rho&=8\div2\\&=\boxed{4}\end{aligned}[/tex]