Deeper Dive into Windows Subsystem for Linux GUI (WSLg)
In a previous article, I looked at Windows Subsystem for Linux GUI (WSLg), which allows you to seamlessly run Linux graphics programs on Windows 11 systems. In this article, I will take a deeper look at WSLg.
Steve Pronovost, partner development lead on the Compute, Graphics and AI Team at Microsoft, did an excellent job of documenting WSLg: how it came about, its architecture, and the company's philosophy behind it. He also provided an outstanding outline of the WSLg architecture and how WSLg and the Windows 11 system relate to each other (see below).
My biggest takeaway from this outline is that WSLg uses an RDP client to display the Linux graphics in individual windows (like a single application) rather than as RDP-full desktops.
What Is Exposed
To get a better sense for how WSLg works with graphics, I used a Dell Precision 3240 Compact Workstation with an AMD Radeon Pro WX3200 GPU, which was equipped with an Intel Core i5-10500 with 16GB of RAM. The AMD Radeon Pro WX3200 had 4 GB GDDR5 and 640 Stream Processors.
To see how WSL saw the graphics system, I logged on to my WSL Ubuntu instance and entered lshw -C display.
This showed that it had a Microsoft graphics system.
To see if any modules were installed, I entered lsmod and did not find any.
To get a baseline of the graphics system's performance, I installed and ran glmark2 by entering:
apt install glmark2
While glmark2 was running, I monitored the GPU performance using Windows Task Manager. It showed that the AMD GPU reached up to 48 percent utilization.
The overall glmark2 score was 423.
Testing the Performance of Graphics
To get a better idea of how the graphics system performed compared to the host system (Windows 11), I installed and ran the Phoronix test suite be entering:
apt install phoronix-test-suite_10.8.3_all.deb -y --fix-missing
phoronix-test-suite install unigine-heaven
phoronix-test-suite run unigine-heaven
I ran the system in a window (rather than full screen), with a 1920 x 1080 display resolution.
The results came back with an average frame rate of 17.3 when using WSLg.
I ran the same test natively on the Windows 11 system and it had an average frame rate of 43.4.
WSLg is a great way to unify Windows and Linux systems, and, in theory, you can have the best of both worlds. In my casual testing of graphics performance on WSLg, I found that there is an overhead when running graphics applications under it; they ran better directly on the Windows system than under WSLg, which did not surprise me. That said, even I didn't have any issues running demanding graphics-intensive programs under WSLg and its performance would be more than adequate for all casual use cases.
Tom Fenton has a wealth of hands-on IT experience gained over the past 25 years in a variety of technologies, with the past 15 years focusing on virtualization and storage. He currently works as a Technical Marketing Manager for ControlUp. He previously worked at VMware as a Senior Course Developer, Solutions Engineer, and in the Competitive Marketing group. He has also worked as a Senior Validation Engineer with The Taneja Group, where he headed the Validation Service Lab and was instrumental in starting up its vSphere Virtual Volumes practice. He's on Twitter @vDoppler.