AMD Radeon Linux OpenGL Driver Makes More Optimizations, Eyes GL Threading By Default
RadeonSI for years has supported a "glthread" option for enabling OpenGL threading by executing OpenGL calls on a different CPU thread. This threaded OpenGL dispatch support has been of big help to CPU-bound games but has been opt-in on a per-game and environment variable override basis. For example, glthread with RadeonSI yielded a ~30% boost for Minecraft as just one of many games this Mesa feature has helped in recent years.
This past week Marek opened a merge request providing "lots of cleanups, some CPU overhead improvements" for Mesa and the glthread code. One interesting remark he made there was:
I get 15% better perf with this in one viewperf subtest that is CPU-bound.
In recent months Marek and other AMD Mesa developers have been doing a lot of tuning work for SPECViewPerf and have been making some mighty impressive performance gains for those workstation OpenGL test cases, even with consumer Radeon GPUs.
In addition to those clean-ups, Marek opened another MR with more fixes to the GLThread code and then even enabling it by default for RadeonSI. In there he commented:
These are conformance fixes, synchronization fixes, and changes to allow glthread to be used with all EGL backends (android, device, drm, wayland were missing).
This is the first time that glthread is considered complete, performant, and being enabled by default (only radeonsi).
With this pending code, Mesa's glthread is considered "complete" after many years in the making. There is already whitelisting to enable the glthread functionality for RadeonSI with many games, but this merge request would enable it by default. This is likely to help a number of games and other niche workloads that otherwise weren't vetted previously for whether or not glthread would be beneficial to enabling.
It will be very interesting to see in practice how this OpenGL threading being flipped on unconditionally for RadeonSI works out and what new workloads are discovered to be faster. Currently these merge requests are still undergoing review but hopefully they'll be merged in time for Mesa 22.3 next quarter.