Run RAPIDS on Microsoft Windows 10 Using WSL 2—The Windows Subsystem for Linux

A tutorial to run your favorite Linux software, including NVIDIA CUDA, on Windows RAPIDS is now more accessible to Windows users! This post walks you through installing RAPIDS on Windows Subsystem for Linux (WSL). WSL is a Windows 10 feature that enables users to run native Linux command-line tools directly on Windows. Using this feature … Continued

This post was originally published on the RAPIDS AI Blog.

A tutorial to run your favorite Linux software, including NVIDIA CUDA, on Windows

RAPIDS is now more accessible to Windows users! This post walks you through installing RAPIDS on Windows Subsystem for Linux (WSL). WSL is a Windows 10 feature that enables users to run native Linux command-line tools directly on Windows. Using this feature does not require a dual boot environment, taking away complexity and hopefully saving you time. You’ll need access to an NVIDIA GPU with NVIDIA Pascal architecture or newer. Let’s get started right away.

Getting Started

To install RAPIDS, you’ll need to do the following:

  1. Install the latest builds from the Microsoft Insider Program.
  2. Install the NVIDIA preview driver for WSL 2.
  3. Install WSL 2.
  4. Install RAPIDS.

Steps 1–3 can be completed by following the NVIDIA CUDA on WSL guide. However, there are some gotchas. This article will walk through each section and point out what to look out for. We recommend opening a tab for the guide alongside this post to make sure that you don’t miss anything. Before you start, be aware that all the steps in the guide must be carried out in order. It’s particularly important that you install a fresh version of WSL 2 only after installing the new build and driver. Also note, CUDA toolkit will be installed along with RAPIDS in step 4. Therefore, stop following the CUDA on WSL guide after you reach the Setting up CUDA Toolkit section.

Installing the latest builds from the Microsoft Insider program

For your program to run correctly, you need to be using Windows Build version 20145 or higher. When installing the builds, some things to note are:

  • Start off by navigating to your Windows menu. Select Settings > Update and Security > Windows Update. Make sure that you don’t have any pending Windows updates. If you do, click the update button to ensure you’re starting out without any.
  • Dev Channel (previously Fast ring): Fast ring is mentioned in the guide as the channel you should download your build from. The name of this channel is now the Dev Channel. Windows call the process of updating and installing the latest builds ‘flighting.’ During this process, you must select the DEV Channel when choosing which updates to receive.
  • Downloading and updating requires a restart and can take up to 90mins. Feel free to grab a coffee while you wait ;).
  • After you’ve restarted your computer, check your build version by running winver via the Windows Run command. It can be a little tricky to identify the right number. Here’s what you should look for after a successful installation (BUILD 20145 or higher):
Image of updated Windows 10 OS Build. The build in the image is OS Build 21296.
Figure 1: Build version is now OS Build 21296 which is sufficient to run WSL2.

Once you’ve confirmed your build, move onto step 2.

Installing NVIDIA drivers

Next, you’ll need to install an NVIDIA Driver. Keep the following in mind:

  • Select the driver based on the type of NVIDIA GPU in your system. To verify your GPU type look for the NVIDIA Control Panel in your Start menu. The name should appear there. See the CUDA on Windows Subsystem for Linux (WSL) public preview for more information. 
  • Once the download is complete install the driver using the executable. We strongly recommend choosing the default location for saving it.
  • A check to ensure the driver install was successful is to run the command nvidia-smi in PowerShell. It should output a table with information about your GPU and the driver. You’ll notice the driver version is the same as the one you downloaded.
Image of NVIDIA-SMI table displayed in Windows Powershell. NVIDIA Driver version 465.21 has been correctly installed.
Figure 2: NVIDIA Driver has correctly been installed, version 465.21.

(Your table might be much shorter and not show any GPU processes. As long as you can see a table and no visible errors, your install should have been successful!) If your driver is successfully installed, let’s jump to step 3. If nothing appears, check if you’ve missed any of the steps and if your build version is correct.

Installing WSL 2

Next, you’ll install WSL 2 with a Linux distribution of your choice using the docs here. Make sure that the distribution you choose is supported by RAPIDS. You can confirm this here. The rest of this post describes the installation of WSL 2 with Ubuntu 18.04. These steps should work similarly with other supported distributions.

There are two ways you can install your RAPIDS supporting Linux distribution with WSL 2 on Windows 10. The instructions listed in the Windows guide can seem overwhelming so we’ve distilled it down to the most important parts here:

Using the command line

  • Open your command line and ensure you’re in the Admin role.
  • Find out which Linux distributions are available and support WSL by typing in the command wsl --list -online.
  • To install the distribution, use the command wsl --install -d .
  • For Ubuntu 18.04 this command translated to wsl --install -d Ubuntu-18.04 (be aware of the capital letter U.) This should download and install your Linux distribution.
  • Your selected distribution should either immediately open or appear in your Windows Start menu.
  • If this is not true for you, double-check that your Linux distribution and WSL install was successful by running wsl.exe -list. If no distribution appears, navigate to “Programs” in your Control Panel. Confirm that the “Windows Hypervisor Platform” and “Windows Subsystem for Linux” boxes are checked. It should look something like the image below. Once confirmed, reboot your computer and try running the install again (possibly twice.) Ideally, the WSL terminal should pop up right after the installation.
Image of Windows Features list. Windows Hypervisor Platform and Windows Subsystem for Linux boxes are checked successfully.
Figure 3: In case your WSL terminal install doesn’t work right away, make sure the folders checked preceding are checked on your system as well.
  • When opening your WSL terminal for the first time, you will be prompted to set up a default(non-root) user. Ensure that you do not skip this step, as you will need to be the root user to install other packages.
  • Once you’ve set the default user, proceed to reboot your machine. When you return, you’ll be all set for step 4.

Through the Microsoft Store

  • If you already know which distribution you would like to use, you can download and install it directly from the Microsoft Store on your machine.
  • You’ll need to set the default user and do a reboot in this case as well.

Once you’ve completed this step, you’re ready to install the CUDA Toolkit and almost done!

Install RAPIDS

  • If you don’t have it already, start by installing and activating Miniconda in your WSL terminal. We’ll be using the conda command to install the packages we need in this step.
  • You can install RAPIDS with a single conda command. Just type the following line in and you’re all set.
Type this command into your terminal to install RAPIDS.

To test your installation, start-up the RAPIDS virtual environment. You can do this by:

  • Typing out conda info --envs, which will let you know the name of the installed RAPIDS environment.
  • Note: cuDF is supported only on Linux and with Python versions 3.7 and later.
  • Finally, import any RAPIDS library or start a Jupyter notebook.

Hopefully, your installation was successful. RAPIDS is open-source, so if you managed to get this far and would like to contribute, take another look at the contributing guide of any of our libraries or join the RAPIDS Slack channel to find out more.

Leave a Reply

Your email address will not be published. Required fields are marked *