To properly function, any computer system must be able to accurately measure time. A typical Windows PC has several ways to do so, and using HPET – high precision event timer – is one of them.
HPET is most precise timer available to the system, but whole generations of CPUs are affected by what’s been called “HPET bug”: for them, accessing HPET takes ~7 times longer than it should. Similar to Meltdown and Spectre, this is a hardware issue, and cannot be fixed entirely.
Skylake X and Kaby Lake X have the worst of it, but it seems to also affect Threadripper, Coffee Lake, and Ryzen.
You can read all the technical details in these articles:
- Anandtech – explains where it all began and gives a thorough explanation of system timers
- Overclockers.at – has a shorter summary and a specialized benchmark to highlight the issue
By default, HPET is simply on the list of the available timers in Windows 8 and 10. Different timers will be used for different purposes, which is the best case scenario.
However, certain pieces of software, such as Ryzen Master and potentially anything related to overclocking, benchmarking or monitoring hardware, can force HPET to be the only timer used by the system. This may be necessary for the normal operation of that software, but on the systems that are affected by the HPET bug, it can lead to a decrease in performance, sometimes quite significant.
HPET can be configured in two places:
1) On some motherboards, HPET can be Enabled or Disabled in BIOS.
2) Windows Command Prompt can Force HPET to be always used as the only timer, or you can set Default Settings.
So there are four total combinations of these settings:
1) Enabled in BIOS, OS uses Default Settings: HPET will be used as necessary. This is the desired configuration.
2) Enabled in BIOS, Forced in OS: HPET is always used. If your system suffers from the HPET bug, this is where performance problems occur.
3) Disabled in BIOS, OS uses Default Settings: HPET is not available at all.
4) Disabled in BIOS, Forced in OS: HPET is not available at all and there could be a performance impact.
It is not recommended to keep HPET Disabled in BIOS, as it can cause stability issues. Additionally, if HPET is Forced in OS and Disabled in BIOS, it can result in skipped frames or otherwise impact your performance.
How to configure HPET through Windows Command Prompt:
- Windows Search for “CMD”
- Right Click the Command Prompt and click “Run as administrator”
- To Force HPET, type: bcdedit /set useplatformclock true
- To set Default Settings, type: bcdedit /deletevalue useplatformclock
If the command you entered has successfully changed something, you will get “operation successful” message. If the command was already active, then you will get an “error occurred” message.
Use the Command Prompt to set HPET to Default Settings. If you get “operation successful” message – congratulations, you are likely to get increased performance. If not – too bad, not today.
During Ryzen launch, there was a pronounced issue with HPET, and AMD gave an official recommendation to disable HPET in BIOS. However, those issues were supposedly resolved.
To find out whether your system benefits from completely disabling HPET:
- Update your BIOS to the latest version.
- Use the Command Prompt to set HPET to Default Setting. Restart your PC.
- Run the TimerBench at low resolution with HPET Enabled in BIOS.
- Do not click “Enable HPET” button in TimerBench, as it will force the system to always use only HPET, which is not desirable.
- Run TimerBench with HPET Disabled in BIOS.
- Compare results. If you see no difference, then keep HPET Enabled in BIOS and set to Default in OS.
A note on TimerBench: you can see a “Enable HPET” button, but it doesn’t actually enable HPET, it forces the system to always use HPET in all situations, which will cause a performance drop if your system is suffering from the HPET bug. This is the same as Forcing HPET through Command Prompt.
Similarly, the “Disable HPET” button in TimerBench does not actually disable the HPET. It does the same thing as setting Default Setting through Command Prompt. Only the BIOS setting can truly disable HPET.
My Benchmark Results
I’m using a Core i5 7600k, overclocked to 4.4 GHz on MSI Z270 Gaming M3 motherboard. I ran two sets of benchmarks, one with TimerBench – a benchmark produced by Overclockers.at to specifically demonstrate the performance impact of the HPET Bug.
I also ran a primitive benchmark in PlanetSide 2 – I just drove a Prowler near a tower in VR Training and fired HESH shells and Gatekeeper bursts for a minute, using FRAPS to record frametimes and these graphics settings.
As you can see, on my machine the performance impact of the HPET bug is quite significant.
According to that article from Overclockers.at, how much your particular system is affected by HPET bug – if it all – will depend on your specific hardware and what kind of games you’re playing. The impact seems to be most noticeable when your game is CPU-bound – paired with an overly powerful Graphics Card, in other words. This is a fairly common situation for PS2.
Huge thanks to /u/Oottzz for bringing this issue to my attention and to /u/DastardlyCoxcomb for his input in the same thread.