Intel hybrid CPUs: the reserved core (Presentation Thread / replay) lands on an E-core #1286
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot#1286
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hookshot version
v2.0.11 (source d6369f1e)
What kind of problem
Low fps or stutter
What happened
Version: v2.0.11 (source d6369f1e), Windows 11, i5-14600KF (6 P-cores + 8 E-cores, 20 logical processors), RTX 4080 SUPER, no DLSS, no frame generation, 1080p.
What happens:
hos_reserved_cpus()keeps the core with the highest processor mask. On Intel 12th-14th gen the E-cores come after the P-cores, so the reserved core is an E-core. The log says:0x80000 is logical processor 19, an E-core. In dense parts of Kokiri Forest (3,000-4,000 draws a frame) the replay takes 19-23 ms a frame (
vk: a frame's replay time: submit 19-23), the GPU is busy only 6-8 ms (vk: GPU time) and the game runs at 37-45 fps.Proposed fix (below): read
PROCESSOR_RELATIONSHIP.EfficiencyClasswithGetLogicalProcessorInformationEx(RelationProcessorCore)and keep the last core of the highest class. On CPUs whose cores are all alike every class is 0, so the choice is the last core, as now.Workaround meanwhile:
HOS_RESERVE_CORE=0inhookshot_env.txt.Where in the game
Kokiri Forest (dense parts, fog, fast camera turns)
How often
Every time
Graphics card and driver version
NVIDIA GeForce RTX 4080 SUPER, driver 621.14
CPU, RAM and operating system
Intel Core i5-14600KF (6 P-cores + 8 E-cores, 20 logical processors), 32 GB, Windows 11
Changes from the defaults
No DLSS, no frame generation. Workaround tested: HOS_RESERVE_CORE=0 in hookshot_env.txt gives a steady 60 fps at native 1440p in the same places (replay ~8.4 ms a frame instead of 10-23 ms). The attached log is from the run without it.
Other software hooked into the game
No, nothing hooked in
hookshot_log.txt
Without the workaround (reserved core = E-core, logical processor 19), 1080p:
hookshot_log.3.txt
With HOS_RESERVE_CORE=0 in hookshot_env.txt, native 1440p, steady 60 fps:
hookshot_log.2.txt
(The second log ends with a crash when I switched frame generation to x8 by mistake; that is unrelated to this issue.)
Screenshots or video
No response
Before you send it
Thanks for the patch and the EfficiencyClass approach. The same E-core finding (HOS_PIN_RENDER=0: about +24% fps on an i7-12700KF) is in #995; linking this there for the maintainer.
Fixed in the v2.0.12 branch, closing when it ships. The reserved core is now only used with 4 or more cores of the fastest kind and in the thread's own processor group, so on Intel hybrid CPUs it's a P-core, not an E-core.
Same here on an i9-12900K (8 P + 8 E, 24 logical processors), RTX 4080, Windows 11, v2.0.11. The log says:
0x800000is logical processor 23, whichGetLogicalProcessorInformationEx(RelationProcessorCore)reports with EfficiencyClass 0 (E-core); logical 0–15 are the P-cores (EfficiencyClass 1). Sohos_reserved_cpus()taking the highestProcessorMaskalways lands on an E-core on these CPUs.Measurements, same save and area (Kokiri Forest and around), 2560x1440 output, 100% resolution:
HOS_PIN_RENDER=0, 5 minsubmitper frame (log avg)GPU-bound wait stayed ~0.1 ms, so it was the replay on the CPU. Suggestion: pick the reserved core by the highest
EfficiencyClass(then the highest mask among those); on non-hybrid CPUs all cores are class 0, so nothing changes there.HOS_PIN_RENDER=0inhookshot_env.txtworks as a workaround meanwhile.Fixed in v2.0.12 (https://github.com/NotRexed/Hookshot/releases/tag/v2.0.12): the reserved core is one of the fastest kind and in the thread's own processor group (#1158). Update with the Hookshot Builder (or the game's update offer) and rebuild. If it still happens on v2.0.12, reopen this with your
hookshot_log.txt.