I'm not sure what you mean. I'll try to be more clear, excuse me if I'm not, I have some difficulties to express my self in english.
This:
dV=dmgz, when integrating will give v-v
0=mgz, which gives the potential energy.
In the other hand, Volume*density=mass, density is mass/volume. That is for a uniform mass density, it could be that the distribution of mas being not uniform, then you should have that in consideration when finding the center of mass, inside the integral. The answer that you found is fine for an uniform mass distribution (the density being constant).
The center of mass is given by:
r_{cm}=\frac{1}{M} \int_V \rho (r) rdV
Here M represents the total mass, rho gives the mass density distribution, r is the position, and the integration shields over the entire volume.
http://en.wikipedia.org/wiki/Center_of_mass
Now, the potential energy actually depends on the frame of reference (you can choose in the integration the V
0. You can choose the point from which you are choosing to measure the height. I supposed that the exercise asks you to measure the potential energy for the pyramid standing over its base on the surface of the earth, with respect to the surface of the earth. Then what you need to find is the height at which the center of mass is located. Once you got the center of mass, you forget about the pyramid, and just compute the potential energy for a mass point with the mass of the pyramid, located at the center of mass.
I don't know if I'm being clear, but don't doubt in asking again and insisting with your doubts, I'll do my best.
BTW, if you don't know the mass, but you know rho, and rho is not uniform, you can compute the total mass this way:
M=\int_V \rho (r)dV