intel-device-plugins-for-ku.../cmd/gpu_plugin/README.md
Mikko Ylinen fd631fc31c deployments/gpu_plugin: limit host mounts
The default deployment gives rather wide host mounts. We can limit
the mounts only to the subdirectories the plugin needs and mount
them read-only.

Also, add notes that both QAT and GPU plugins can be run as non-root
user.

Fixes: #228

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2019-12-11 12:54:36 +02:00

2.0 KiB

Build and test Intel GPU device plugin for Kubernetes

Get source code:

$ mkdir -p $GOPATH/src/github.com/intel/
$ cd $GOPATH/src/github.com/intel/
$ git clone https://github.com/intel/intel-device-plugins-for-kubernetes.git

Verify kubelet socket exists in /var/lib/kubelet/device-plugins/ directory:

$ ls /var/lib/kubelet/device-plugins/kubelet.sock
/var/lib/kubelet/device-plugins/kubelet.sock

Deploy GPU device plugin as host process for development purposes

Build GPU device plugin:

$ cd $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes
$ make gpu_plugin

Run GPU device plugin as administrator:

$ sudo $GOPATH/src/github.com/intel/intel-device-plugins-for-kubernetes/cmd/gpu_plugin/gpu_plugin
device-plugin start server at: /var/lib/kubelet/device-plugins/gpu.intel.com-i915.sock
device-plugin registered

Deploy GPU device plugin as a DaemonSet:

Build plugin image

$ make intel-gpu-plugin

Create plugin DaemonSet

$ kubectl create -f ./deployments/gpu_plugin/gpu_plugin.yaml
daemonset.apps/intel-gpu-plugin created

Note: It is also possible to run the GPU device plugin using a non-root user. To do this, the nodes' DAC rules must be configured to device plugin socket creation and kubelet registration. Furthermore, the deployments securityContext must be configured with appropriate runAsUser/runAsGroup.

Verify GPU device plugin is registered on master:

$ kubectl describe node <node name> | grep gpu.intel.com
 gpu.intel.com/i915:  1
 gpu.intel.com/i915:  1

Test GPU device plugin:

  1. Build a Docker image with an example program offloading FFT computations to GPU:

    $ cd demo
    $ ./build-image.sh ubuntu-demo-opencl
    

    This command produces a Docker image named ubuntu-demo-opencl.

  2. Create a pod running unit tests off the local Docker image:

    $ kubectl apply -f demo/intelgpu-job.yaml
    
  3. Review the pod's logs:

    $ kubectl logs intelgpu-demo-job-xxxx