You can create vGPUs for your virtual machines (VMs) using supported GPU cards. Refer to your hardware vendor’s documentation for functionality and support details.
You can use the NVIDIA GPU Operator to manage vGPUs for your virtual machines (VMs) on the cluster nodes. You must add these devices to the HyperConverged custom resource (CR) so that OKD Virtualization can discover and make them available to virtual machines.
A mediated device is a physical device that is divided into one or more virtual devices. vGPUs are a type of mediated device (mdev) where the performance of the physical GPU is divided among the virtual devices. You can assign mediated devices to one or more virtual machines (VMs), but the number of guests must be compatible with your GPU. Some GPUs do not support multiple guests.
Adding kernel arguments to enable the IOMMU driver
You must enable the Input-Output Memory Management Unit (IOMMU) driver before you can configure mediated devices. To enable the IOMMU driver in the kernel, create the MachineConfig object and add the kernel arguments.
Prerequisites
-
You have cluster administrator permissions.
-
Your CPU hardware is Intel or AMD.
|
|
Enabling IOMMU is not required on s390x architecture.
|
-
You enabled Intel Virtualization Technology for Directed I/O extensions or AMD IOMMU in the BIOS.
-
You have installed the OpenShift cli (oc).
Procedure
-
Create a MachineConfig object that identifies the kernel argument. The following example shows a kernel argument for an Intel CPU.
apiVersion: machineconfiguration.openshift.io/v1
kind: MachineConfig
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: 100-worker-iommu
spec:
config:
ignition:
version: 3.2.0
kernelArguments:
- intel_iommu=on
# ...
-
metadata.labels.machineconfiguration.openshift.io/role specifies that the new kernel argument is applied only to worker nodes.
-
metadata.name specifies the ranking of this kernel argument (100) among the machine configs and its purpose. If you have an AMD CPU, specify the kernel argument as amd_iommu=on.
-
spec.kernelArguments specifies the kernel argument as intel_iommu for an Intel CPU.
-
Create the new MachineConfig object:
$ oc create -f 100-worker-kernel-arg-iommu.yaml
Verification
-
Verify that the new MachineConfig object was added by entering the following command and observing the output:
NAME IGNITIONVERSION AGE
00-master 3.5.0 164m
00-worker 3.5.0 164m
01-master-container-runtime 3.5.0 164m
01-master-kubelet 3.5.0 164m
01-worker-container-runtime 3.5.0 164m
01-worker-kubelet 3.5.0 164m
100-master-chrony-configuration 3.5.0 169m
100-master-set-core-user-password 3.5.0 169m
100-worker-chrony-configuration 3.5.0 169m
100-worker-iommu 3.5.0 14s
-
Verify that IOMMU is enabled at the operating system (OS) level by entering the following command: