phhusson / treble_experimentations

Notes about tinkering with Android Project Treble
3.41k stars 659 forks source link

GPU Frequencies stay at the highest and the load is full but it loads at nothing #2563

Closed ChrisCatto closed 11 months ago

ChrisCatto commented 1 year ago

Current Behavior:

GPU not working properly. ### Describe the bug GPU Frequencies stay at the highest and the load is full but it loads at nothing in result making GPU act very weak and make the whole experience bad. Tried other GSIs too, this bug is everywhere. ### To Reproduce This bug is always there. ### Expected behavior GPU to be working in a normal way like stock ROM. ### Smartphone (please complete the following information): - Device: [Poco X4 GT / Redmi Note 11T Pro / Pro+/ K50i] - Version: [ProjectElixir_3.9_arm64_bgN-13.0-20230626-1831-OFFICIAL] ### Additional context [LogCat](https://drive.google.com/file/d/15Vg1dg0ZEaoqgHGBr2tQhKoB70EUdcU8/view?usp=drivesdk)
ace-kun-dev commented 1 year ago

Good afternoon, im also a user of this rom. May i just ask if what did you do to solve this in your own way and what happened? Thanks brother. . I'm having an issue with a game graphics not showing up (specifically some kind of frozen water animation/physics in some game). Some sources on google says that it really is not supported in PowerVR GE8000 gpus but i would just like to make sure. Just thinking maybe its connected...

ChrisCatto commented 1 year ago

Good afternoon, im also a user of this rom. May i just ask if what did you do to solve this in your own way and what happened? Thanks brother. . I'm having an issue with a game graphics not showing up (specifically some kind of frozen water animation/physics in some game). Some sources on google says that it really is not supported in PowerVR GE8000 gpus but i would just like to make sure. Just thinking maybe its connected...

I couldn't solve it... I switched back to stock rom and everything is fine there of course.

Oelun commented 1 year ago

It looks like a feature of the xiaomi firmware on the Dimensity 8100 SOC (some kind of patch or useless custom daemon/kernel mod for gpu freq control)... I don't have that problem on another soc's.

phhusson commented 1 year ago

Can you tell me how to reproduce that issue? I have a Poco X4 GT so I should be able to reproduce easily

ChrisCatto commented 1 year ago

Can you tell me how to reproduce that issue? I have a Poco X4 GT so I should be able to reproduce easily

Sir this issue is always there, just by using the phone and also it is very noticable, if you try to play any big game you'll notice a difference in performance or by just running a benchmark and compare it with the stock rom of the device

phhusson commented 1 year ago

Please state some actual benchmark or game, and actual performance expected. I used Poco X4 GT just fine in the past.

ChrisCatto commented 1 year ago

Please state some actual benchmark or game, and actual performance expected. I used Poco X4 GT just fine in the past.

Try 3DMark App and run wildlife test, the expected score with this bug is around 1400 and in stock rom it is around 6000

phhusson commented 1 year ago

Sure

Le 2023-08-31T17:34:57.000+02:00, Priyanshu @.***> a écrit :

 is this issue fixable sir ?    —  Reply to this email directly, view it on GitHub  [https://github.com/phhusson/treble_experimentations/issues/2563#issuecomment-1701273877],  or unsubscribe  [https://github.com/notifications/unsubscribe-auth/AAAA4OQB6PJIGL6HPBKXILLXYCVKDANCNFSM6AAAAAA3HKAZ54].  You are receiving this because you commented.Message ID: @.***>

phhusson commented 1 year ago

Looks like you extrapolated what I said. I said it was fixable, which means that yes it's possible to fix it. I never said there was a fix ongoing.

phhusson commented 1 year ago

It's not a completely trivial answer, but let's say no.

phhusson commented 1 year ago

Can you be more precise? Which process? Which library? process? Where do you get that information from?

phhusson commented 1 year ago

I'm not sure what I'm supposed to do with that information...

phhusson commented 1 year ago

I'm reopening this because we definitely want to fix it. But having new information on the matter would be useful.

phhusson commented 12 months ago

New info:

I can force GPU frequency with echo 0 > /proc/gpufreqv2/fix_target_opp_index (reseting with echo -1 > /proc/gpufreqv2/fix_target_opp_index, values taken from /proc/gpufreqv2/gpu_working_opp_table). With this I get 5300 points in WildLife

Looking at /proc/gpufreqv2/gpufreq_status, it looks like GPU is always running at maximum frequency (but gated off most of the time), except in 3d games.

At the moment, it looks like setting target_opp forced to 0 is rather safe and doesn't break much.

On another side, a mediatek bsp patch has surfaced using proprietary libs, to send some signaling of the surfaces to the kernel through /proc/ged ioctl interface. It seems to fix this issue as well (and actually gets higher score with 5700). Watching /proc/gpufreqv2/gpufreq_status with that patch does show OPP scaling up (or down since OPP 0 is highest freq).

There is still a lot of work to do to come to an actual solution, but still, that looks promising. I definitely don't want to ship the proprietary lib mentioned previously, so I need to check how stable are those /proc/ged calls, or I'll need to look at loading libs from /vendor...

Thanks a lot to @sarthakroy2002 for the help and support

priiii1808 commented 12 months ago

Thanks to both of you and good luck 👍

phhusson commented 11 months ago

Got some progress. I managed to rewrite that part of the proprietary lib, I now have full score without forcing GPU frequency. I'll clean it up, and make it optional (because I'm reallyl not guaranteeing it won't crash), and then this issue should be closed.

musadsaiyed commented 11 months ago

Hey, that's great news! really glad you were able to achieve this. This is a great step towards closing this issue, and I appreciate your hard work on it.

priiii1808 commented 11 months ago

Got some progress. I managed to rewrite that part of the proprietary lib, I now have full score without forcing GPU frequency. I'll clean it up, and make it optional (because I'm reallyl not guaranteeing it won't crash), and then this issue should be closed.

Excited for the fix to be pushed on trebledroid sources. Manifesting that everything will be great. Thanks a lot again 🙏. All the best

ChrisCatto commented 11 months ago

This issue can be marked as done now?

phhusson commented 11 months ago

Pushed in latest TD CI build. Select "Mediatek GED KPI support" in treble settings => Misc, and reboot