Docker Desktop (Windows host) with GPU(s) enabled

This post has two parts: 1) my success so far with the Fast.ai docker image (with the Dockerfile I wrote), and 2) questions for developers for usage with Jupyter on Windows.

Part 1

HW Specs:
AMD Ryzen 9 5950X, RTX 3070 8GB VRAM, Samsung NVMe (system drive), 64GB DDR4 RAM.
SW Environment:
Windows 11, WSL2 with Ubuntu 20.04, Docker Desktop v20.10.13

Base Docker images used:

consol/centos-xfce-vnc:1.1.0
nvidia/cuda:11.6.0-base-ubuntu20.04
fastdotai/fastai-course:latest

Dockerfile

FROM consol/centos-xfce-vnc:1.1.0
LABEL Tobias Schneck "tobias.schneck@consol.de"
ENV REFRESHED_AT 2017-04-10

USER 0
FROM nvidia/cuda:11.6.0-base-ubuntu20.04
CMD nvidia-smi

FROM fastdotai/fastai-course:latest
USER 1984

To build image, create/run container, and launch Jupyter Notebook, type the following commands in a Windows PowerShell session (make sure to replace the fields denoted by “{}”):

cd {./path/to/Dockerfile}
docker build . -t {image-name}
docker run -it --name {container-name} --user 0 --gpus all -p 5901:5901 -p 6901:6901 -p 8888:8888 {image-name} ./run_jupyter.sh

Ctrl+LMB on the last displayed link (you might need to wait a couple minutes before your browser will connect properly)

Part 2

So I was able to get everything to work up to the last step above. What tripped me up, is when I tried to run one of the Fast-ai notebooks and got that multiprocessing error which happens while using Jupyter on Windows. It appears that the “Worker Count” was not automatically set to “0” as expected. Is there a way to manually do this so I can still run the course notebooks? Thanks!

Update on March 17, 2022

Problem solved! All I had to do is set the keyword argument “num_workers” to “0” as part of the data loaders setup.