WSL lets linux system to run in windows machine. For this tutorial we will focus on Ubuntu linux distribution. To learn more about WSL please visit- https://learn.microsoft.com/en-us/windows/wsl/about
First start by installing Nvidia Drivers, Cuda toolkit and CUDNN in windows before procedding to WSL Ubuntu.
https://visualstudio.microsoft.com/downloads/
Download the latest CUDA toolkit that's compatable to your device.
Make sure to select custom only CUDA runtime option
From the top options - select cuda expand the selection item.
Continue to select Runtime, Documentation and Development from the submenu
After the installer is done with installation. Open the installer again and select the remaining packages. Including Nsight VSE, Visual Studio Integration,Nsight Systmens and Nsight Compute from the submenus as shown below.
https://developer.nvidia.com/cudnn
Once done with the download install cuDNN in Express (Recommended) mode.
After all the installations are finished, you can see the cudNN library version and status for each installs.
To check NVIDIA Drivers are properly installed
- Open Command Line Windows(CMD) and type
nvdia-smi
- Open Command Line Windows(CMD) and type
To check NVIDIA CUDA compiler (cudnn)
nvcc -V
If running these comands does not output somthing similar to the pictures show, then the installation did not succeed. You will need to uninstall all NVIDIA drivers and packages, restart your computer and try again.
Open Windows Power shell. Type the following command to install Ubuntu distribution.
wsl --install -d Ubuntu
When the installation is finished, reboot your computer and open wsl. At this stage, you will need to provide a user name and a password. Once the operation is completed you will see a welcome message as shown below.
Download miniconda using wget command
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
use bash command to run the miniconda installer
bash Miniconda3-latest-Linux-x86_64.sh
Press enter until the end of the use agreement to install miniconda. Once the installation is completed restart wsl.
sudo apt update && sudo apt upgrade
sudo apt install ubuntu-drivers-common
sudo apt install nvidia-cuda-toolkit
nvcc –V
Now you can install different python libraries using condaor pip
Possible issues you may come across during installation
- Activating base envirnoment
source /home/"your username”/miniconda3/etc/profile.d/conda.sh
Conda activate “your virtual environment name”
In this case you might want to activate the base virtual envirnoment - please refer https://stackoverflow.com/a/64815977









