# Enable GPU machines

Procedure: Enable GPU machines

To configure and enable GPU machines for your Datalore On-Premises instance, do the following:

Docker deployment:

In the `agents-configs.yaml` file, modify the [agent configuration](configure-docker-agents.html) by adding the following parameters:

```YAML
[[[privileged|#privileged]]]: true
deviceRequests:
  - driver: "nvidia"
    [[[count|#count]]]: <number-of-devices>
    [[[deviceIds|#device-ids]]]:
      - "<device-id-1>"
      ...
    [[[capabilities|#capabilities]]]: [["gpu"]]
```

Reference

`privileged`
: Boolean
:
:
:
: Allows the Datalore container to run in privileged mode.

`count`
: Integer
:
:
:
: (Optional) Number of GPU devices to reserve, provided the host has that many available.
:
:
:
: > **Note:**
: > `count` is mutually exclusive with [deviceIds](#device-ids). Specify either `count` or `deviceIds`, but not both.
: >
: >
: >
: > To reserve all GPU devices on the host, omit both `count` and `deviceIds`.

`deviceIds`
: List of strings
:
:
:
: (Optional) List of GPU device IDs from the host.
:
:
:
: > **Tip:**
: > You can find the device ID in the output of the nvidia-smi interface on the host.
:
:
:
: > **Note:**
: > `deviceIds` is mutually exclusive with [count](#count). Specify either `count` or `deviceIds`, but not both.
: >
: >
: >
: > To reserve all GPU devices on the host, omit both `count` and `deviceIds`.

`capabilities`
: List of lists of strings
:
:
:
: (Required) Capabilities to be requested.
:
:
:
: `[["gpu"]]` requests GPU machines.

> **Tip:**
> To learn more about enabling GPU access to service containers, see [Run Docker Compose services with GPU access](https://docs.docker.com/compose/how-tos/gpu-support/) in the official Docker documentation.

Kubernetes deployment:

1. [Prepare your GPU nodes](https://github.com/NVIDIA/k8s-device-plugin#quick-start).

2.

In the `datalore.values.yaml` file, edit the [agent configuration](configure-agents-helm-installation.html) as shown in the following example:

```YAML
...
resources:
  limits:
    [[[nvidia.com/gpu|#gpu]]]: <number-of-devices>
```

Reference

`nvidia.com/gpu`
: Integer
:
:
:
: Number of GPUs the container can use.
:
:
:
: Example: `1`

