It seems that Compiz is not compatible with your graphics card or your drivers. Compiz is a composite window manager responsible for the desktop effects such as transparencies, etc.
In addition to using system resources, it has always been a pain and a source of instability.
It should be disabled by default and only enabled in fully supported configurations.
The first thing I do after installing a distribution that uses it is disabling it.
If you are installing Ubuntu 18.04, I believe that the default desktop is Gnome which does not heavily depend on Compiz, so I think you can disable it from the command line or just remove it. See:
My advice, in any case, is that with your hardware you should try something lighter such as Xubuntu, Lubuntu or some derivative:
There is Mint Xfce, LXLE, Elementary OS, Linux Lite, Peppermint, etc. Even if Linux Lite and Mint might also have Compiz activated by default.
Finally, Compiz May work with the latest proprietary drivers for your graphics card, but, trust me, it isn't worth the pain.
Edelmiro Moman, PhD