https://weblogs.asp.net/dixin/setup-and-use-cuda-and-tensorflow-in-windows-subsystem-for-linux-2
Cuda on WSL Nvidia driver download
Win → Settings → Update and Security → Windows Insider Programs
https://docs.microsoft.com/en-us/windows/wsl/install-win10
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Restart
> wsl uname -r
4.9. 121
If smaller than 121 → > wsl –update
> wsl -l -v
NAME STATE VERSION
* Ubuntu-20.04 Stopped 2
If VERSION is 1 → > wsl –set-default-version 2
Restart wsl to make sure version is updated to 2 → > wsl -t Ubuntu-20.04
> wsl --shutdown
https://developer.nvidia.com/cuda/wsl/download
$ sudo apt update
$ sudo apt -yV upgrade
$ sudo apt -y install python3-dev python3-pip python3-setuptools python3-numpy
wget https://developer.download.nvidia.com/compute/cuda/10.1/Prod/local_installers/cuda_10.1.243_418.87.00_linux.run
sudo sh cuda_10.1.243_418.87.00_linux.run
$ python --version
Python 3.8.5
$ pip3 install torch==1.7.1+cu101 torchvision==0.8.2+cu101 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html