Add-on: gpu

This addon enables NVIDIA GPU support for MicroK8s.

microk8s enable gpu

Note that this is obviously dependent on the host system having suitable
NVIDIA GPU hardware and the relevant drivers.

With the GPU addon enabled, workloads can request the GPU using a limit
setting, nvidia.com/gpu: 1 . For example:

apiVersion: v1
kind: Pod
metadata:
  name: cuda-vector-add
spec:
  restartPolicy: OnFailure
  containers:
    - name: cuda-vector-add
      image: "k8s.gcr.io/cuda-vector-add:v0.1"
      resources:
        limits:
          nvidia.com/gpu: 1
1 Like

You should mention in the documentation that the runtime needs to be docker not containerd and therefore one should change the kubelet container runtime to docker like this:

Modify /var/snap/microk8s/current/args/kubelet:
–container-runtime=docker
–container-runtime-endpoint=${SNAP_COMMON}/run/docker.sock

@geosp what MicroK8s version are you using? It has been some time since docker was removed in favor of containerd.