At the Microsoft Build 2020 event, the Microsoft announced some examples of Linux GUI applications running on Windows 10, thanks to WSL2 support. At the time, the company also announced that it intended to add GPU support to Windows Subsystem for Linux 2 (WSL2).
Today, almost a month later, Microsoft announced the first test version with GPU support in a Linux environment via WSL2. However, for now, this feature is only available to users on Windows Insiders program.
To make the new support possible, Microsoft was forced to integrate GPU virtualization technology into WDDM (Windows Display Driver Model). In other words, the company added DirectX in the Linux environment of WSL2.
However, because GPU support is trial-and-tested, WSL2 currently only supports CUDA-enabled NVIDIA GPUs and DirectML API for all DirectX 12 GPUs, regardless of manufacturer. According to the company, support for the rest of the GPUs a second phase will be added.
Although in its infancy, GSU support within WSL2 allows the use of various applications, such as ML tools, various libraries, and frameworks, such as PyTorch and TensorFlow. This means that we will now be able to use TensorFlow with DirectML packages, inside Linux environment, for various activities such as mechanical learning.
How to use the new WSL2 feature?
If you want to use the new WSL2 services, you must first be a member Windows Program insider. In case you are not, you must first register, and then install the latest available Windows Insider distribution.
Next, you'll need to install Windows Subsystem for Linux 2, as well as a Linux distribution on Windows 10. All you have to do now is activate the new service by following it. official guide of Microsoft.