In September 2020, NVIDIA announced native CUDA features on Windows Subsystem for Linux (WSL2) in the last version of the preview driver, which motivated me to write this post.

I will explain how to install NVIDIA Driver on WSL2 (Microsoft Subsystem Linux) and test TensorFlow’s parallel execution.

Some of the main changes are:

  • Improving the experience in the performance of CUDA users
  • TensorFlow with DirectML API support for DirectX 12 based GPU acceleration
  • Support for PTX JIT will enable us to run parallel execution (PTX) code.

Setup

Until Microsoft Windows build 20145 is not available to the general public, to use GPU on WSL version 2, you will need to do the following:

  1. Activate the Microsoft Insider Program
  2. Check your Windows Subsystem for Linux (WSL) version.
  3. Sign In or Create an account in NVIDIA Developer
  4. Download and Install the NVIDIA Driver
  5. Test GPU usage by WSL2

Checking your current Microsoft Build

Previous to activate the Microsoft Insider program, we will check if the required build is available. To do that, first, go to Check for Updates and verify that you have the last updates.

Image for post

Image of Check for Updates, Microsoft Windows

Image for post

Image of Windows Update, Microsoft Windows

The next step is to go to About your PC and verify the OS build in the Windows Specifications.

Image for post

Image of About your PC, Microsoft Windows

Image for post

Image of About your PC, Microsoft Windows

If you are in a build greater than **20145, **then you can skip the next section.

#nvidia-driver #gpu #tensorflow #wsl-2

WSL2 / NVIDIA GPU Driver for DirectML and Tensor Flow
10.50 GEEK