Steps:
- Install Ubuntu in WSL
wsl --install Ubuntu
- Open Ubuntu prompt.
- Run
sudo apt update && sudo apt upgrade -y
- Install CUDA Toolkit (https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_network)
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb
sudo dpkg -i cuda-keyring_1.0-1_all.deb