# Installation

## :minidisc: Installing SLM Lab

Clone the repository:

```bash
git clone https://github.com/kengz/SLM-Lab.git
```

Install the dependencies:

```bash
cd SLM-Lab/
./bin/setup
```

This runs a prepared bash script with the necessary setup steps, with Python dependencies managed through Conda. Refer to the [Help](/slm-lab/v4.2.0/resources/help.md) page if you encounter issues.

{% hint style="info" %}
Readers of the book:book:*Foundations of Deep Reinforcement Learning:* please see [this custom instruction page](/slm-lab/v4.2.0/publications-and-talks/instruction-for-the-book-+-intro-to-rl-section.md).
{% endhint %}

### Alternative Installations

#### Windows

The best way to run SLM Lab on Windows is to use a Bash shell/Linux subsystem. Credit to [**@vladimirnitu**](https://github.com/vladimirnitu) and [**@steindaian**](https://github.com/steindaian) for providing a detailed instruction PDF for doing so on Windows:

{% file src="/files/-MaZOQIKoLZkL95-PQnt" %}
SLM Lab for Windows (Instruction PDF)
{% endfile %}

#### Google Colab/Jupyter Notebook

Although we do not recommend running SLM Lab on Google Colab or Jupyter notebooks (notebooks come with inherent limitations, e.g. no rendering/multi-processing), we have prepared an example notebook for illustration. Credit to [**@piosif97**](https://github.com/piosif97) for helping with this:

{% hint style="info" %}
[SLM Lab Colab notebook](https://gist.github.com/kengz/6fd52a902129fb6d4509c721d71bda48)
{% endhint %}

For details on how it works, refer to [this Help section](https://slm-lab.gitbook.io/slm-lab/resources/help#google-colab-jupyter-setup).

## :desktop: Hardware Requirements

Non-image based environments can run on a laptop. Only image based environments such as the Atari games benefit from a GPU speedup. For these, we recommend 1 GPU and at least 4 CPUs. This can run a single Atari `Trial` consisting of 4 `Sessions`.

For desktop, a reference spec is GTX 1080 GPU, 4 CPUs above 3.0 GHz, and 32 GB RAM.

For cloud computing, start with an affordable instance of [AWS EC2 `p2.xlarge`](https://aws.amazon.com/ec2/instance-types/p2/) with a K80 GPU and 4 CPUs. Use the Deep Learning AMI with Conda when [creating an instance](https://aws.amazon.com/getting-started/tutorials/get-started-dlami/).&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://slm-lab.gitbook.io/slm-lab/v4.2.0/setup/installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
