AI: Deep Learning 02

https://weblogs.asp.net/dixin/setup-and-use-cuda-and-tensorflow-in-windows-subsystem-for-linux-2

Tensorflow 2

Cuda on WSL Nvidia driver download

Perparation

  1. Turn Windows features on
  1. Participate in the Windows 10 Insider Program
  1. Install Windows terminal
  1. Install WSL2

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
> 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

  1. Install NVIDIA graphics driver
> wsl --shutdown

https://developer.nvidia.com/cuda/wsl/download

  1. Update wsl
$ sudo apt update
$ sudo apt -yV upgrade
  1. Get python development files
$ sudo apt -y install python3-dev python3-pip python3-setuptools python3-numpy
  1. Install NVIDIA CUDA toolkit
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
  1. Install pyTorch
$ 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