You need to have a working Linux installation (Unix) for this class. There are primarily three ways you can get Linux:

  • MacOS. Oh yeah, native support out of box. The M1-chip MBA is my main-hand weapon for research.
  • Dual boot your laptop to run Linux along with Window. This requires some BIOS hacking skills. If you get it work, it will save lots of installation troubles. However, I don’t have many instructions on this approach since different computers come with different BIOS. In this case, Google is your friend who may help you get this done. If you choose to go this route, please choose Ubuntu 20.04.
  • Linux on Windows via WSL2. As a virtual machine solution, WSL2 really suprises me with its undiscounted performance.

Note that even though a virtual machine (like VMbox) can technically work, with the great performance cost, it is barely usable for deep reinforcement learning development.

If you choose WSL2 - Windows 10 Linux Subsystem

Follow the instructions here:

https://docs.microsoft.com/en-us/windows/wsl/install-win10

Remember to install WSL2 not 1, and use the distro version as Ubuntu 20.04 LTS.

  • I used the simplified approach. It is much easier but need some patience to wait for Windows update. Plus, the bonous is that you can enjoy Windows 11 earlier.
  • When choosing the channel in Windows Insider Program, select the Dev Channel.

Post-WSL2 Installation

Install Windows Terminal HERE.

Run this command in your Ubuntu to install the necessary packages:

sudo apt update

Install X server for GUI apps:

  • Download VcXsrv and install
  • In bash run “export DISPLAY=:0” Now when you run it you should get a display to pop-up, there may be issues related to graphics drivers. Sadly, this is where the instructions diverge if you don’t have an NVIDIA graphics card.
  • Locate the XLaunch shortcut in the Start Menu, and click it
  • Install GLUT with sudo apt-get install freeglut3-dev
  • Run this command export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
  • Go to Windows Security -> Firewall & network protection -> Allow an app through firewall. Make sure VcXsrv has both public and private checked.
  • Launch VcXsrv with “Disable access control” ticked
  • To test if the X server installation is successful,
    • Install xeyes by running sudo apt install x11-apps.
    • Open terminal and run xeyes.
    • If the installation is good, you should see a pair of eyes pop up. If not refer to this document for troubleshooting. Kudos to Sam Dickinson who put together this doc.

Bookmark (Pin to Quick Access) the Ubuntu folder in your Windows File explorer. Instruction HERE

Leveraging GPU on WSL2

Deep learning requires tons of GPU horse power. If you wish to fully leverage the magic of WSL2, you can follow the links below to enable NVIDIA support on WSL2. However, I will make this optional. Without GPU support, you can still run the programs but with 2X waiting time.

You can choose to follow one of the tutorials below. If you encountered any problem, feel free to refer to other tutorials.

Enable NVIDIA CUDA in WSL 2

Getting started with CUDA on Ubuntu on WSL 2

Updating the WSL 2 Linux kernel

Get CUDA Driver for WSL 2

Select the driver (Quadro or GeForce) based on your device. Ensure you have received updates for other Microsoft products when you update Windows enabled. You can find it in Advanced options within the Windows Update section of the Settings app.