wwmm / fastgame

Optimize system performance for games
GNU General Public License v3.0
78 stars 5 forks source link

IOT crash (Arch Linux) #5

Closed gardotd426 closed 1 year ago

gardotd426 commented 1 year ago

This occurs with both a system installation via pacman and a manual build built myself.

Terminal output:

fastgame

(fastgame:2040741): Gtk-WARNING **: 21:14:33.419: Theme parser error: gtk-dark.css:5688:3-9: No property named "height"

(fastgame:2040741): Gtk-WARNING **: 21:14:33.432: Theme directory actions/16-Dark of theme ZafiroCircle has no size field

(fastgame:2040741): Adwaita-WARNING **: 21:14:34.013: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead.
/usr/include/c++/13.1.1/bits/stl_vector.h:1125: constexpr std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
[1]    2040741 IOT instruction (core dumped)  fastgame

And yes, I have indeed tried running sudo glib-compile-schemas /usr/share/glib-2.0/schemas like mentioned in #4.

gardotd426 commented 1 year ago

IT WORKS!!!!

wwmm commented 1 year ago

IT WORKS!!!!

Finally :smile:. It is time to put the power limit control then.

wwmm commented 1 year ago

I have updated the master branch again with the addition of the power limit control. Let me know if this broke anything.

gardotd426 commented 1 year ago

HALLELUJAH. Worked first time.

It's not very user-friendly for anyone that doesn't intimately know their GPU, since they'd have to know how high they're allowed to set the power limit, but hell it's WAY better than nothing and a hell of a lot farther along than it was a couple days ago. Thanks a ton man that's awesome

wwmm commented 1 year ago

since they'd have to know how high they're allowed to set the power limit

Yes. I thought about that. I imagine that there is a way to get the power limit range through the nvml api. But figuring this out without having the proper hardware will be a little tough. I hope that nvidia has put some self protection in their drivers.

but hell it's WAY better than nothing and a hell of a lot farther along than it was a couple days ago. Thanks a ton man that's awesome

Thanks!

gardotd426 commented 1 year ago

Hey man, so as I've said so far, I've only really tried actually using fastgame with something like Alacritty to make it easiest to confirm that settings are being applied, but I was wondering since there's no real documentation on it... How exactly do you run games that are for example launched through Steam with Fastgame?

Do you have to add fastgame_launch or something to the launch options? Use fastgame_apply from a terminal?

Let's say you wanted to create fastgame settings for Doom Eternal. How exactly would you do that once you've opened fastgame and selected your settings? Which executable would you type in the fastgame window, and when you click "apply," what then?

wwmm commented 1 year ago

Do you have to add fastgame_launch or something to the launch options?

Yes. I add fastgame_launcher %command% to steam launch options. Most of the settings can be applied without it but there are some that need to be set when launching the game.

Use fastgame_apply from a terminal?

No. After setting the Steam launch option all you have to do is opening FastGame window, loading the desired profile and clicking on the apply button. A window asking for the root password should be shown and fastgame_apply be automatically started.

After finishing gaming I usually load a profile that has the system default settings and click on the apply button again to restore the system to its original state.

Which executable would you type in the fastgame window

The one in the game installation folder located at steamapps/common. For example Cyberpunk installation folder has the exe Cyberpunk2077.exe. For the Witcher 3 the exe file is named witcher3.exe. And son on.

and when you click "apply," what then?

You want to click apply before starting the game. FastGame uses the kernel process events connector to find the game process pid. But for this to work fastgame_apply has to be running before the game starts so it sees the game process. The same thing happens with the setting that sets the wine process cpu affinity and priority. fastgame_apply has to be already running for it to find the wineserver pid when wine starts.

wwmm commented 1 year ago

but there are some that need to be set when launching the game.

Like environmental variables.

gardotd426 commented 1 year ago

So basically, I hit the Super Key to bring up my app launcher -> Launch Fastgame -> configure it (or load the saved preset I want to load) -> Type in the executable name -> click Apply, type root password in popup window and hit enter.

Then, assuming I've added fastgame_launcher %command% to the launch options of the game, once the game starts, the necessary settings will be applied?

wwmm commented 1 year ago

Then, assuming I've added fastgame_launcher %command% to the launch options of the game, once the game starts, the necessary settings will be applied?

Almost all the settings are applied as soon as fastgame_apply is executed and do not depend on the game process starting. For example those nvidia and amdgpu settings as well as the disk and memory related settings. What waits for the game process pid to be known are settings like the process affinity and scheduler. We try to apply them for the game when fastgame_launcher runs. They are reapplied in fastgame_apply as a fallback for the cases where the game/wine resets the affinity/scheduler we are trying to force.

Long story short with the exception of process affinity and scheduler and environmental variables all the rest is applied immediately and is not dependent on starting the game.

wwmm commented 1 year ago

Type in the executable name

The executable name can be saved to the profile too. So you do not need to type it again in the future if you save it to the profile.

gardotd426 commented 1 year ago

Hey, sorry to bother you, but about the disk readahead thing, you say you change it to ~32MB, but it's originally measured in KB.

Is it 1024 or 1000? Like, is 16MB going to be 16384 KB? Or do you just do 16000? I'm wondering because the Dead Space remake definitely needs it. I messed with it a LITTLE (but didn't want to mess with it too much until I knew how to use it) and it improved things, but yeah.

wwmm commented 1 year ago

you say you change it to ~32MB, but it's originally measured in KB.

As the kernel parameter works with KB I did the same in our window. Just type 32768 and press enter.

is 16MB going to be 16384 KB?

Yes. I think that the kernel also accepts values that are not a power of 2. But I doubt there is an advantage in doing so.

gardotd426 commented 11 months ago

I figured I'd comment here before opening a new issue.

...for some reason the GPU section is gone. Did you get rid of it?

Screenshot_20231115_193544

wwmm commented 11 months ago

for some reason the GPU section is gone. Did you get rid of it?

No. As far as I remember I did not even touch it in the latest updates. And I definitely did not touch the Nvidia code. Strange.

wwmm commented 11 months ago

The amd card section is fine. The nvidia is the one I did not test. But it should still be there.

wwmm commented 11 months ago

Even here on my computer the nvidia library generated by fastgame compilation is installed in the system path. So it must be failing to detect your nvidia card at runtime. Run G_MESSAGES_DEBUG=fastgame fastgame in a terminal to see if there are warnings.

gardotd426 commented 11 months ago

Sorry, it wasn't failing, wasn't fastgame's fault at all. It's Chaotic-AUR, for some reason their package of it doesn't include libfastgame_nvidia.so, and that's literally the only difference between that package and the package I just built from the AUR (and the one I just built manually from this repository).

They don't list it in their interferes repository which means that they are supposed to literally just be compiling using the AUR PKGBUILD, but they're clearly not. I filed an issue with them, thanks man.

wwmm commented 11 months ago

Sorry, it wasn't failing, wasn't fastgame's fault at all. It's Chaotic-AUR, for some reason their package of it doesn't include libfastgame_nvidia.so, and that's literally the only difference between that package and the package I just built from the AUR (and the one I just built manually from this repository).

Oh... I see. No problems :-). At least here on my AMD system having libxnvctrl installed is totally fine and harmless. So in my opinion it is an overkill to create a different package just for the sake of not installing libxnvctrl in systems that do not have nvidia cards.