NVIDIA's CUDA computing platform is now available on WSL



With the latest version of Windows 10 Insider Preview released on June 17, 2020, 'Build 20150',

WSL supports NVIDIA's computing platform ' CUDA '. With this enhancement, it is possible to run calculation software and specialized tools compatible only with Linux on WSL.

Announcing CUDA on Windows Subsystem for Linux 2 | NVIDIA Developer Blog
https://devblogs.nvidia.com/announcing-cuda-on-windows-subsystem-for-linux-2/

WSL1 provided Linux applications via a program called 'LXCore', so some Linux applications could not work. On the other hand, from the latest version of WSL2, it is possible to run most Linux applications by running an actual Linux kernel on Hyper-V . With WSL2 and GPU paravirtualization technology 'GPU-PV', GPU calculation on WSL such as DirectX support was realized.



To enable CUDA with WSL, you must first install the latest version of Windows 10 Insider Preview, 'Build 20150', on a PC with NVIDIA's GPU. In addition, it is necessary to install NVIDIA's

preview GPU driver compatible with WDDM 2.9 in the host OS and use WSL2. The kernel driver 'dxgkrnl' for DirextX normally used in Windows and the kernel driver 'dxgkrnl' for Linux are connected by VM Bus, and the virtualized GPU is via the device file '/dev/dxg'. It is exposed from the WSL kernel space to the user space. The CUDA driver 'libcuda' uses the GPU via the shared library 'libdxcore'.



Below is how

TensorFlow , a machine learning library, is running on WSL. The word 'Geforce GTX 1070' can be seen in the red frame at the bottom left of the WSL terminal. NVIDIA will actively work on a project to operate CUDA on WSL and make adjustments. In addition, NVIDIA commented that it will reduce the performance degradation caused by GPU-PV as much as possible.



In addition to CUDA support by WSL,

NVIDIA also announced WSL support of ' NVIDIA Container Toolkit ' that enables GPU of host OS in Docker container. This allows the GPU to be used in Docker containers running on WSL. The 'libnvidia-container' library detects libdxcore and incorporates it into the container together with the CUDA library.



An image of N body simulation executed on Docker container on WSL is also released, and you can see the red letters ``GeForce GTX 1070'', so you can see that the GPU is passed through from the host OS to WSL and Docker container I will.



You can check the source code of the Linux kernel for WSL2 in the preview stage including the dxgkrnl driver from the following.

microsoft/WSL2-Linux-Kernel at linux-msft-wsl-4.19.y
https://github.com/microsoft/WSL2-Linux-Kernel/tree/linux-msft-wsl-4.19.y

in Software,   Hardware, Posted by darkhorse_log