From 721c624de88f364ae6a9acf9c31b1c576761f801 Mon Sep 17 00:00:00 2001 From: Wenkai Du <43822138+wenkaidu@users.noreply.github.com> Date: Thu, 8 Jan 2026 13:55:40 -0800 Subject: [PATCH] Remove iommu warning in KVM env (#2112) * Remove iommu warning in KVM env * Fix for review comments [ROCm/rccl commit: de931f4c53158184b2d7f4fe6165a5dad761649c] --- projects/rccl/src/init.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/rccl/src/init.cc b/projects/rccl/src/init.cc index 28de2f70c7..1b8d6f6513 100644 --- a/projects/rccl/src/init.cc +++ b/projects/rccl/src/init.cc @@ -60,6 +60,7 @@ #include "msccl/msccl_status.h" #include "latency_profiler/CollTrace.h" #include "latency_profiler/CollTraceFunc.h" +#include #ifndef STR2 #define STR2(v) #v @@ -198,8 +199,12 @@ static ncclResult_t ncclInit() { } INFO(NCCL_INIT, "Kernel version: %s", verStr); if (strstr(verStr, "cray") == NULL) { + unsigned int eax, ebx, ecx, edx; + if (!__get_cpuid(1, &eax, &ebx, &ecx, &edx)) + ecx = 0; // cpuid not supported NCCLCHECK(ncclTopoGetStrFromSys("/sys/devices/virtual/dmi/id", "bios_version", strValue)); - if (strncmp("Hyper-V UEFI Release", strValue, 20) != 0) { + // Check BIOS string and hypervisor presence on ecx bit 31 + if (strncmp("Hyper-V UEFI Release", strValue, 20) != 0 && (ecx & (1u << 31)) == 0) { FILE* file; if ((file = fopen("/proc/cmdline", "r")) != NULL) { if (feof(file) == 0 && ferror(file) == 0) {