How to install Ubuntu Linux and run Jupyter Notebook on Windows 11 (with CUDA!)

Dual-booting Windows 10/11 and Ubuntu is still the preferred method for power users, but for regular folk like me I think using the new WSL (Windows Subsystem for Linux) is totally serviceable. It makes it so much easier to multi-task since you can operate within both ecosystems at the same time. I tried a number of different methods to get everything running online (mainly trying to figure out CUDA), but nothing worked. I finally found these steps to work. This assumes you already have Windows 11 and Windows CUDA drivers installed….

  1. Install WSL from Windows Store (see here: https://docs.microsoft.com/en-us/windows/wsl/install) Does not appear to work correctly from terminal. Must use Store.
  2. Install Ubuntu from Windows Store
  3. sudo apt update && sudo apt upgrade -y # upgrades Ubuntu
  4. sudo apt install python3-pip python3-dev # Installs pip and python header files
  5. sudo -H pip3 install –upgrade pip # Upgrades pip to latest version. -H flag ensures security policy sets the home environment variable to the home directory of the target user
  6. sudo -H pip3 install virtualenv # Installs virtualenv
  7. mkdir ~/PROJ # makes project directory
  8. cd ~/PROJ # changes to the project directory
  9. virtualenv asdf # creates a directory called “asdf” within ~/PROJ, installs a local version of Python and a local version of pip.
  10. source asdf/bin/activate # activates the environment, will change the prompt to show that you’re in
  11. pip install jupyter # Installs Jupyter. Note that the local version of pip3 is called “pip” in the virtual environment.
  12. jupyter notebook # runs the jupyter notebook
  13. nvidia-smi # From bash, test your GPU and see CUDA version

Leave a Reply

Your email address will not be published.