Skip to content

Commit

Permalink
Merge pull request #13163 from ru-fu/LXD-543-gpu-devices
Browse files Browse the repository at this point in the history
Doc: add configuration examples for gpu devices
  • Loading branch information
tomponline authored Mar 15, 2024
2 parents 822a4d4 + 7d7e2ce commit 50d7a54
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions doc/reference/devices_gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@ GPU devices of type `physical` have the following device options:
:end-before: <!-- config group device-gpu-physical-device-conf end -->
```

### Configuration examples

Add all GPUs from the host system as a `physical` GPU device to an instance:

lxc config device add <instance_name> <device_name> gpu gputype=physical

Add a specific GPU from the host system as a `physical` GPU device to an instance by specifying its PCI address:

lxc config device add <instance_name> <device_name> gpu gputype=physical pci=<pci_address>

See {ref}`instances-configure-devices` for more information.

(gpu-mdev)=
## `gputype`: `mdev`

Expand All @@ -62,6 +74,14 @@ GPU devices of type `mdev` have the following device options:
:end-before: <!-- config group device-gpu-mdev-device-conf end -->
```

### Configuration examples

Add an `mdev` GPU device to an instance by specifying its `mdev` profile and the PCI address of the GPU:

lxc config device add <instance_name> <device_name> gpu gputype=mdev mdev=<mdev_profile> pci=<pci_address>

See {ref}`instances-configure-devices` for more information.

(gpu-mig)=
## `gputype`: `mig`

Expand All @@ -85,6 +105,14 @@ GPU devices of type `mig` have the following device options:

You must set either {config:option}`device-gpu-mig-device-conf:mig.uuid` (NVIDIA drivers 470+) or both {config:option}`device-gpu-mig-device-conf:mig.ci` and {config:option}`device-gpu-mig-device-conf:mig.gi` (old NVIDIA drivers).

### Configuration examples

Add a `mig` GPU device to an instance by specifying its UUID and the PCI address of the GPU:

lxc config device add <instance_name> <device_name> gpu gputype=mig mig.uuid=<mig_uuid> pci=<pci_address>

See {ref}`instances-configure-devices` for more information.

(gpu-sriov)=
## `gputype`: `sriov`

Expand All @@ -104,3 +132,11 @@ GPU devices of type `sriov` have the following device options:
:start-after: <!-- config group device-gpu-sriov-device-conf start -->
:end-before: <!-- config group device-gpu-sriov-device-conf end -->
```

### Configuration examples

Add a `sriov` GPU device to an instance by specifying the PCI address of the parent GPU:

lxc config device add <instance_name> <device_name> gpu gputype=sriov pci=<pci_address>

See {ref}`instances-configure-devices` for more information.

0 comments on commit 50d7a54

Please sign in to comment.