Skip to content

Windows Docker Instruction

Minh Tram edited this page Aug 18, 2022 · 4 revisions

Download and install Docker Desktop for Windows. You will be asked to log out to complete the installation.

After installation is completed, enable Docker Backend for WSL 2.

Once completed, verify Ubuntu have access to docker commands.

wsl-user@host:~$ docker --version
Docker version 20.10.17, build 100c701

You would probably want to test NVIDIA accessibility, if applicable.

wsl-user@host:~$ docker run --rm --gpus all nvidia/cuda:11.0.3-base-ubuntu20.04 nvidia-smi
Unable to find image 'nvidia/cuda:11.0.3-base-ubuntu20.04' locally
11.0.3-base-ubuntu20.04: Pulling from nvidia/cuda
d7bfe07ed847: Pull complete
75eccf561042: Pull complete
191419884744: Pull complete
a17a942db7e1: Pull complete
16156c70987f: Pull complete
Digest: sha256:57455121f3393b7ed9e5a0bc2b046f57ee7187ea9ec562a7d17bf8c97174040d
Status: Downloaded newer image for nvidia/cuda:11.0.3-base-ubuntu20.04
Thu Aug 18 03:32:19 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 516.94       CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  Quadro P4000        On   | 00000000:01:00.0  On |                  N/A |
| 49%   49C    P0    30W / 105W |   1702MiB /  8192MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+

This may have an impact on ROS depending on your usage. See ROS (Docker) Hardware Acceleration.

Now is also a good time to define Docker resources, defined by .wslconfig under your user directory on Windows. See Advanced settings configuration in WSL. Mine is placed at C:\Users\my_user_name\.wslconfig and looked something like this:

[wsl2]

# How much memory to assign to the WSL 2 VM.
# Default to 50% of total memory on Windows or 8GB, whichever is less;
# on builds before 20175: 80% of your total memory on Windows
memory = 16GB

# How many processors to assign to the WSL 2 VM.
# Default is the same number of processors on Windows
processors = 6

You would need to restart WSL backend for this to take effect, simply shut it down and reopen another WSL terminal.

user@host:~$ wsl --shutdown

Verify your RAM and CPU count are correct. Choose your processor count wisely depending on your specific usage.

You can now continue to Repository Setup.