Skip to content

(beta) Windows & Docker on WSL2 Setup Instructions

Allen Lee edited this page Sep 27, 2022 · 1 revision

The setup described in this wiki is for beta use in the multianimal branch.

NVIDIA GPUs have recently become available to Docker applications on Windows via WSL2. APT backend development and maintenance can potentially be simplified by standardizing on a Docker-based backend where possible.

Microsoft Windows

A recent version of Windows 10 or 11 is required.

Note: in some of the external documentation linked here, Windows 10 support is described as requiring technical previews or development releases. This should no longer be the case; an ordinary Windows 10 installation should work fine provided it is fairly up-to-date.

Note: The backend setup described here has not yet been tested on Windows 11.

NVIDIA Driver

Install the latest NVIDIA Driver appropriate for your card and system.

CUDA on WSL contains some additional information.

Install/Upgrade WSL

Install WSL on your Windows system. See also Install Linux on Windows with WSL.

The default Linux distribution (Ubuntu) will work with APT.

If you had already been using WSL 1 on your system, you may need to set your default WSL version.

As mentioned in the linked docs, do not install a Linux NVIDIA GPU driver within WSL2. The Windows NVIDIA Driver you already installed is virtualized within WSL2.

Similarly there should be no need to install an NVIDIA CUDA toolkit as the APT Docker image supplies its own CUDA runtime.

Docker Desktop

Install Docker Desktop and enable the WSL2 backend according to the instructions in the link.

(The Linux kernel update package prerequisite is probably unnecessary unless you are migrating/upgrading from an older Windows version.)

You can test NVIDIA GPU support in your Docker installation by running the following docker command, either in a Windows shell or a WSL2 Ubuntu shell: docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark

Start APT and Configure Backend

  • Start APT in MATLAB as usual, with StartAPT or lObj = StartAPT;
  • Load a project.
  • Under Track> GPU/Backend Configuration, select Docker.
  • Test your Docker installation by selecting Track> GPU/Backend Configuration> Test backend configuration. This will perform some tests to ensure that your Docker installation will work with APT.
  • If all tests pass, then you are good to go with training and tracking in APT with your local GPU(s)!
Clone this wiki locally