Skip to content

Commit 1febc77

Browse files
committed
Detect Intel CPUs with hybrid cores and warn about missing support
Ping pytorch#334, pytorch#247
1 parent 47c9549 commit 1febc77

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/x86/init.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,18 @@ void cpuinfo_x86_init_processor(struct cpuinfo_x86_processor* processor) {
7575
memcpy(processor->brand_string, brand_string, sizeof(processor->brand_string));
7676
cpuinfo_log_debug("raw CPUID brand string: \"%48s\"", processor->brand_string);
7777
}
78+
79+
/**
80+
* Warn that hybrid cores are not yet properly supported.
81+
* https://www.intel.com/content/www/us/en/developer/articles/guide/12th-gen-intel-core-processor-gamedev-guide.html#inpage-nav-1-5-2
82+
* "CPUID, by design, returns different values depending on the core it is executed on.
83+
* On hybrid cores more of the CPUID leaves will have data that varies"
84+
*/
85+
if (max_base_index >= UINT32_C(0x7)) {
86+
const struct cpuid_regs leaf7 = cpuidex(UINT32_C(0x7), 0);
87+
const bool is_hybrid = !!(leaf7.edx & UINT32_C(0x00004000));
88+
89+
if (is_hybrid)
90+
cpuinfo_log_warning("This is a hybrid processor (CPUID leaf7.edx bit 15 is set). We do not yet properly support enumeration of x86 hybrid cores.");
91+
}
7892
}

0 commit comments

Comments
 (0)