MicroK8s on NVIDIA DGX

On DGX systems you will need to enable GPU support right after you install MicroK8s:

sudo snap install microk8s --classic
sudo microk8s enable gpu

MicroK8s installs the NVIDIA operator which allows you to take advantage of the GPU hardware available.

Verify the installation

To verify the installation works as expected you can try to perform a CUDA vector addition by applying the following manifest (save this file and use kubectl apply):

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

After the addition completes, check the logs of the cuda-vector-add pod to see if it succeeded.

Multi-Instance GPU (MIG)

Multi-Instance GPU (MIG) allows GPU partitioning so they can be safely used by CUDA applications. Starting from MicroK8s v1.23 MIG can be configured via configMaps, please see the NVIDIA operator docs on this topic.

how can you “apply a manifest”
detailed command is missing, this was not in my assumed prior knowledge pack :wink:

1 Like