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.
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
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:
CUDA Installation Documentation (these instructions are for the latest version of CUDA, so make sure to refer to the previous link for instructions specific to CUDA 11.8)
Detailed instructions for Ubuntu (ignore the PyTorch installation instructions at the bottom, as LabGym requires specific versions of PyTorch specified below)
Detailed instructions for WSL (ignore the TensorRT and Python packages instructions at the bottom)
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.
Upgrade
pip,wheel,setuptools.$ python3 -m pip install --upgrade pip wheel setuptools
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
Install LabGym via
pip.$ python3 -m pip install LabGym
If you want to use LabGym Detector function:
6.1. Install Detectron2.
$ python3 -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
6.2. Install Pytorch v2.0.1 with CUDA 11.8.
$ 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
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 this doesn’t work, which typically is because the python3/script is not in your environment path. You can google ‘add python3 script to path linux’ to add it to path, or simply use the following commands to initiate LabGym:
$ python3
>>> from LabGym import __main__
>>> __main__.main()
If you use pipx, from step #5:
Install
pipxby 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 ensurepathcommand again.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.
If you want to use LabGym Detector function:
7.1. Install Detectron2 in the LabGym’s virtual environment.
$ pipx runpip LabGym install 'git+https://github.com/facebookresearch/detectron2.git'
7.2. Install PyTorch v2.0.1 with CUDA v11.8.
$ 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
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!