-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Android: Implement custom driver loading for ARM64 Android devices #18532
Conversation
Crash in debug layer? You might be able to work around it in the Vulkan initialization by disabling the |
We can play with the turbo setting and stuff in followup PRs, don't need to get everything in at once. |
Added the check if |
Are you seeing any meaningful improvements with the driver, by the way? |
I didn't test too much. For some reason Qualcomm drivers like 615.37 work very wierdly (hard to explain, better to see it yourself). But with turnip drivers I get like +5-20% performance, so I don't even need to apply speedhacks. But it' only in games I tested. |
That sounds promising, at least. Though, even my old Poco F1 with Adreno 630 runs all games at full speed with the proprietary drivers already... but it's good to have this to experiment with. |
Hmm... Almost the same for me with my Poco F3. But anyway, is there any benchmark homebrew/game to understand better performance boost (want to test with turbo mode too)? |
I think the most interesting might be to try with really low-end Adreno devices that still allow driver replacements. Unfortunately I don't have any of those. Maybe crank the resolution to see if the fragment shaders get more efficient? Some relatively heavy games to run are the God of War games, Outrun, Wipeout Pure/Pulse, Tekken 6, GTA LCS / VCS... BTW, does this driver has a way to set a stable power state (avoiding all the up and down clocking, setting a fixed slow clock for example)? |
not sure about setting a fixed slow clock, I can ask the dev of this lib. But if's possible to set stable high clocks with turbo mode, then probably it also possible to do it reversed |
Just asking because it may be nice to have when optimizing shaders, to avoid false measurements due to the clock changing. Our shaders are quite simple though generally. |
How many times are you gonna force-push? :) Since this is your first PR, I have to approve each CI run manually :) |
oops, sorry :) I guess I'll wait for CI and try to force-push last time |
hm, seem to be some include path issue? |
yep, not sure why. Locally it works fine |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, I know what it is. On CI here we build without gradle, instead we use a legacy Android.mk for, well, legacy reasons.
So, you'll need to add any new include paths and new cpp files to that as well.
I'd suggest adding include paths here:
https://github.com/hrydgard/ppsspp/blob/master/android/jni/Locals.mk#L24
I see. It's already late, so I'll do that tomorrow. |
Won't work on release builds? That sounds weird. We definitely still need to be able to make release builds, for Google Play. So we need to gate the driver loading feature from them? |
Ehh, maybe I didn't explain well. What I want to say is that custom driver loading won't work on release builds without |
Right, you can ignore it in Make since those builds are not actually used. We use gradle for all downloadable builds. |
Let's hope it will compile now |
Didn't find any difference on my device
The dev of this lib said that's impossible, unfortunately |
Dima XD. |
MotorStorm: Artic Edge with x4 resolution with Mesa driver seems like 1-3 fps is faster VS default driver. |
Think we need to add any cpp files from the adrenotools library as well to the Android.mk (if any), and add (Yes, I know it's a pain. we should probably switch CI to gradle). |
You mean something like this? Unfortunately I can't even test it locally, and I don't want to trigger CI a lot index 70fda2601..d0a90937b 100644
--- a/android/jni/Android.mk
+++ b/android/jni/Android.mk
@@ -140,6 +140,13 @@ RCHEEVOS_FILES := \
${SRC}/ext/rcheevos/src/rhash/hash.c \
${SRC}/ext/rcheevos/src/rhash/md5.c
+ADRENOTOOLS_FILES := \
+ ${SRC}/ext/libadrenotools/src/driver.cpp \
+ ${SRC}/ext/libadrenotools/src/hook/hook_impl.cpp \
+ ${SRC}/ext/libadrenotools/src/hook/file_redirect_hook.c \
+ ${SRC}/ext/libadrenotools/src/hook/gsl_alloc_hook.c \
+ ${SRC}/ext/libadrenotools/src/hook/main_hook.c
+
VR_FILES := \
$(SRC)/Common/VR/OpenXRLoader.cpp \
$(SRC)/Common/VR/PPSSPPVR.cpp \
@@ -212,6 +219,7 @@ EXEC_AND_LIB_FILES := \
$(SPIRV_CROSS_FILES) \
$(RCHEEVOS_FILES) \
$(NAETT_FILES) \
+ $(ADRENOTOOLS_FILES) \
$(EXT_FILES) \
$(NATIVE_FILES) \
$(SRC)/Common/Buffer.cpp \
|
I can run the old build locally tomorrow and figure it out. |
I just set up Make in WSL. Will fix building soon |
This should be it. |
Well, we're gonna wanna talk to Unknown and see if he's still using that path. I don't use it myself anymore |
@dima-xd please add translate string for "Current GPU Driver" and "Install Custom Driver..." |
Just noting that an easy way to add the translation strings is to use langtool, though it requires a rust install. From Tools/langtool: cargo run -- add-new-key Section Key But, I can also take care of it afterwards. I'm going to play with this myself a bit tomorrow and then merge, thanks for fixing the build. |
Qualcomm is well known for droppping support for old device. Even a 1 year old phone could be neglected and not receiving any driver update. So it could be meaningful when PPSSPP need new vulkan extensions for extra features. And better performance could mean lower power consumption, will benefit the overall user experience. |
Some issues, which I'm happy to help fix after merging:
So, I'm going to temporarily move this to But, super cool to have, and works great! |
Gotta say, I really can't work my head around how you can stand making a button every time you want to try any little piece of code in PPSSPP. The idea of not being able to run ppssppunittest and ppssppheadless on Android phones is frustrating to me. Burns so much more time. -[Unknown] |
I run them on my Mac instead to get ARM64 coverage. But yeah. I probably would benefit from using that path more heh. |
Is there really any advantage to using Turnip on ppsspp? I honestly don't see it, but I would like an official answer (if possible). |
Some people have indeed reported substantial speedups, though it seems to depend on the device and the particular driver it has by default. I'm personally not really convinced this is worth it but it was heavily requested and also externally contributed, so ... |
I understood. Thanks for the feedback. |
Add possibility to install custom Vulkan driver for ARM64 Android devices using libadrenotools.
Some drivers can be found here.
It is also possible to use this feature, but I'm not sure if it's actually needed.
Draft for now, until I figure out why some drivers are crashing here. Or until I figure out how to make some kind of fallback to use default if it crashes on booting the app.