1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/virt-adding-kernel-arguments-enable-iommu.adoc
2025-11-18 16:29:25 +01:00

97 lines
3.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * virt/virtual_machines/advanced_vm_management/configuring-pci-passthrough.adoc
// * virt/virtual_machines/advanced_vm_management/virt-configuring-virtual-gpus.adoc
:_mod-docs-content-type: PROCEDURE
[id="virt-adding-kernel-arguments-enable-IOMMU_{context}"]
= Adding kernel arguments to enable the IOMMU driver
[role="_abstract"]
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.
* You enabled Intel Virtualization Technology for Directed I/O extensions or AMD IOMMU in the BIOS.
* You have installed the {oc-first}.
.Procedure
. Create a `MachineConfig` object that identifies the kernel argument. The following example shows a kernel argument for an Intel CPU.
+
[source,yaml]
----
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
# ...
----
where:
<apiversion>:: Applies the new kernel argument only to worker nodes.
<name>:: Indicates 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`.
<intel_iommu=o>:: Identifies the kernel argument as `intel_iommu` for an Intel CPU.
. Create the new `MachineConfig` object:
+
[source,terminal]
----
$ 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:
+
[source,terminal]
----
$ oc get MachineConfig
----
+
Example output:
+
[source,terminal]
----
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:
+
[source,terminal]
----
$ dmesg | grep -i iommu
----
* If IOMMU is enabled, output is displayed as shown in the following example:
+
Example output:
+
[source,terminal]
----
Intel: [ 0.000000] DMAR: Intel(R) IOMMU Driver
AMD: [ 0.000000] AMD-Vi: IOMMU Initialized
----