Installation

👉 Ref: Main tutorial from Microsoft.

# Eanble Windows Subsystem for Linux
# PowerShell as Admin
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

# Enable Virtual Machine Platform (for WSL2)
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

# restart required
# Download and install WSL2 Linux kernel update package for x64 machines
<https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi>
# Set WSL2 as default version
# PowerShell as Admin
wsl --set-default-version 2
# Go to Windows Store
# Choose a Linux Distro and install it

# After installing, run Ubuntu app from Start menu
# Follow the instruction on screen

# Update system
sudo apt update
sudo apt upgrade # be careful, it takes time!

# Install dependencies (it takes time)
sudo apt-get install git-core curl wget fontconfig zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev

👉 Note: Linux 👉 Note: Fresh Ubuntu / Pop!_OS Installation 👉 Note: Bash (Unix Shell)

Location

Terminal?

I use cmder. Read more in this note.

Docker + GPU + WSL

  1. Make WSL2 recognize GPU on Windows 10 👉 Check this tut with some remarks:
  2. Microsoft's: Enable TensorFlow with DirectML in WSL 2. Note that, you have to use the version of python look like exactly in the guide (mine, it's 3.6), otherwise, it won't work!
# check if gpu available with docker on wsl2
docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark

# should see something like this
> Windowed mode
> Simulation data stored in video memory
> Single precision floating point simulation
> 1 Devices used for simulation
GPU Device 0: "GeForce GTX 1070" with compute capability 6.1

> Compute 6.1 CUDA device: [GeForce GTX 1070]
15360 bodies, total time for 10 iterations: 11.949 ms
= 197.446 billion interactions per second
= 3948.925 single-precision GFLOP/s at 20 flops per interaction

👉 Check some tests in this section.