Page MenuHomePhabricator

Add 'iommu=pt' kernel parameter on MI300x nodes for direct GPU-to-GPU communication (PCIe P2P)
Closed, ResolvedPublic

Description

After enabling support for shared volumes in LiftWing (T421105), we successfully got multi-GPU tensor-parallelism working for the gpt-oss-safeguard-20b isvc (P89899#363595). This improved performance compared to single-GPU setup.

While the performance improved, using shared CPU memory (SHM) for GPU-to-GPU communication creates a massive bandwidth bottleneck. Performance would be significantly faster if we could use direct GPU-to-GPU communication (P2P).

During our multi-GPU deployment, we noticed that direct P2P communication is currently blocked by the host node's kernel configuration:

NCCL WARN Missing "iommu=pt" from kernel command line which can lead to system instablity or hang!

see detailed vLLM/NCCL logs in: P89899#363595

We did some digging and found that the solution to this issue is adding iommu=pt to the Linux kernel GRUB boot parameters.

Here is AMD ROCm's documentation that shows steps on how to fix this issue:
1.https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/install-faq.html#issue-5-application-hangs-on-multi-gpu-systems
2.https://instinct.docs.amd.com/projects/amdgpu-docs/en/latest/conceptual/iommu.html
3.https://instinct.docs.amd.com/projects/amdgpu-docs/en/latest/system-optimization/mi300x.html#grub-settings

Event Timeline

I did some reading and my understanding is that with iommu=pt there is no protection from the kernel about unauthorized memory access that doesn't belong to a process, so in theory an attacker could:

  • compromise a model server running on a mi300x-enabled host (via vLLM etc...)
  • exploit a bug in the amdgpu kernel driver and basically get full access to memory on the host (completely compromised)

It is a bit scary but the likelihood of having both of the above at the same time is low, or maybe it is low if we do our diligent work and keep everything updated (from model server to kernel). I am personally not totally at ease with this setup, but it is also true that every model server runs with K8s PSS restricted (so the first step of exploiting a container is much more difficult). What we could do is allow a one-off test and measure performance, and circle back on pros/cons: if the gain is so massive, then maybe the weakened security is warranted?

Last question - how does the P2P communication works with kserve containers? Do you need to assign multiple GPUs/partitions to the same pod to control them via P2P?

Of course I'll leave Moritz to comment, more authoritative than me for sure :D

Last question - how does the P2P communication works with kserve containers? Do you need to assign multiple GPUs/partitions to the same pod to control them via P2P?

Yes, for our current use case, we need to assign multiple GPUs to the same pod so they can communicate via P2P. In the KServe container, multi-GPU communication is managed by vLLM when we use tensor_parallel_size=2 in the vLLM engine args and amd.com/gpu: "2" in the inference service deployment config.

I did some reading and my understanding is that with iommu=pt there is no protection from the kernel about unauthorized memory access that doesn't belong to a process, so in theory an attacker could:

  • compromise a model server running on a mi300x-enabled host (via vLLM etc...)
  • exploit a bug in the amdgpu kernel driver and basically get full access to memory on the host (completely compromised)

That seems correct.

It is a bit scary but the likelihood of having both of the above at the same time is low, or maybe it is low if we do our diligent work and keep everything updated (from model server to kernel). I am personally not totally at ease with this setup, but it is also true that every model server runs with K8s PSS restricted (so the first step of exploiting a container is much more difficult). What we could do is allow a one-off test and measure performance, and circle back on pros/cons: if the gain is so massive, then maybe the weakened security is warranted?

That sounds good.

Change #1271699 had a related patch set uploaded (by Klausman; author: Klausman):

[operations/puppet@production] manifests: Enable iommu=pt kernel parameter for MI300 hosts

https://gerrit.wikimedia.org/r/1271699

Change #1271699 merged by Klausman:

[operations/puppet@production] manifests: Enable iommu=pt kernel parameter for MI300 hosts

https://gerrit.wikimedia.org/r/1271699

The parameter has been added to ml-serve-1012 and 1013, and the hosts have been rebooted. The workload we were looking at is atm scheduled on 1012. We haven't tested performance yet, but I see the following messages in the console:

[  477.839707] amdgpu 0000:26:00.0: amdgpu: Failed to map peer:0000:46:00.0 mem_domain:2
[  477.848588] amdgpu 0000:46:00.0: amdgpu: Failed to map peer:0000:26:00.0 mem_domain:2
[  482.087236] amdgpu 0000:26:00.0: amdgpu: Failed to map peer:0000:46:00.0 mem_domain:2
[  482.096121] amdgpu 0000:46:00.0: amdgpu: Failed to map peer:0000:26:00.0 mem_domain:2
[  482.109241] amdgpu 0000:26:00.0: amdgpu: Failed to map peer:0000:46:00.0 mem_domain:2

I don't know yet is this is something we need to address, I will keep digging.

I have enabled P2P GPU communication in the gpt-oss-safeguard-20b isvc, but the model-server fails to start with the error:

RuntimeError: NCCL error: unhandled cuda error

Here are the detailed logs: P90931

Based on this AMD ROCm documentation, it looks like adding iommu=pt is not enough, we also have to set IOMMU to Enabled in the server BIOS.

@klausman did we enable IOMMU in the BIOS?

I checked for ml-serve1012, we have 'IOMMU': 'Auto',, that IIUC may not be what the kernel needs in your case. Probably setting it to Enabled may be a good test, I can set it via spicerack shell anytime if needed, so you can reboot and check. Lemme know if you want it @klausman

I checked for ml-serve1012, we have 'IOMMU': 'Auto',, that IIUC may not be what the kernel needs in your case. Probably setting it to Enabled may be a good test, I can set it via spicerack shell anytime if needed, so you can reboot and check. Lemme know if you want it @klausman

Yespls. Can you enable it in the BIOS and come Monday, Ire boot the machines to activate it?

>>> pprint(r.request("PATCH", "/redfish/v1/Systems/1/Bios", json={"Attributes": { "IOMMU": "Enabled" }}).json())
{'Success': {'code': 'Base.1.10.Success',
             'message': 'Successfully Completed Request.'}}
>>> from spicerack.redfish import ChassisResetPolicy
>>> r.chassis_reset(ChassisResetPolicy.FORCE_RESTART)
Resetting chassis power status for ml-serve1012 to ForceRestart

@klausman I've just set the setting on ml-serve1012, it should be rebooting now.

elukey@ml-serve1012:~$ sudo dmesg -T | grep -i iommu
[Mon Apr 20 13:22:53 2026] Command line: BOOT_IMAGE=/boot/vmlinuz-6.16.3+deb13-amd64 root=/dev/mapper/vg0-root ro console=ttyS1,115200n8 raid0.default_layout=2 elevator=deadline iommu=pt
[Mon Apr 20 13:22:53 2026] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.16.3+deb13-amd64 root=/dev/mapper/vg0-root ro console=ttyS1,115200n8 raid0.default_layout=2 elevator=deadline iommu=pt
[Mon Apr 20 13:23:05 2026] iommu: Default domain type: Passthrough (set via kernel command line)
[Mon Apr 20 13:23:14 2026] pci 0000:60:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:14 2026] pci 0000:60:00.3: Adding to iommu group 0
[Mon Apr 20 13:23:14 2026] pci 0000:60:01.0: Adding to iommu group 1
[Mon Apr 20 13:23:14 2026] pci 0000:60:01.1: Adding to iommu group 2
[Mon Apr 20 13:23:14 2026] pci 0000:60:02.0: Adding to iommu group 3
[Mon Apr 20 13:23:14 2026] pci 0000:60:03.0: Adding to iommu group 4
[Mon Apr 20 13:23:14 2026] pci 0000:60:04.0: Adding to iommu group 5
[Mon Apr 20 13:23:14 2026] pci 0000:60:05.0: Adding to iommu group 6
[Mon Apr 20 13:23:14 2026] pci 0000:60:05.3: Adding to iommu group 7
[Mon Apr 20 13:23:14 2026] pci 0000:60:05.4: Adding to iommu group 8
[Mon Apr 20 13:23:14 2026] pci 0000:60:07.0: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:60:07.1: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:60:07.2: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:61:00.0: Adding to iommu group 10
[Mon Apr 20 13:23:14 2026] pci 0000:62:00.0: Adding to iommu group 11
[Mon Apr 20 13:23:14 2026] pci 0000:62:01.0: Adding to iommu group 12
[Mon Apr 20 13:23:14 2026] pci 0000:62:02.0: Adding to iommu group 13
[Mon Apr 20 13:23:14 2026] pci 0000:62:1f.0: Adding to iommu group 14
[Mon Apr 20 13:23:14 2026] pci 0000:63:00.0: Adding to iommu group 15
[Mon Apr 20 13:23:14 2026] pci 0000:64:00.0: Adding to iommu group 16
[Mon Apr 20 13:23:14 2026] pci 0000:65:00.0: Adding to iommu group 17
[Mon Apr 20 13:23:14 2026] pci 0000:68:00.0: Adding to iommu group 18
[Mon Apr 20 13:23:14 2026] pci 0000:69:00.0: Adding to iommu group 19
[Mon Apr 20 13:23:14 2026] pci 0000:6a:00.0: Adding to iommu group 20
[Mon Apr 20 13:23:14 2026] pci 0000:6b:00.0: Adding to iommu group 20
[Mon Apr 20 13:23:14 2026] pci 0000:6c:00.0: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:6c:00.1: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:6c:00.4: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:6d:00.0: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:6d:00.1: Adding to iommu group 9
[Mon Apr 20 13:23:14 2026] pci 0000:40:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:14 2026] pci 0000:40:00.3: Adding to iommu group 21
[Mon Apr 20 13:23:14 2026] pci 0000:40:01.0: Adding to iommu group 22
[Mon Apr 20 13:23:14 2026] pci 0000:40:01.1: Adding to iommu group 23
[Mon Apr 20 13:23:14 2026] pci 0000:40:02.0: Adding to iommu group 24
[Mon Apr 20 13:23:14 2026] pci 0000:40:03.0: Adding to iommu group 25
[Mon Apr 20 13:23:14 2026] pci 0000:40:04.0: Adding to iommu group 26
[Mon Apr 20 13:23:14 2026] pci 0000:40:05.0: Adding to iommu group 27
[Mon Apr 20 13:23:14 2026] pci 0000:40:07.0: Adding to iommu group 28
[Mon Apr 20 13:23:14 2026] pci 0000:40:07.1: Adding to iommu group 28
[Mon Apr 20 13:23:14 2026] pci 0000:41:00.0: Adding to iommu group 29
[Mon Apr 20 13:23:14 2026] pci 0000:42:00.0: Adding to iommu group 30
[Mon Apr 20 13:23:14 2026] pci 0000:42:01.0: Adding to iommu group 31
[Mon Apr 20 13:23:14 2026] pci 0000:42:02.0: Adding to iommu group 32
[Mon Apr 20 13:23:14 2026] pci 0000:44:00.0: Adding to iommu group 33
[Mon Apr 20 13:23:14 2026] pci 0000:45:00.0: Adding to iommu group 34
[Mon Apr 20 13:23:14 2026] pci 0000:46:00.0: Adding to iommu group 35
[Mon Apr 20 13:23:14 2026] pci 0000:48:00.0: Adding to iommu group 28
[Mon Apr 20 13:23:14 2026] pci 0000:48:00.1: Adding to iommu group 28
[Mon Apr 20 13:23:14 2026] pci 0000:00:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:14 2026] pci 0000:00:00.3: Adding to iommu group 36
[Mon Apr 20 13:23:14 2026] pci 0000:00:01.0: Adding to iommu group 37
[Mon Apr 20 13:23:14 2026] pci 0000:00:01.1: Adding to iommu group 38
[Mon Apr 20 13:23:14 2026] pci 0000:00:02.0: Adding to iommu group 39
[Mon Apr 20 13:23:14 2026] pci 0000:00:03.0: Adding to iommu group 40
[Mon Apr 20 13:23:14 2026] pci 0000:00:04.0: Adding to iommu group 41
[Mon Apr 20 13:23:14 2026] pci 0000:00:05.0: Adding to iommu group 42
[Mon Apr 20 13:23:14 2026] pci 0000:00:07.0: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:00:07.1: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:00:07.2: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:00:14.0: Adding to iommu group 44
[Mon Apr 20 13:23:14 2026] pci 0000:00:14.3: Adding to iommu group 44
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.0: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.1: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.2: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.3: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.4: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.5: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.6: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:18.7: Adding to iommu group 45
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.0: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.1: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.2: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.3: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.4: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.5: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.6: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:00:19.7: Adding to iommu group 46
[Mon Apr 20 13:23:14 2026] pci 0000:01:00.0: Adding to iommu group 47
[Mon Apr 20 13:23:14 2026] pci 0000:02:00.0: Adding to iommu group 48
[Mon Apr 20 13:23:14 2026] pci 0000:02:01.0: Adding to iommu group 49
[Mon Apr 20 13:23:14 2026] pci 0000:02:02.0: Adding to iommu group 50
[Mon Apr 20 13:23:14 2026] pci 0000:02:1f.0: Adding to iommu group 51
[Mon Apr 20 13:23:14 2026] pci 0000:03:00.0: Adding to iommu group 52
[Mon Apr 20 13:23:14 2026] pci 0000:04:00.0: Adding to iommu group 53
[Mon Apr 20 13:23:14 2026] pci 0000:05:00.0: Adding to iommu group 54
[Mon Apr 20 13:23:14 2026] pci 0000:07:00.0: Adding to iommu group 55
[Mon Apr 20 13:23:14 2026] pci 0000:08:00.0: Adding to iommu group 56
[Mon Apr 20 13:23:14 2026] pci 0000:09:00.0: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:09:00.1: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:09:00.4: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:09:00.5: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:0a:00.0: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:0a:00.1: Adding to iommu group 43
[Mon Apr 20 13:23:14 2026] pci 0000:20:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:14 2026] pci 0000:20:00.3: Adding to iommu group 57
[Mon Apr 20 13:23:14 2026] pci 0000:20:01.0: Adding to iommu group 58
[Mon Apr 20 13:23:14 2026] pci 0000:20:01.1: Adding to iommu group 59
[Mon Apr 20 13:23:14 2026] pci 0000:20:02.0: Adding to iommu group 60
[Mon Apr 20 13:23:14 2026] pci 0000:20:03.0: Adding to iommu group 61
[Mon Apr 20 13:23:14 2026] pci 0000:20:03.1: Adding to iommu group 62
[Mon Apr 20 13:23:14 2026] pci 0000:20:04.0: Adding to iommu group 63
[Mon Apr 20 13:23:14 2026] pci 0000:20:05.0: Adding to iommu group 64
[Mon Apr 20 13:23:14 2026] pci 0000:20:07.0: Adding to iommu group 65
[Mon Apr 20 13:23:14 2026] pci 0000:20:07.1: Adding to iommu group 65
[Mon Apr 20 13:23:14 2026] pci 0000:21:00.0: Adding to iommu group 66
[Mon Apr 20 13:23:14 2026] pci 0000:22:00.0: Adding to iommu group 67
[Mon Apr 20 13:23:14 2026] pci 0000:22:01.0: Adding to iommu group 68
[Mon Apr 20 13:23:14 2026] pci 0000:22:02.0: Adding to iommu group 69
[Mon Apr 20 13:23:14 2026] pci 0000:24:00.0: Adding to iommu group 70
[Mon Apr 20 13:23:14 2026] pci 0000:25:00.0: Adding to iommu group 71
[Mon Apr 20 13:23:14 2026] pci 0000:26:00.0: Adding to iommu group 72
[Mon Apr 20 13:23:14 2026] pci 0000:27:00.0: Adding to iommu group 73
[Mon Apr 20 13:23:14 2026] pci 0000:28:00.0: Adding to iommu group 74
[Mon Apr 20 13:23:14 2026] pci 0000:29:00.0: Adding to iommu group 75
[Mon Apr 20 13:23:14 2026] pci 0000:29:01.0: Adding to iommu group 76
[Mon Apr 20 13:23:14 2026] pci 0000:29:02.0: Adding to iommu group 77
[Mon Apr 20 13:23:14 2026] pci 0000:29:03.0: Adding to iommu group 78
[Mon Apr 20 13:23:14 2026] pci 0000:29:04.0: Adding to iommu group 79
[Mon Apr 20 13:23:14 2026] pci 0000:29:05.0: Adding to iommu group 80
[Mon Apr 20 13:23:14 2026] pci 0000:29:1f.0: Adding to iommu group 81
[Mon Apr 20 13:23:14 2026] pci 0000:2f:00.0: Adding to iommu group 82
[Mon Apr 20 13:23:14 2026] pci 0000:2f:00.1: Adding to iommu group 83
[Mon Apr 20 13:23:14 2026] pci 0000:30:00.0: Adding to iommu group 84
[Mon Apr 20 13:23:14 2026] pci 0000:31:00.0: Adding to iommu group 65
[Mon Apr 20 13:23:14 2026] pci 0000:31:00.1: Adding to iommu group 65
[Mon Apr 20 13:23:14 2026] pci 0000:e0:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:14 2026] pci 0000:e0:00.3: Adding to iommu group 85
[Mon Apr 20 13:23:14 2026] pci 0000:e0:01.0: Adding to iommu group 86
[Mon Apr 20 13:23:14 2026] pci 0000:e0:01.1: Adding to iommu group 87
[Mon Apr 20 13:23:14 2026] pci 0000:e0:02.0: Adding to iommu group 88
[Mon Apr 20 13:23:14 2026] pci 0000:e0:03.0: Adding to iommu group 89
[Mon Apr 20 13:23:14 2026] pci 0000:e0:04.0: Adding to iommu group 90
[Mon Apr 20 13:23:14 2026] pci 0000:e0:05.0: Adding to iommu group 91
[Mon Apr 20 13:23:14 2026] pci 0000:e0:07.0: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:e0:07.1: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:e0:07.2: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:e1:00.0: Adding to iommu group 93
[Mon Apr 20 13:23:14 2026] pci 0000:e2:00.0: Adding to iommu group 94
[Mon Apr 20 13:23:14 2026] pci 0000:e2:01.0: Adding to iommu group 95
[Mon Apr 20 13:23:14 2026] pci 0000:e2:02.0: Adding to iommu group 96
[Mon Apr 20 13:23:14 2026] pci 0000:e2:1f.0: Adding to iommu group 97
[Mon Apr 20 13:23:14 2026] pci 0000:e3:00.0: Adding to iommu group 98
[Mon Apr 20 13:23:14 2026] pci 0000:e4:00.0: Adding to iommu group 99
[Mon Apr 20 13:23:14 2026] pci 0000:e5:00.0: Adding to iommu group 100
[Mon Apr 20 13:23:14 2026] pci 0000:e6:00.0: Adding to iommu group 101
[Mon Apr 20 13:23:14 2026] pci 0000:e6:00.1: Adding to iommu group 102
[Mon Apr 20 13:23:14 2026] pci 0000:e8:00.0: Adding to iommu group 103
[Mon Apr 20 13:23:14 2026] pci 0000:e9:00.0: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:e9:00.1: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:e9:00.4: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:ea:00.0: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:ea:00.1: Adding to iommu group 92
[Mon Apr 20 13:23:14 2026] pci 0000:c0:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:14 2026] pci 0000:c0:00.3: Adding to iommu group 104
[Mon Apr 20 13:23:14 2026] pci 0000:c0:01.0: Adding to iommu group 105
[Mon Apr 20 13:23:14 2026] pci 0000:c0:01.1: Adding to iommu group 106
[Mon Apr 20 13:23:15 2026] pci 0000:c0:02.0: Adding to iommu group 107
[Mon Apr 20 13:23:15 2026] pci 0000:c0:03.0: Adding to iommu group 108
[Mon Apr 20 13:23:15 2026] pci 0000:c0:03.1: Adding to iommu group 109
[Mon Apr 20 13:23:15 2026] pci 0000:c0:04.0: Adding to iommu group 110
[Mon Apr 20 13:23:15 2026] pci 0000:c0:05.0: Adding to iommu group 111
[Mon Apr 20 13:23:15 2026] pci 0000:c0:07.0: Adding to iommu group 112
[Mon Apr 20 13:23:15 2026] pci 0000:c0:07.1: Adding to iommu group 112
[Mon Apr 20 13:23:15 2026] pci 0000:c1:00.0: Adding to iommu group 113
[Mon Apr 20 13:23:15 2026] pci 0000:c2:00.0: Adding to iommu group 114
[Mon Apr 20 13:23:15 2026] pci 0000:c2:01.0: Adding to iommu group 115
[Mon Apr 20 13:23:15 2026] pci 0000:c2:02.0: Adding to iommu group 116
[Mon Apr 20 13:23:15 2026] pci 0000:c4:00.0: Adding to iommu group 117
[Mon Apr 20 13:23:15 2026] pci 0000:c5:00.0: Adding to iommu group 118
[Mon Apr 20 13:23:15 2026] pci 0000:c6:00.0: Adding to iommu group 119
[Mon Apr 20 13:23:15 2026] pci 0000:c9:00.0: Adding to iommu group 112
[Mon Apr 20 13:23:15 2026] pci 0000:c9:00.1: Adding to iommu group 112
[Mon Apr 20 13:23:15 2026] pci 0000:80:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:15 2026] pci 0000:80:00.3: Adding to iommu group 120
[Mon Apr 20 13:23:15 2026] pci 0000:80:01.0: Adding to iommu group 121
[Mon Apr 20 13:23:15 2026] pci 0000:80:01.1: Adding to iommu group 122
[Mon Apr 20 13:23:15 2026] pci 0000:80:02.0: Adding to iommu group 123
[Mon Apr 20 13:23:15 2026] pci 0000:80:03.0: Adding to iommu group 124
[Mon Apr 20 13:23:15 2026] pci 0000:80:04.0: Adding to iommu group 125
[Mon Apr 20 13:23:15 2026] pci 0000:80:05.0: Adding to iommu group 126
[Mon Apr 20 13:23:15 2026] pci 0000:80:07.0: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:80:07.1: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:80:07.2: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:81:00.0: Adding to iommu group 128
[Mon Apr 20 13:23:15 2026] pci 0000:82:00.0: Adding to iommu group 129
[Mon Apr 20 13:23:15 2026] pci 0000:82:01.0: Adding to iommu group 130
[Mon Apr 20 13:23:15 2026] pci 0000:82:02.0: Adding to iommu group 131
[Mon Apr 20 13:23:15 2026] pci 0000:82:1f.0: Adding to iommu group 132
[Mon Apr 20 13:23:15 2026] pci 0000:83:00.0: Adding to iommu group 133
[Mon Apr 20 13:23:15 2026] pci 0000:84:00.0: Adding to iommu group 134
[Mon Apr 20 13:23:15 2026] pci 0000:85:00.0: Adding to iommu group 135
[Mon Apr 20 13:23:15 2026] pci 0000:88:00.0: Adding to iommu group 136
[Mon Apr 20 13:23:15 2026] pci 0000:89:00.0: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:89:00.1: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:89:00.4: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:89:00.5: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:8a:00.0: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:8a:00.1: Adding to iommu group 127
[Mon Apr 20 13:23:15 2026] pci 0000:a0:00.2: AMD-Vi: IOMMU performance counters supported
[Mon Apr 20 13:23:15 2026] pci 0000:00:00.0: Adding to iommu group 36
[Mon Apr 20 13:23:15 2026] pci 0000:a0:00.3: Adding to iommu group 137
[Mon Apr 20 13:23:15 2026] pci 0000:a0:01.0: Adding to iommu group 138
[Mon Apr 20 13:23:15 2026] pci 0000:a0:01.1: Adding to iommu group 139
[Mon Apr 20 13:23:15 2026] pci 0000:a0:02.0: Adding to iommu group 140
[Mon Apr 20 13:23:15 2026] pci 0000:a0:03.0: Adding to iommu group 141
[Mon Apr 20 13:23:15 2026] pci 0000:a0:04.0: Adding to iommu group 142
[Mon Apr 20 13:23:15 2026] pci 0000:a0:05.0: Adding to iommu group 143
[Mon Apr 20 13:23:15 2026] pci 0000:a0:07.0: Adding to iommu group 144
[Mon Apr 20 13:23:15 2026] pci 0000:a0:07.1: Adding to iommu group 144
[Mon Apr 20 13:23:15 2026] pci 0000:a1:00.0: Adding to iommu group 145
[Mon Apr 20 13:23:15 2026] pci 0000:a2:00.0: Adding to iommu group 146
[Mon Apr 20 13:23:15 2026] pci 0000:a2:01.0: Adding to iommu group 147
[Mon Apr 20 13:23:15 2026] pci 0000:a2:02.0: Adding to iommu group 148
[Mon Apr 20 13:23:15 2026] pci 0000:a4:00.0: Adding to iommu group 149
[Mon Apr 20 13:23:15 2026] pci 0000:a5:00.0: Adding to iommu group 150
[Mon Apr 20 13:23:15 2026] pci 0000:a6:00.0: Adding to iommu group 151
[Mon Apr 20 13:23:15 2026] pci 0000:a8:00.0: Adding to iommu group 144
[Mon Apr 20 13:23:15 2026] pci 0000:a8:00.1: Adding to iommu group 144
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #0 (2 banks, 4 counters/bank).
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #1 (2 banks, 4 counters/bank).
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #2 (2 banks, 4 counters/bank).
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #3 (2 banks, 4 counters/bank).
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #4 (2 banks, 4 counters/bank).
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #5 (2 banks, 4 counters/bank).
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #6 (2 banks, 4 counters/bank).
[Mon Apr 20 13:23:15 2026] perf/amd_iommu: Detected AMD IOMMU #7 (2 banks, 4 counters/bank).

@elukey, thank you for making the BIOS changes to enable IOMMU on ml-serve1012.

I have tried to deploy the gpt-oss-safeguard-20b isvc to test the P2P GPU communication, but the k8s scheduler is currently unable to place pods on the ml-serve1012 node.

When the deployment is set to use either ml-serve1012 or ml-serve1013, it successfully spins up on ml-serve1013. However, when I pin the node affinity to use only ml-serve1012.eqiad.wmnet, the pod hangs in a pending state:

$ kubectl get pods
NAME                                                              READY   STATUS    RESTARTS   AGE
cope-a-9b-predictor-00001-deployment-69cf945644-8g4cv             3/3     Running   0          14h
gpt-oss-safeguard-20b-predictor-00001-deployment-6c5b99c84zv54w   3/3     Running   0          14h
gpt-oss-safeguard-20b-predictor-00002-deployment-647bcf945lhwh6   0/3     Pending   0          86s

Checking the pod events shows a scheduling failure caused by insufficient GPUs:

$ kubectl describe pod gpt-oss-safeguard-20b-predictor-00002-deployment-647bcf945lhwh6
...
Events:
  Type     Reason            Age    From               Message
  ----     ------            ----   ----               -------
  Warning  FailedScheduling  2m17s  default-scheduler  0/15 nodes are available: 1 Insufficient amd.com/gpu, 12 node(s) didn't match Pod's node affinity/selector, 2 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }. preemption: 0/15 nodes are available: 1 No preemption victims found for incoming pod, 14 Preemption is not helpful for scheduling.
  Warning  FailedScheduling  65s    default-scheduler  0/15 nodes are available: 1 Insufficient amd.com/gpu, 12 node(s) didn't match Pod's node affinity/selector, 2 node(s) had untolerated taint {node-role.kubernetes.io/control-plane: }. preemption: 0/15 nodes are available: 1 No preemption victims found for incoming pod, 14 Preemption is not helpful for scheduling.

I've also noticed both isvcs in the experimental namespace are using ml-serve1013 as shown below:

$ kubectl get pods -n experimental -o custom-columns=NAME:.metadata.name,NODE:.spec.nodeName,STATUS:.status.phase
NAME                                                              NODE                       STATUS
cope-a-9b-predictor-00001-deployment-69cf945644-8g4cv             ml-serve1013.eqiad.wmnet   Running
gpt-oss-safeguard-20b-predictor-00001-deployment-6c5b99c84zv54w   ml-serve1013.eqiad.wmnet   Running

@klausman could we check the status of the GPUs on ml-serve1012? If they are currently being used by other isvcs, would it be possible to move those isvcs to ml-serve1013 so we have the capacity to run this P2P test?

The host needed to have the amd device plugin service restarted, so all the GPUs would be visible to k8s. I've done so, and the service is now scheduling on 1012.

The host needed to have the amd device plugin service restarted, so all the GPUs would be visible to k8s. I've done so, and the service is now scheduling on 1012.

@klausman see T423459#11843102, I'd suggest to upgrade the node labeller and gpu plugin packages on ml-serve1012 and test them out, so we can rule out these failures for good.

Thanks to you all. After:

P2P GPU communication finally worked in the gpt-oss-safeguard-20b isvc. Below is a comparison of the SHM vs P2P vs P2P + SHM performance:

Inter-GPU communicationGPUsRequests/s (Throughput)Median Latencyp90Failure RateTotal RequestsReport
SHM215.243300ms4300ms0.00%1816P89906#L88
SHM416.592800ms3600ms0.00%1976P89906#L102
P2P216.342900ms3700ms0.00%1946P89906#L109
P2P416.372900ms3700ms0.00%1950P89906#L116
P2P + SHM216.532800ms3600ms0.00%1968P89906#L130
P2P + SHM416.172900ms3700ms0.00%1927P89906#L137

Overall, enabling P2P communication showed an improvement over SHM on the 2-GPU setup, reducing median latency from 3300ms to 2900ms and improving throughput from 15.24 RPS to 16.34 RPS. The best results came from combining P2P with SHM, which brought median latency down further to 2800ms and raised throughput to 16.53 RPS. We can now get roughly the same performance we previously needed 4 GPUs on SHM, with just 2 GPUs on P2P + SHM.

kevinbazira assigned this task to klausman.
kevinbazira updated Other Assignee, added: kevinbazira.

Before resolving, let's figure out the following:

  1. Is the increased performance enough to warrant iommu enabled on every mi300x host? Especially compared to the security risks that were highlighted before, the ML team will need to be very careful and keep up with driver-specific vulnerabilities and also general attack vectors to the Python code.
  2. If so, we'll need to enable iommu on the provision cookbook, in puppet (not as it is done right now probably) and roll it out on all mi300x nodes.

@klausman I had a chat with my team and we are ok in having it deployed on all MI300X nodes. Let me know if you still want to do it or not, I'll prep the updates for provisioning etc..

@klausman I had a chat with my team and we are ok in having it deployed on all MI300X nodes. Let me know if you still want to do it or not, I'll prep the updates for provisioning etc..

Yeah, we want to go through weith this for all hosts. Kevin has reported that it means we can serve certain workloads at the required throughput/latency with 2 GPUs shared instead of 4, so it's definitely worth it.

Change #1289942 had a related patch set uploaded (by Elukey; author: Elukey):

[operations/cookbooks@master] sre.hosts.provision: enable IOMMU for multi-GPU Supermicro hosts

https://gerrit.wikimedia.org/r/1289942

Change #1289942 merged by Elukey:

[operations/cookbooks@master] sre.hosts.provision: enable IOMMU for multi-GPU Supermicro hosts

https://gerrit.wikimedia.org/r/1289942

The provision cookbook is updated, ml-serve1012 and ml-serve1015 already done. 1013 and 1014 missing, I'll do them coordinating with Tobias.

Rolled out to all nodes!