Linux/WSL#

Depending on which distribution of Linux you use, the process of installing packages will look slightly different. Select the appropriate distribution below and follow along from there. These instructions also work for the Windows Subsystem for Linux (WSL).

Note

If you’re using Arch Linux or one of its derivatives, we assume you have the yay package manager installed to install dependencies from the AUR.

  1. Update your system’s package manager, then install gcc, git, and Python 3.10.

    $ sudo apt update
    $ sudo apt install build-essential git python3.10
    
    $ sudo pacman -Syu
    $ sudo pacman -S gcc git
    $ yay -S python310
    
  2. If you’re using an NVIDIA GPU, install CUDA Toolkit 11.8 and cuDNN.

    First, install and/or update your GPU drivers at this link. Select your GPU model and click “Search”, then click “Download”. After installing the drivers, reboot your system to ensure they take effect.

    Then, install CUDA Toolkit 11.8. Select your version of Linux, then follow the instructions to install CUDA for your operating system.

    To verify your installation of CUDA, use the following command.

    $ nvcc --version
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2022 NVIDIA Corporation
    Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022
    Cuda compilation tools, release 11.8, V11.8.89
    Build cuda_11.8.r11.8/compiler.31833905_0
    

    Note

    If you run into issues installing CUDA, check out these resources:

    Finally, install cuDNN by following these instructions. Scroll down until you see instructions for your operating system, then follow them. You will need to register an Nvidia Developer account, which you can do for free.

    As of February 2024, the latest version is cuDNN 9.0.0, which is compatible with CUDA 11.8.

  3. Upgrade pip, wheel, setuptools.

    $ python3 -m pip install --upgrade pip wheel setuptools
    
  4. Install wxPython

    $ sudo apt update
    $ apt-get install libgtk-3-dev
    $ sudo apt-get install git curl libsdl2-mixer-2.0-0 libsdl2-image-2.0-0 libsdl2-2.0-0
    $ python3 -m pip install six
    $ python3 -m pip install --upgrade six
    $ python3 -m pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04 wxPython
    
  5. Install LabGym via pip.

    $ python3 -m pip install LabGym
    
  6. Install Pytorch v2.3.1 (Detectron2 needs PyTorch2.3.1 to install).

    $ python3 -m pip install torch==2.3.1
    
  7. Install Detectron2.

    $ python3 -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
    
  8. Install Pytorch v2.0.1 (Detectron2 needs PyTorch2.0.1 to run).

    $ python3 -m pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
    

    If you are using LabGym without a GPU, use the following command instead.

    $ python3 -m pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cpu
    
  9. Launch LabGym.

    $ LabGym
    

    The GUI will take a few minutes to start up during the first launch. If the LabGym GUI shows up, you have successfully installed LabGym!

 

If you use pipx, from step #5:

 

  1. Install pipx by following these instructions.

    To test your installation of pipx, close and reopen your terminal window, then type the following command:

    $ pipx --version
    1.4.3
    

    If the version number prints successfully, then your installation is working properly. Otherwise, try running the pipx ensurepath command again.

  2. Install LabGym via pipx.

    $ pipx install --python python3.10 LabGym
    

    Note

    If you’re on WSL and you run into issues with the installation of wxPython, use this resource to install the necessary dependencies for wxPython. Then, rerun the above command to install LabGym.

  3. Install PyTorch v2.3.1 (Detectron2 needs PyTorch2.3.1 to install) in LabGym’s virtual environment.

    $ pipx runpip LabGym install torch==2.3.1
    
  4. Install Detectron2 in the LabGym’s virtual environment.

    $ pipx runpip LabGym install 'git+https://github.com/facebookresearch/detectron2.git'
    
  5. Install PyTorch v2.0.1 (Detectron2 needs PyTorch2.0.1 to run) in LabGym’s virtual environment.

    $ pipx inject --index-url https://download.pytorch.org/whl/cu118 LabGym torch==2.0.1 torchvision==0.15.2
    

    If you are using LabGym without a GPU, use the following command instead.

    $ pipx inject --index-url https://download.pytorch.org/whl/cpu LabGym torch==2.0.1 torchvision==0.15.2
    
  6. Launch LabGym.

$ LabGym

The GUI will take a few minutes to start up during the first launch. If the LabGym GUI shows up, you have successfully installed LabGym!