Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Implement TSC calibration #7966

Merged
merged 2 commits into from Apr 6, 2020
Merged

[WIP] Implement TSC calibration #7966

merged 2 commits into from Apr 6, 2020

Conversation

Nekotekina
Copy link
Member

Try to get rough TSC frequency by sampling it.
Should fix "TSC: Bad" in most cases.

Please report your results after running RPCS3 several times (10-20).

@HerrHulaHoop
Copy link

Shows TSC correctly now. Ran it over 10 times and only the last 2 digits would change. Rarely the third digit from the end would also change.

RPCS3 v0.0.9-4f8c3ee2 Alpha | fixup | Firmware version: 4.85
Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz | 8 Threads | 15.94 GiB RAM | TSC: 3.597932GHz | AVX+ | FMA3

@dio-gh
Copy link
Contributor

dio-gh commented Apr 6, 2020

20 tests on my i7 7700HQ:

TSC: 2.807999GHz
TSC: 2.808000GHz
TSC: 2.808003GHz
TSC: 2.807999GHz
TSC: 2.808000GHz

TSC: 2.807998GHz
TSC: 2.807997GHz
TSC: 2.807997GHz
TSC: 2.808004GHz
TSC: 2.808000GHz

TSC: 2.807989GHz -- first bigger diff
TSC: 2.808005GHz
TSC: 2.807997GHz
TSC: 2.807938GHz -- chrome video playing started
TSC: 2.807992GHz

TSC: 2.808092GHz
TSC: 2.808059GHz
TSC: 2.807894GHz -- wtf?
TSC: 2.808009GHz
TSC: 2.807998GHz

@Kravickas
Copy link
Contributor

10times +
range between TSC: 3.299990GHz - TSC: 3.299998GHz

Nothing fancy running

@xddxd
Copy link
Contributor

xddxd commented Apr 6, 2020

ran it 20 times on a Ryzen 7 2700
1 TSC: 3.193991GHz
2 TSC: 3.193986GHz
3 TSC: 3.193974GHz
4 TSC: 3.193992GHz
5 TSC: 3.193991GHz
6 TSC: 3.193991GHz
7 TSC: 3.193990GHz
8 TSC: 3.193990GHz
9 TSC: 3.193991GHz
10 TSC: 3.193990GHz
11 TSC: 3.193991GHz
12 TSC: 3.193992GHz
13 TSC: 3.193991GHz
14 TSC: 3.193994GHz
15 TSC: 3.193989GHz
16 TSC: 3.193979GHz
17 TSC: 3.193989GHz
18 TSC: 3.193989GHz
19 TSC: 3.193990GHz
20 TSC: 3.193989GHz

@MsDarkLow
Copy link
Contributor

Ran 10 times on 8700k@5GHz

RPCS3 v0.0.9-4f8c3ee2 Alpha | fixup | Firmware version: 4.84
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz | 12 Threads | 15.96 GiB RAM | AVX+ | FMA3 | TSX

TSC: 3.696000GHz
TSC: 3.696006GHz
TSC: 3.696001GHz
TSC: 3.696005GHz
TSC: 3.695997GHz
TSC: 3.696004GHz
TSC: 3.695993GHz
TSC: 3.696003GHz
TSC: 3.696004GHz
TSC: 3.696000GHz

@Nekotekina Nekotekina force-pushed the fixup branch 2 times, most recently from fa25306 to 98d14cc Compare April 6, 2020 19:35
@Nekotekina
Copy link
Member Author

Back to 2 digits after dot.

@Augusto7743
Copy link

Have problems if using in Windows 10 Pro 64 1809 "bcdedit /set useplatformclock true" ?
If using bcdedit /set useplatformclock true the latency is 500 us and if using bcdedit /set useplatformclock false latency is 1000 us.
bcdedit /set useplatformclock true enable HPET ? If yes here using HPET the RPCS3 is more fast than if using "bcdedit /set useplatformclock false" ( TSC ?).
The CPU is FX-6300.

Is very much mess in internet about timers.
Timers are used to schedule threads ?

Well I will test using bcdedit /set useplatformclock false with 0.0.9-10134 and will report the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants