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

(OpenGL) Certain Games Crashes With ADRENO GPU 3xx and 5xx series #16015

Open
5 tasks done
ghost opened this issue Sep 12, 2022 · 44 comments
Open
5 tasks done

(OpenGL) Certain Games Crashes With ADRENO GPU 3xx and 5xx series #16015

ghost opened this issue Sep 12, 2022 · 44 comments

Comments

@ghost
Copy link

ghost commented Sep 12, 2022

Game or games this happens in

Naruto Shippuden Ultimate Ninja Impact
Kingdom Hearts Birth By Sleep
Monster Hunter 3rd HD Portable
Persona 3 Portable

What area of the game / PPSSPP

The following games crashes using opengl backend on adreno 3xx/5xx series.

Naruto Shippuden Ultimate Ninja Impact #12847

Kingdom Hearts Birth By Sleep #11029

Monster Hunter 3rd HD Portable #11410

Persona 3 Portable #11355

Workaround is by adding those games id to pixeldepthrounding could also fix graphics glitches for both opengl and vulkan 👇
#11583

What should happen

Not crashing and no graphic glitches

Logs

None

Platform

Android

Mobile phone model or graphics card

OPPO s3s Snapdragon 450 Adreno 506

PPSSPP version affected

All

Last working version

None

Graphics backend (3D API)

OpenGL / GLES

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try without any cheats and without loading any save states.
  • Include logs or screenshots of issue.
@IrfanH495
Copy link

@Gamemulatorer
try this game too Ikki Tousen: Xross Impact & Corpse Party

@ghost
Copy link
Author

ghost commented Sep 13, 2022

@Gamemulatorer try this game too Ikki Tousen: Xross Impact & Corpse Party

Why?

@unknownbrackets
Copy link
Collaborator

I wonder if we simply need to activate the NO_DEPTH_CANNOT_DISCARD_STENCIL workaround, but in GL. It sounds similar based on another issue, especially if pixel depth rounding fixes it.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

If anyone can compile and test, you can basically try adding:

if (caps_.vendor == GPUVendor::VENDOR_QUALCOMM) {
	bugs_.Infest(Bugs::NO_DEPTH_CANNOT_DISCARD_STENCIL);
}

Around here:

if (caps_.vendor == GPUVendor::VENDOR_IMGTEC) {

If that prevents the crash, it might need some small tweaks and could use conservative depth potentially (?) but it would only take this slow path in potentially necessary cases, unlike forcing pixel depth rounding always.

-[Unknown]

@ghost
Copy link
Author

ghost commented Sep 13, 2022

Sorry to say I don't know how to compile apk :(

@IrfanH495
Copy link

@Gamemulatorer try this game too Ikki Tousen: Xross Impact & Corpse Party

Why?

looks like the game also has a driver bug issue for adreno

@ghost
Copy link
Author

ghost commented Sep 13, 2022

@Gamemulatorer try this game too Ikki Tousen: Xross Impact & Corpse Party

Why?

looks like the game also has a driver bug issue for adreno

Can you define what is the issue of those games on adreno gpu 3xx/5xx series? Screenshots?

@IrfanH495
Copy link

@Gamemulatorer try this game too Ikki Tousen: Xross Impact & Corpse Party

Why?

looks like the game also has a driver bug issue for adreno

Can you define what is the issue of those games on adreno gpu 3xx/5xx series? Screenshots?

bolt fc

@ghost
Copy link
Author

ghost commented Sep 13, 2022

bolt fc

If you add those games id to PixelDepthRounding what happen?
Still force close?

@IrfanH495
Copy link

bolt fc

If you add those games id to PixelDepthRounding what happen? Still force close?

not fc
Screenshot_20220913-195817_QuickEdit+

@Saramagrean
Copy link
Contributor

Sorry to say I don't know how to compile apk :(

Try. :)
https://drive.google.com/file/d/10kAUg8051i7YJJNlAo0nVYXDKvkONrM5/view?usp=drivesdk

@ghost
Copy link
Author

ghost commented Sep 13, 2022

Still crashing :(
ULUS10582.ppdmp.zip

BTW thanks Saramagrean for the apk.

@unknownbrackets
Copy link
Collaborator

Since only certain games crash in this case, there should be some detectable case, even if it's different than the Vulkan issue. I just checked Persona 3, though, and it never seem to hit this condition: stest_on.flag && ztest_on.flag && !zwrite_off.flag. In fact, it doesn't even hit stest_on.flag.

It also does draws before the crash with zwrite_off && ztest_on, as well as !ztest_on. It never enables ctest_on either. I thought maybe atest, but it hits atest_on.flag && ztest_on.flag && zwrite_off.flag even before the crash, and ztest/ztest are used together and not used together before that.

-[Unknown]

@ghost
Copy link
Author

ghost commented Sep 20, 2022

GE dump before it crash.
ULUS10582.ppdmp.zip

@ghost
Copy link
Author

ghost commented Sep 23, 2022

Another list of games that crashes using opengl backend.

Hack/Link
Midnight Club L.A Remix
ModNation Racers

@ghost ghost changed the title List of games that crashes on adreno gpu 3xx/5xx series using opengl backend and workaround. (OpenGL) Games That Crashes With ADRENO GPU 3xx and 5xx series need PixelDepthRounding as workaround. Oct 14, 2022
@ghost ghost changed the title (OpenGL) Games That Crashes With ADRENO GPU 3xx and 5xx series need PixelDepthRounding as workaround. (OpenGL) Certain Games Crashes With ADRENO GPU 3xx and 5xx series need PixelDepthRounding as a workaround to avoid crash. Oct 15, 2022
@ghost
Copy link
Author

ghost commented Oct 28, 2022

I can also reproduce this on my vivo y11 snapdragon 439 adreno 505 android 11.

@IrfanH495
Copy link

sorry I use the latest build but almost all the games I have after loading the game, always fc
Samsung M20 exynos
Vulkan

@IrfanH495
Copy link

sorry I use the latest build but almost all the games I have after loading the game, always fc Samsung M20 exynos Vulkan

[v1.13.2-1726-gba32ef5ea]
[v1.13.2-1723-g1d97e7d03]
above version that I tried. but it's the same both fc for vulkan.
is this a driver bug?

@ghost
Copy link
Author

ghost commented Oct 30, 2022

sorry I use the latest build but almost all the games I have after loading the game, always fc Samsung M20 exynos Vulkan

[v1.13.2-1726-gba32ef5ea] [v1.13.2-1723-g1d97e7d03] above version that I tried. but it's the same both fc for vulkan. is this a driver bug?

Maybe 🤔?
Vulkan work normal on my phone.

@IrfanH495
Copy link

sorry @Gamemulatorer can you try it on mediatek.

@ghost
Copy link
Author

ghost commented Oct 30, 2022

sorry @Gamemulatorer can you try it on mediatek.

Sadly I don't have any mediatek phone with vulkan supported.

@IrfanH495
Copy link

IrfanH495 commented Oct 31, 2022

Samsung M20
Exynos 7904
Mali-G71
Android 10
all game fc
all use the default settings.
this is the screen recording.
https://youtu.be/0Nilq1a2tCo
is this also an issue?

@ghost
Copy link
Author

ghost commented Oct 31, 2022

Samsung M20 Exynos 7904 Mali-G71 Android 10 all game fc all use the default settings. this is the screen recording. https://youtu.be/0Nilq1a2tCo is this also an issue?

This is an adreno 3xx/5xx series gpu issue using opengl :)

@IrfanH495
Copy link

Samsung M20 Exynos 7904 Mali-G71 Android 10 all game fc all use the default settings. this is the screen recording. https://youtu.be/0Nilq1a2tCo is this also an issue?

This is an adreno 3xx/5xx series gpu issue using opengl :)
Yes, I know. I'm just confused whether to make a new issue or not.

@unknownbrackets
Copy link
Collaborator

If all games are force closing with non-Adreno, it's probably best to create a new issue. It'd really help to know if it's new and if so, since which commit.

-[Unknown]

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Nov 8, 2022
See hrydgard#16015.  Attempting to avoid a driver bug.
@hrydgard
Copy link
Owner

hrydgard commented Nov 23, 2022

For the release, I think I'm just gonna make a special compat flag that enables pixeldepthrounding for these four games on Adreno. Not sure what else I can do :/

hrydgard added a commit that referenced this issue Nov 23, 2022
…6015

See #16015

Partly derived from master...unknownbrackets:ppsspp:adreno-deadlock

But this one surgically activates it only for the known affected games, to avoid any additional
performance regressions in the release.

Entirely untested.
@unknownbrackets
Copy link
Collaborator

Just to note: this crash is not at all new, at least Persona 3 has been crashing for quite a while on affected devices. The crashes only seem to affect specific scenes, and in Persona 3 for example, you can work around it simply by having a save file afaik.

Might be good to make sure the vendor bug checks setting applies in case someone who could play before (with workarounds like not starting a new game on an affected device) can no longer get playable performance with early z checks forced off.

-[Unknown]

hrydgard added a commit that referenced this issue Nov 24, 2022
…6015

See #16015

Partly derived from master...unknownbrackets:ppsspp:adreno-deadlock

But this one surgically activates it only for the known affected games, to avoid any additional
performance regressions in the release.

Entirely untested.
hrydgard added a commit that referenced this issue Nov 24, 2022
Add compat flag / bug check for games on old Adreno/GL affected by #16015
@hrydgard
Copy link
Owner

hrydgard commented Nov 24, 2022

I added a "vendor bug checks" check, added the missing games and merged. Please test to see that the workaround has been applied correctly.

@ghost
Copy link
Author

ghost commented Nov 24, 2022

Yes the workaround is applied correctly but the performance
decrease by 5-10fps.
Screenshot_20221124_203347_2f85358b2198d26f8aca533d68bee793
Screenshot_20221124_203336_2f85358b2198d26f8aca533d68bee793

@hrydgard
Copy link
Owner

That's better than crashing, at least. Don't know what else we can do here for now, moving further work to later versions.

@hrydgard hrydgard modified the milestones: v1.14.0, v1.15.0 Nov 24, 2022
@ghost
Copy link
Author

ghost commented Nov 27, 2022

Adreno 306 still suffer freezing on certain games :(

@hrydgard
Copy link
Owner

These games, or other games?

@ghost
Copy link
Author

ghost commented Nov 27, 2022

These games, or other games?

Naruto Shippuden Ultimate Ninja Impact and Phantasy Star Portable 2.

@ghost
Copy link
Author

ghost commented Nov 27, 2022

Naruto Shippuden Ultimate Ninja Impact.

If OldAdrenoPixelDepthRoundingGL
is ON the game is freeze.

Screenrecording_Freeze.mp4

If OFF the game works normally 🤔

@hrydgard
Copy link
Owner

uh what, I thought we added it because it fixed freezes in the game? :)

So we should just remove it again from the compat.ini?

@ghost
Copy link
Author

ghost commented Nov 27, 2022

uh what, I thought we added it because it fixed freezes in the game? :)

So we should just remove it again from the compat.ini?

I don't know why this is only happen in my vivo y51a adreno 306, but not in my vivo y11 adreno 505 works correctly with OldAdrenoPixelDepthRoundingGL enable.

@ghost
Copy link
Author

ghost commented Nov 27, 2022

Might be good if you guys increase the android version to android 8.0+ adreno 3xx/5xx series? as mention here #11355 (comment) driver bug start in that android version 🤔

My vivo y51a is android 5.1 only.

@hrydgard
Copy link
Owner

Hm, ok, yeah, I'll give that a try.

@ghost ghost changed the title (OpenGL) Certain Games Crashes With ADRENO GPU 3xx and 5xx series need PixelDepthRounding as a workaround to avoid crash. (OpenGL) Certain Games Crashes With ADRENO GPU 3xx and 5xx series (now: performance issue) Dec 9, 2022
@hrydgard hrydgard modified the milestones: v1.15.0, Future Jan 12, 2023
@hrydgard hrydgard changed the title (OpenGL) Certain Games Crashes With ADRENO GPU 3xx and 5xx series (now: performance issue) (OpenGL) Certain Games Crashes With ADRENO GPU 3xx and 5xx series Dec 3, 2023
@XD89k
Copy link

XD89k commented Aug 20, 2024

Hello, the option to change drivers does not appear in Adreno 308 Version 1.17.1

@hrydgard
Copy link
Owner

The option to change drivers is only applicable to Vulkan, with newer Adreno GPU editions, unfortunately.

@XD89k
Copy link

XD89k commented Aug 21, 2024

Thank you, and the option is not available in Adreno 508 either?

@hrydgard
Copy link
Owner

hrydgard commented Aug 21, 2024

The criteria are:

  • Vulkan is used
  • Android version is at least 28 (Android 9)
  • The file /dev/kgsl-3d0 is present, which indicates the possibility to load drivers

If your device doesn't pass this it's not possible to load drivers at runtime, sorry

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

No branches or pull requests

5 participants