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

General fixes to Async GPU #2912

Merged
merged 11 commits into from Oct 16, 2019

Conversation

@FernandoS27
Copy link
Contributor

commented Sep 27, 2019

In technical terms this PR takes care of correcting:

  • Nvdrv Sync events handling.
  • Guest vSync Management.
  • Framelimiter management to CPU thread only.
  • Accurate Fences on vSync.
  • Remove hacked fence that forced the CPU to sync with the GPU every 9ms.
  • Resolve possible race conditions on CPU Page mapping from the GPU.
  • Force the system to wait for the GPU to idle before shutting down.

What it means for the user:

  • New games boot with async (FE:3H, Cadence of Hyrule, Pokken Tournament)
  • Fixed the issue where games would suddenly slowdown and report wrong framerates.
  • Fixed the issue where some games would surpass frame limiting.
  • Fixed the issue where dynamic resolution rescaler would trigger in SMO with fullspeed and won't trigger heavily for underspeed games.
  • Removed artificial fence which limited async to 9ms. Now Async will limited by the game. This results in performance boosts in many graphic intensive games.
  • Random async crashes, shouldn't happen anymore.
  • Stopping the emulator with async on, won't cause a crash.

Known issues remaining:

  • ARMS performs poorly & gets random graphical issues while async is on.
  • ZLA may hang with async on starting a game(Probably due to missyncing for stubbed nvdec).
@CLAassistant

This comment has been minimized.

Copy link

commented Sep 30, 2019

CLA assistant check
All committers have signed the CLA.

return;
}
MICROPROFILE_SCOPE(GPU_wait);
while (syncpoints[syncpoint_id].load() < value) {

This comment has been minimized.

Copy link
@lioncash

lioncash Oct 1, 2019

Contributor
Suggested change
while (syncpoints[syncpoint_id].load() < value) {
while (syncpoints[syncpoint_id].load(std::memory_order_relaxed) < value) {

is sufficient here.

@@ -96,16 +90,15 @@ void ThreadManager::FlushAndInvalidateRegion(CacheAddr addr, u64 size) {
InvalidateRegion(addr, size);
}

void ThreadManager::WaitIdle() const {
while (state.last_fence > state.signaled_fence.load()) {

This comment has been minimized.

Copy link
@lioncash

lioncash Oct 1, 2019

Contributor
Suggested change
while (state.last_fence > state.signaled_fence.load()) {
while (state.last_fence > state.signaled_fence.load(std::memory_order_relaxed)) {

Ditto

FernandoS27 added 10 commits Sep 25, 2019
This commit uses guest fences on vSync event instead of an articial fake 
fence we had.
It also corrects to keep signaling display events while loading the game 
as the OS is suppose to send buffers to vSync during that time.
…uire.

This has been hardware tested and it seems that NVFlinger will still 
signal even if there are no buffers to present.
Events are supposed to be cleared on quering. This fixes that issue.
@FernandoS27 FernandoS27 force-pushed the FernandoS27:async-fixes branch from f4e4024 to 538f588 Oct 5, 2019
@bunnei
bunnei approved these changes Oct 16, 2019
@bunnei bunnei merged commit ef9b317 into yuzu-emu:master Oct 16, 2019
6 checks passed
6 checks passed
license/cla Contributor License Agreement is signed.
Details
yuzu verify Build #20191011.1 succeeded
Details
yuzu verify (build standard linux) build standard linux succeeded
Details
yuzu verify (build standard windows) build standard windows succeeded
Details
yuzu verify (build testing windows) build testing windows succeeded
Details
yuzu verify (format clang) format clang succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.