ppy / osu

rhythm is just a *click* away!
https://osu.ppy.sh
MIT License
15.09k stars 2.23k forks source link

Wrong GPU selected after osu!lazer update #10550

Closed ghost closed 2 weeks ago

ghost commented 3 years ago

Describe the bug: I need to manually add osu to the list of programs nvidia will detect in order to run osu on my dedicated gpu (I'm using an old laptop from around 2009). After updating osu the folder where osu is located has changed because it has the version numbers in it. Not that it's a big issue but now I have to add the new version to nvidia's list after every update :smile:

Screenshots or videos showing encountered issue: image

osu!lazer version: 2020.1017.0

bdach commented 3 years ago

I'm half inclined to say this shouldn't be our problem. Unless we change our deployment/update method to not use separate executables for each version I don't know what we could possibly do to convince the vendor software to use the actual graphics card instead of the integrated one.

ghost commented 3 years ago

I've resolved this by adding a custom path appdata\local\osulazer\osu!.exe Not sure if that's okay but if it is, maybe it can be made so that nvidia driver will find that path instead.

image

bdach commented 3 years ago

As far as I can tell optimus should be forcing high performance if some static libraries are linked, but I don't think we do any static linking. There does seem to possibly be another way but (a) it only works for some driver versions (Release 302 and above) and (b) it's absolutely hideous (source):

extern "C" {
     _declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
}

I'm not sure how to even embed that in a .NET Core executable.

The %LocalAppData%/osulazer/osu!.exe path should be a reliable workaround, so I think we should go with that as the official way to make optimus switch to the higher-perf card and not add any ugly workarounds.

ghost commented 3 years ago

Sorry about that, adding just that path did not work after all.

Game4all commented 3 years ago

This overlaps with / is a dupe of #5582.

smoogipoo commented 3 years ago

I wouldn't say this is a dupe really. Also the linked issue needs discussion anyway - I'm not convinced we should be using the dGPU by default anyway - it can, depending on the system and optimisation of the game, actually result in lower frametime/higher latency (see: osu!stable).

I'll keep this open to track the issue of driver configs not persisting across updates, as this is definitely something we'll want to fix regardless.

Maybe something to consider at the point of moving away from Squirrel (if ever).

KarstenPH commented 3 years ago

maybe try right clicking on the .exe file and selecting the GPU from there?

smoogipoo commented 3 years ago

That is the intended way to use Windows. There's even a GPU setting somewhere in the system settings these days made for this purpose and intended to replace the NVIDIA control panel setting.

caesay commented 2 years ago

This will be fixed by https://github.com/clowd/Clowd.Squirrel/issues/24