Code Monkey home page Code Monkey logo

cputopologyrebuild's Introduction

CpuTopologyRebuild

An experimental Lilu plugin that optimizes Alder Lake / Raptor Lake's heterogeneous core configuration.

For example, this kext is possible to recognize the Core i9-12900K's topology as 16 cores 24 threads or 8 cores 24 threads.

Background

OpenCore's ProvideCurrentCpuInfo quirk enables Alder Lake's both P-Cores and E-Cores, but all cores and threads are recognized as equivalent. This can cause potentially single thread or real world performance degradation.

This kext aims to improve performance by rebuild the topology for these cores and threads.

The effect of this kext is not yet clear, but I've seen not only a cosmetic effect, but also some performance improvements. For example, the Geekbench 5 score on the Windows VM have increased in the case of allocating a small number of cores to VMware Fusion.
Other examples : Japanese / English(Translated)

Usage

  • Use this kext with ProvideCurrentCpuInfo quirk.
  • -ctrsmt boot arg makes E-Cores to be recognized as the 3-way SMT logical threads of the P-Cores. For example, it is recognized as 8 cores 24 threads in Core i9. This option seems to give the closest single thread performance to E-Cores disabled configuration.
  • When HT disabled, E-Cores are recognized as a logical thread of P-Cores with or without -ctrsmt.

Topology examples

ProvideCurrentCpuInfo ProvideCurrentCpuInfo
+ CpuTopologyRebuild
ProvideCurrentCpuInfo
+ CpuTopologyRebuild
+ -ctrsmt
Core i9-13900K 8P+16E+HT 32c32t 24c32t 8c32t
Core i9-12900K 8P+8E+HT 24c24t 16c24t 8c24t
8P+8E 16c16t 8c16t 8c16t
Core i7-12700K 8P+4E+HT 20c20t 12c20t 8c20t
8P+4E 12c12t 8c12t 8c12t
Core i5-12600K 6P+4E+HT 16c16t 10c16t 6c16t
6P+4E 10c10t 6c10t 6c10t

About patches.plist

patches_ht.plist

With ProvideCurrentCpuInfo, Hyper Threading is recognized as disabled due to that core and thread count are considered equal while initializing. patches_ht.plist forces the kernel to recognize that Hyper Threading is enabled.
(Performance effect is currenlty uncertain.)

patches_legacy.plist

patches_legacy.plist can be used instead of ProvideCurrentCpuInfo quirk. It is not needed normally, but ProvideCurrentCpuInfo doesn't work for High Sierra and earlier, so you can use this patch for older macOS.

Current problems

  • Changing the number of cores in cpuid info causes instability such as random boot failing, so it has not been changed now.

Credits

  • Apple for macOS
  • vit9696 for original CpuTopologySync
  • bootmacos for confirmation about Raptor Lake (i9-13900KF) and Ventura
  • taruyato for confirmation 8P+4E configuration (i7-12700F) and Ventura ( #12 )
  • b00t0x for writing the software and maintaining it

cputopologyrebuild's People

Contributors

b00t0x avatar

Stargazers

byzhou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.