GPU Kubernetes support: how to enable?

Official documentation on enabling GPU support states:

Special alpha functions. Accelerators must be set to true system: --feature-gates = "Accelerators = true".

I am having a problem decrypting the "system-wide set to true" part.

I found that kubelet , kube-apiserver and kube-controller-manager are all options for the -feature-gate parameter. The spec states that they all listen for changes in the config file.

Any help on where these config files are, how can I include the -feature-gates = "Accelerators = true" parameter in them?

I tried to add the parameter / etc / kubernetes / manifests / kube -apiserver.yaml: Specification:

  containers:
  - command:
    - kube-apiserver
    - -- <...>
    - --feature-gates=Accelerators=true

      

However, this causes kube-apiserver to stop and never return.

In the end, I found the following workaround here :

3.I Add GPU support to Kubeadm config while the cluster is not initialized. This needs to be done for every node in your cluster, even if some of them don't have GPUs.

sudo vim / etc / systemd / system / kubelet.service.d / <> -kubeadm.conf So add ExecStart with the --feature-gates = "Accelerators = true" flag, so it will look like this:

ExecStart = / usr / bin / kubelet $ KUBELET_KUBECONFIG_ARGS [...] --feature-gate = "Boosters = true" 3.II Restart kubelet

sudo systemctl daemon-reload sudo systemctl restart kubelet

However, I believe the above approach is not how the Kubernetes developers planned to enable this feature. Any help would be appreciated.


[Edit] I was able to enable the option on both the api-server and dispatcher-dispatcher - neither gave the desired gpu result getting visible.

So this is the kubelet service that should receive this option.

The question arises: how to configure the parameter through the kubelet config file?

+3


source to share


3 answers


I am using Ubuntu16.04.



Add --feature-gates="Accelerators=true"

up KUBELET_ARGS

in the file /etc/kubernetes/kubelet

should be fine.

+3


source


If you are using kops

your k8s to run you can use this instruction: https://github.com/kubernetes/kops/blob/master/docs/gpu.md

It basically comes down to editing your cluster kops edit cluster gpu.example.com

And adding a specific config to allow gpu to be handled on kubelet spec: ... kubelet: featureGates: Accelerators: "true"



Then you need to update your cluster and do the upgrade so that all nodes use the new kubelet configuration.

When scanning clusters, you can check if the function gateway flag is enabled on kublet and deploy modules using GPU.

+1


source


You will logically need GPU support on the nodes. This means the correct place is kubelet or node config.

The spider cube is not good for this.

Once enabled, "Nodes will automatically detect and display all Nvidia GPUs as a scheduled resource."

0


source







All Articles