To provide an alternative to Adrian's answer: if you prefer to use proprietary drivers sourced directly from NVIDIA instead of those found in a PPA, installing (or in my case, re-installing) the latest proprietary driver can help eliminate the swrast error.
If you don't have the NVIDIA driver yet, download the driver from NVIDIA's website. Next, switch to tty (
F1) and turn off your login manager:
If using lightdm,
$ sudo service lightdm stop
If using gdm,
$ sudo service gdm stop
Navigate to the install script and run it, and follow the prompts. Don't worry if the pre-install script fails. I always accept registering DKMS and the 32-bit compatibility libraries. After the driver is installed, restart your machine:
$ sudo reboot
If you already have an install script from an older NVIDIA driver, simply run the NVIDIA driver install script as oulined above, but with the "--update" option:
$ sudo ./NVIDIA-Linux-x86_64-***.**.run --update
This will get you the most up-to-date version of the driver.
Doing this fixed my
libGL error: failed to load driver: swrast error.