docs/doc/source/operations/k8s_gpu_device_plugin.rst
SidneyAn cc14f92647 Add doc for k8s intel gpu device plugin under operations
Patchset 3: reST formatting, minor grammar and capitalization, typo
Patchset 6: minor grammar edits
Patchset 7: Wording updates per feedback

Story: 2005937
Task: 37644

Change-Id: I65c5fd9be894b5de5132af43daba202496b6654e
Signed-off-by: SidneyAn <ran1.an@intel.com>
Signed-off-by: Kristal Dale <kristal.dale@intel.com>
2019-12-16 14:01:33 -08:00

2.4 KiB

Kubernetes Intel GPU Device Plugin Configuration

This document describes how to enable the Intel GPU device plugin in StarlingX and schedule pods on nodes with an Intel GPU.

Enable Intel GPU device plugin

You can pre-install the intel-gpu-plugin daemonset as follows:

  1. Launch the intel-gpu-plugin daemonset.

    Add the following lines to the localhost.yaml file before playing the Ansible bootstrap playbook to configure the system.

    k8s_plugins:
      intel-gpu-plugin: intelgpu=enabled
  2. Assign the intelgpu label to each node that should have the Intel GPU plugin enabled. This will make any GPU devices on a given node available for scheduling to containers. The following example assigns the intelgpu label to the compute-0 node.

    $ NODE=compute-0
    $ system host-lock $NODE
    $ system host-label-assign $NODE intelgpu=enabled
    $ system host-unlock $NODE
  3. After the node becomes available, verify the GPU device plugin is registered and that the available GPU devices on the node have been discovered and reported.

    $ kubectl describe node $NODE | grep gpu.intel.com
    gpu.intel.com/i915:  1
    gpu.intel.com/i915:  1

Schedule pods on nodes with Intel GPU

Add a resources.limits.gpu.intel.com to your container specification in order to request an available GPU device for your container.

...
spec:
  containers:
    - name: ...
      ...
      resources:
        limits:
          gpu.intel.com/i915: 1

The pods will be scheduled to the nodes with available Intel GPU devices. A GPU device will be allocated to the container and the available GPU devices will be updated.

$ kubectl describe node $NODE | grep gpu.intel.com
gpu.intel.com/i915:  1
gpu.intel.com/i915:  0

For more details, refer to the following examples: