Remove iommu warning in KVM env (#2112)

* Remove iommu warning in KVM env

* Fix for review comments

[ROCm/rccl commit: de931f4c53]
This commit is contained in:
Wenkai Du
2026-01-08 13:55:40 -08:00
gecommit door GitHub
bovenliggende 30d36661c2
commit 721c624de8
+6 -1
Bestand weergeven
@@ -60,6 +60,7 @@
#include "msccl/msccl_status.h"
#include "latency_profiler/CollTrace.h"
#include "latency_profiler/CollTraceFunc.h"
#include <cpuid.h>
#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) {