Ubuntu comes with it already installed, all you need to do is enable the desktop effects
Open the compiz config and enable the cube and any other affects you want, you will need the 3rd part drivers enabled (i think ubuntu tells you this anyhow)
Looking at that error message would suggest your not using hardware 3d