Taming the Dragon: Forcing Local LLMs and VirtualBox to Run Strictly on P-Cores in Windows 11

Introduction

Imagine running a massive local language model (LLM) or a heavy VirtualBox virtual machine on a modern Intel hybrid CPU, only to watch performance tank because the system scheduler placed critical tasks on slow Efficiency-cores (E-cores). This is the “dragon” many developers and tech enthusiasts face. A detailed guide published on Habr in July 2026 tackles this exact problem, presenting a practical method to force both local LLM inference and VirtualBox VMs to run exclusively on Performance-cores (P-cores) in Windows 11. The solution leverages built-in Windows tools and third-party utilities without requiring BIOS modifications or exotic hardware.

The Hybrid Architecture Problem

Since Intel’s 12th-gen Alder Lake, consumer CPUs have combined two core types: high-performance P-cores (Golden Cove, Raptor Cove) and power-efficient E-cores (Gracemont, Crestmont). Windows 11’s native scheduler generally handles this well for typical workloads, but it falls short in two specific scenarios:

  • Local LLM inference (e.g., running LLaMA 3.1, Mistral, or Falcon via llama.cpp) – these tasks benefit from maximum single-thread throughput and cache coherency. E-cores introduce latency spikes and reduce tokens per second (TPS) significantly.
  • VirtualBox VMs – when VT-x requires consistent high-frequency execution, the scheduler may migrate the VM to E-cores under thermal or power constraints, causing stuttering and I/O delays.

According to tests described in the original article, running a 7B-parameter model on P-cores alone yields up to 40% higher TPS compared to mixed-core execution. For VirtualBox, a VM running a database workload saw 25% lower latency when pinned to P-cores.

The Solution: Core Pinning with PowerShell and Process Lasso

The article outlines a two-pronged approach:

  1. Identify P-core affinity mask – Use PowerShell to retrieve the processor topology. For example, on an Intel Core i9-13900K (8 P-cores, 16 E-cores), P-cores are usually logical processors 0–15 (assuming hyper-threading), but this varies by motherboard and firmware. The script Get-CimInstance Win32_Processor | Select-Object -ExpandProperty NumberOfLogicalProcessors helps, but the authors recommend a more precise method: reading the MSR_CORE_THREAD_COUNT register via a tiny C# tool or using coreinfo.exe from Sysinternals.

  2. Apply processor affinity – Two main tools are compared:

Tool Method Ease of Use Persistence Across Reboots
Start /affinity (cmd) Command-line flag Low No
Set-ProcessAffinity (PowerShell) Script per session Medium No
Process Lasso (Bitsum) GUI + rules engine High Yes (service mode)

Process Lasso is recommended for its user-friendly interface and ability to create persistent rules. For instance, one can create a rule for llama.cpp.exe to always run on P-cores only, or for VirtualBoxVM.exe to stay off E-cores.

Step-by-Step Example for VirtualBox

  1. Download Process Lasso (free tier sufficient).
  2. Launch VirtualBox VM and locate its process (VBoxHeadless.exe or VirtualBoxVM.exe).
  3. Right-click the process → “CPU affinity” → “Always use…” → select only P-core logical processors.
  4. Enable “Persist via service” to survive reboots.

For LLM inference, the authors suggest creating a rule for the specific executable (e.g., main.exe from llama.cpp). They also note that ollama (a popular LLM runner) can be pinned similarly; ASI Biont supports connecting to local LLMs via API – for more details, see asibiont.com/courses.

Performance Gains and Caveats

Tests from the article (on a system with i9-13900K, 32 GB DDR5, RTX 4090) show:

  • LLM inference (7B, Q4_K_M): mixed cores – 28.2 TPS; P-cores only – 39.1 TPS (+38.6%).
  • VirtualBox (Ubuntu 24.04, 4 vCPUs, compiling Linux kernel): mixed cores – 12m34s; P-cores only – 9m18s (-26%).

However, the authors warn:

  • Pinning all tasks to P-cores can cause thermal throttling if the system has poor cooling.
  • Some background system processes (antivirus, telemetry) may also need careful handling to avoid interfering with pinned workloads.
  • Windows 11’s Game Mode and power plan settings (High Performance) do not fully prevent E-core migration; only explicit affinity does.

Conclusion

For developers pushing local LLMs or heavy VMs on hybrid Intel CPUs, the “dragon” of scheduler misbehavior is real – but taming it is achievable. Using tools like Process Lasso, one can enforce strict P-core affinity, delivering measurable performance improvements of 25–40%. The original Habr article provides a reproducible methodology and benchmarks. As hybrid architectures become standard (including upcoming AMD hybrid designs), such core-pinning techniques will only grow in importance. Experiment, measure, and pin wisely.

Source

← All posts

Comments