open [12873] GPU: Implement channel scheduling. #12873

Open
Accord wants to merge 2 commits from __refs_pull_12873_head into master
Owner

Branch: __refs_pull_12873_head

Labels: gpu-new

FernandoS27 opened issue at 2024-01-31 16:57:

This allows scheduling channels in the GPU and avoids games that have multiple channels from running a channel before another.
The scheduling algorithm is pretty simple and does not take into account timeslices. It just tries to give every channel an equal opportunity to run and lets channels yield when they are blocked by another.
It needs testing.
This may be needed for multiprocess emulation when one process's GPU channel requires a shared resource from another process's GPU channel to be finished.
Games that use multiple channels are very few and don't seem impacted by this.
EDIT: this seems to crash renderdocs

liamwhite commented at 2024-02-05 01:46:

Causes an immediate crash in android even in simple homebrew like deko_basic
ED: JNI callbacks cannot be invoked from fibers, some stuff has to be reworked to allow this

liamwhite commented at 2024-02-06 04:30:

Android users report significantly increased flickering with this change
https://github.com/yuzu-emu/yuzu/assets/9658600/a07322a0-4ca8-41d4-9630-856f6e3a740a

FernandoS27 commented at 2024-02-06 15:26:

Android users report significantly increased flickering with this change

Screenrecorder-2024-02-06-09-38-56-476.mp4
which games are affected?

liamwhite commented at 2024-02-06 15:31:

The game in the video is Naruto X Boruto Ultimate Ninja Storm

iamnotkurtcobain commented at 2024-02-06 16:42:

Xenoblade 3 too

FernandoS27 commented at 2024-02-06 17:37:

Xenoblade 3 too
Can I get more specifics and are you sure it's this PR?

FernandoS27 commented at 2024-02-06 17:39:

Android users report significantly increased flickering with this change

Screenrecorder-2024-02-06-09-38-56-476.mp4
Was this tested against
Android users report significantly increased flickering with this change

Screenrecorder-2024-02-06-09-38-56-476.mp4
Was this tested against the latest artifact? Because I fixed an issue yesterday which likely could have caused it (I was forgetting to rebind the channel on resume).

iamnotkurtcobain commented at 2024-02-06 18:02:

Android users report significantly increased flickering with this change
Screenrecorder-2024-02-06-09-38-56-476.mp4

Was this tested against

Android users report significantly increased flickering with this change
Screenrecorder-2024-02-06-09-38-56-476.mp4

Was this tested against the latest artifact? Because I fixed an issue yesterday which likely could have caused it (I was forgetting to rebind the channel on resume).
Only tried with 234

Weab-chan commented at 2024-02-06 20:41:

Android users report significantly increased flickering with this change
Screenrecorder-2024-02-06-09-38-56-476.mp4

Was this tested against

Android users report significantly increased flickering with this change
Screenrecorder-2024-02-06-09-38-56-476.mp4

Was this tested against the latest artifact? Because I fixed an issue yesterday which likely could have caused it (I was forgetting to rebind the channel on resume).
I think it was tested by a build made at 11pm.. the user tested this one and confirmed the issue happened with just this pr

image

Oroxil commented at 2024-02-07 02:45:

https://github.com/yuzu-emu/yuzu/assets/151952973/b5e006d9-b3ac-4db8-8614-e1fa315c9553
Fixed on yuzu 235

Weab-chan commented at 2024-02-07 03:20:

VID_20240207_104444.mp4

Fixed on yuzu 235
because this pr was untagged

liamwhite commented at 2024-02-07 19:50:

Also found this to have caused vertex explosions in most courses in MK8D

FernandoS27 commented at 2024-02-08 13:31:

Also found this to have caused vertex explosions in most courses in MK8D
Xenoblade 3 and MK8D only use 1 channel. It cannot be this PR.
I can confirm Naruto x Boruto uses 6 channels and I found the issue.


[Export of Github issue for yuzu-emu/yuzu. Generated on 2024.02.28 at 10:04:32.]

**Branch:** [__refs_pull_12873_head](https://accord.dravee.dev/Accord/yuzu-mirror/src/branch/__refs_pull_12873_head) > **Labels**: `gpu-new` #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/1731197?u=cfaa9b3f59e99f5f7b6d2f7f210e46cfe31defdb&v=4" width="50"></div>[FernandoS27](https://github.com/FernandoS27) opened issue at [2024-01-31 16:57](https://github.com/yuzu-emu/yuzu/pull/12873): > This allows scheduling channels in the GPU and avoids games that have multiple channels from running a channel before another. > The scheduling algorithm is pretty simple and does not take into account timeslices. It just tries to give every channel an equal opportunity to run and lets channels yield when they are blocked by another. > It needs testing. > This may be needed for multiprocess emulation when one process's GPU channel requires a shared resource from another process's GPU channel to be finished. > Games that use multiple channels are very few and don't seem impacted by this. > ~~EDIT: this seems to crash renderdocs~~ #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/9658600?v=4" width="50"></div>[liamwhite](https://github.com/liamwhite) commented at [2024-02-05 01:46](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1926075049): > Causes an immediate crash in android even in simple homebrew like deko_basic > ED: JNI callbacks cannot be invoked from fibers, some stuff has to be reworked to allow this #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/9658600?v=4" width="50"></div>[liamwhite](https://github.com/liamwhite) commented at [2024-02-06 04:30](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1928766141): > Android users report significantly increased flickering with this change > https://github.com/yuzu-emu/yuzu/assets/9658600/a07322a0-4ca8-41d4-9630-856f6e3a740a #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/1731197?u=cfaa9b3f59e99f5f7b6d2f7f210e46cfe31defdb&v=4" width="50"></div>[FernandoS27](https://github.com/FernandoS27) commented at [2024-02-06 15:26](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1930046606): > > Android users report significantly increased flickering with this change > > > > Screenrecorder-2024-02-06-09-38-56-476.mp4 > which games are affected? #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/9658600?v=4" width="50"></div>[liamwhite](https://github.com/liamwhite) commented at [2024-02-06 15:31](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1930058575): > The game in the video is Naruto X Boruto Ultimate Ninja Storm #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/88488906?v=4" width="50"></div>[iamnotkurtcobain](https://github.com/iamnotkurtcobain) commented at [2024-02-06 16:42](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1930311579): > Xenoblade 3 too #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/1731197?u=cfaa9b3f59e99f5f7b6d2f7f210e46cfe31defdb&v=4" width="50"></div>[FernandoS27](https://github.com/FernandoS27) commented at [2024-02-06 17:37](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1930445552): > > Xenoblade 3 too > Can I get more specifics and are you sure it's this PR? #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/1731197?u=cfaa9b3f59e99f5f7b6d2f7f210e46cfe31defdb&v=4" width="50"></div>[FernandoS27](https://github.com/FernandoS27) commented at [2024-02-06 17:39](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1930448811): > > Android users report significantly increased flickering with this change > > > > Screenrecorder-2024-02-06-09-38-56-476.mp4 > Was this tested against > > Android users report significantly increased flickering with this change > > > > Screenrecorder-2024-02-06-09-38-56-476.mp4 > Was this tested against the latest artifact? Because I fixed an issue yesterday which likely could have caused it (I was forgetting to rebind the channel on resume). #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/88488906?v=4" width="50"></div>[iamnotkurtcobain](https://github.com/iamnotkurtcobain) commented at [2024-02-06 18:02](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1930484019): > > > Android users report significantly increased flickering with this change > > > Screenrecorder-2024-02-06-09-38-56-476.mp4 > > > > Was this tested against > > > > > Android users report significantly increased flickering with this change > > > Screenrecorder-2024-02-06-09-38-56-476.mp4 > > > > Was this tested against the latest artifact? Because I fixed an issue yesterday which likely could have caused it (I was forgetting to rebind the channel on resume). > Only tried with 234 #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/93067085?u=85494bf825f2c0556c49b9a5ed34a877368d9aad&v=4" width="50"></div>[Weab-chan](https://github.com/Weab-chan) commented at [2024-02-06 20:41](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1930716395): > > > Android users report significantly increased flickering with this change > > > Screenrecorder-2024-02-06-09-38-56-476.mp4 > > > > Was this tested against > > > > > Android users report significantly increased flickering with this change > > > Screenrecorder-2024-02-06-09-38-56-476.mp4 > > > > Was this tested against the latest artifact? Because I fixed an issue yesterday which likely could have caused it (I was forgetting to rebind the channel on resume). > I think it was tested by a build made at 11pm.. the user tested this one and confirmed the issue happened with just this pr ![image](https://github.com/yuzu-emu/yuzu/assets/93067085/b5b39f27-4680-47e4-a585-dfaecc7e84a3) #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/151952973?v=4" width="50"></div>[Oroxil](https://github.com/Oroxil) commented at [2024-02-07 02:45](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1931168620): > https://github.com/yuzu-emu/yuzu/assets/151952973/b5e006d9-b3ac-4db8-8614-e1fa315c9553 > Fixed on yuzu 235 #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/93067085?u=85494bf825f2c0556c49b9a5ed34a877368d9aad&v=4" width="50"></div>[Weab-chan](https://github.com/Weab-chan) commented at [2024-02-07 03:20](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1931203540): > > VID_20240207_104444.mp4 > > > > Fixed on yuzu 235 > because this pr was untagged #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/9658600?v=4" width="50"></div>[liamwhite](https://github.com/liamwhite) commented at [2024-02-07 19:50](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1932759232): > Also found this to have caused vertex explosions in most courses in MK8D #### <div><img width="50" height="50" src="https://avatars.githubusercontent.com/u/1731197?u=cfaa9b3f59e99f5f7b6d2f7f210e46cfe31defdb&v=4" width="50"></div>[FernandoS27](https://github.com/FernandoS27) commented at [2024-02-08 13:31](https://github.com/yuzu-emu/yuzu/pull/12873#issuecomment-1934131308): > > Also found this to have caused vertex explosions in most courses in MK8D > Xenoblade 3 and MK8D only use 1 channel. It cannot be this PR. > I can confirm Naruto x Boruto uses 6 channels and I found the issue. > ------------------------------------------------------------------------------- > [Export of Github issue for [yuzu-emu/yuzu](https://github.com/yuzu-emu/yuzu). Generated on 2024.02.28 at 10:04:32.]
GPU/Scheduling: Implement priority scheduling.
Some checks failed
yuzu-ci / transifex (pull_request) Has been cancelled
yuzu-ci / reuse (pull_request) Has been cancelled
codespell / Check for spelling errors (pull_request) Has been cancelled
yuzu verify / verify format (pull_request) Has been cancelled
yuzu verify / test build (windows, msvc) (pull_request) Has been cancelled
yuzu verify / test build (pull_request) Has been cancelled
yuzu verify / test build-1 (pull_request) Has been cancelled
yuzu verify / test build-2 (pull_request) Has been cancelled
yuzu verify / test build (macos) (pull_request) Has been cancelled
yuzu verify / android (pull_request) Has been cancelled
7a4ea8991f
Some checks failed
yuzu-ci / transifex (pull_request) Has been cancelled
yuzu-ci / reuse (pull_request) Has been cancelled
codespell / Check for spelling errors (pull_request) Has been cancelled
yuzu verify / verify format (pull_request) Has been cancelled
yuzu verify / test build (windows, msvc) (pull_request) Has been cancelled
yuzu verify / test build (pull_request) Has been cancelled
yuzu verify / test build-1 (pull_request) Has been cancelled
yuzu verify / test build-2 (pull_request) Has been cancelled
yuzu verify / test build (macos) (pull_request) Has been cancelled
yuzu verify / android (pull_request) Has been cancelled
This pull request has changes conflicting with the target branch.
  • src/video_core/control/channel_state.h
  • src/video_core/gpu.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin __refs_pull_12873_head:__refs_pull_12873_head
git switch __refs_pull_12873_head

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff __refs_pull_12873_head
git switch __refs_pull_12873_head
git rebase master
git switch master
git merge --ff-only __refs_pull_12873_head
git switch __refs_pull_12873_head
git rebase master
git switch master
git merge --no-ff __refs_pull_12873_head
git switch master
git merge --squash __refs_pull_12873_head
git switch master
git merge --ff-only __refs_pull_12873_head
git switch master
git merge __refs_pull_12873_head
git push origin master
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Accord/yuzu-mirror!12873
No description provided.