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 Generally Available on Windows 11 via WSL 2. For more information and updated, simpler installation instructions, please see our announcement blog post.
The following is the full, original blog post.
RAPIDS is now more accessible to Windows users! This guide will walk 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 Pascal architecture or newer. Let’s get started right away.
Getting Started
To install RAPIDS you’ll need to do the following:
- Install the latest builds from the Microsoft Insider Program
- Install the NVIDIA preview driver for WSL 2
- Install WSL 2
- Install RAPIDS
Steps 1–3 can be completed by following NVIDIA’s 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 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 once you reach the Setting up CUDA Toolkit section.
Installing the Latest Builds from the Microsoft Insider Program
For your program to run correctly, you’ll 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 & 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 calls 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 ;)
- Once 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):
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. (https://developer.nvidia.com/cuda/wsl)
- 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.
(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 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 <Distribution Name>
. - 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 and check 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.
- 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.
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.