For the last few days I had my laptop connected to an external monitor which has a 2560×1600 resolution. Whilst having a few websites open and doing a video chat the laptop completely ground to a halt with the fan going full speed.
My laptop is a Lenovo ThinkPad X260 with an i7 CPU and 16GB RAM, so not really a lightweight which was why this was so unexpected. After trying some random things I have solved this. So I thought I would detail it here if only so I remember in the future.
After a little more investigating I found the root cause of my problem. I have a Firefox profile I have been copying around for a while and in it
gfx.canvas.azure.accelerated both enabled. It turns out that these appear to eat massive CPU resources and can cause performance issues with Glamor. I turned them off, switched back to Glamor rendering and we are back to normal performance again.
This is the more ideal scenario because as we move towards Wayland being the default display server we will also be moving away from Xorg graphics drivers.
Recent versions of Xorg have switched the Glamor as a graphics driver. This basically uses 3D acceleration to draw your 2D desktop. From what I can tell for most uses this is very performant. With just my laptop screen I have no complaints. When using high resolution external monitors however it appears to be really struggling.
When I switched to the Intel native Xorg driver I could suddenly use the external monitor effortlessly. CPU usage was way down and it has even appeared to increase battery life when disconnected from the external screen. I’ve done a bit of searching as to why this would be but haven’t come up with any hard evidence so far.
To do this switch in my Kubuntu 18.10 installation I created a file called
/etc/X11/xorg.conf.d/20.intel.conf with the following contents:
Section "Device" Identifier "Intel Graphics" Driver "intel" Option "TearFree" "true" EndSection
As with all these kind of things YMMV. I hope whatever is causing issues with Glamor for me is solved in a future Kubuntu release.