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

Power-saving sleep makes some Wine games perform really bad #164

Open
RalfJung opened this issue Mar 30, 2015 · 6 comments
Open

Power-saving sleep makes some Wine games perform really bad #164

RalfJung opened this issue Mar 30, 2015 · 6 comments

Comments

@RalfJung
Copy link
Contributor

The power-saving usleep introduced with bebe0bf makes some Wine games perform really badly: The game stutters, with the framerate going down to <5fps (estimated) every few seconds. Specifically, both TrackMania Nations: United and Audiosurf are unplayable with the default configuration. Setting PRIMUS_SLEEP=10 fixes the problem: Both games remain perfectly fluid (>=30fps, I would estimate).

Some other games I tried are not affected, which is why it took me so long to notice this.

This is with Debian testing, an NVIdia GeForce 630M and an Intel Sandybridge GPU.

@amonakov
Copy link
Owner

Can you try checking how CPU frequency scaling affects it? Specifically, by checking whether using "performance" scaling governor and p-state/acpi scaling driver changes things.

@RalfJung
Copy link
Contributor Author

Can you try checking how CPU frequency scaling affects it? Specifically, by checking whether using "performance" scaling governor

You mean, I should write "performance" to
/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor? I can try that.

and p-state/acpi scaling driver changes things.

What exactly would I have to do to try this?

@amonakov
Copy link
Owner

On Tue, Mar 31, 2015 at 4:18 PM, Ralf Jung [email protected] wrote:

Can you try checking how CPU frequency scaling affects it? Specifically,
by checking whether using "performance" scaling governor

You mean, I should write "performance" to
/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor? I can try that.

Right, and ...

and p-state/acpi scaling driver changes things.

What exactly would I have to do to try this?

You can use dmesg | grep -iE p.?state to see if pstate driver is used by
default. If so, you can boot with intel_pstate=disable on the kernel
command line to disable it, and then the old acpi scaling driver will be
used.

@RalfJung
Copy link
Contributor Author

Changing the governor to "performance" did not have any noticeable effect.

Then I rebooted with intel_pstate=disable, and indeed now things behave much better. Of course, I won't leave the p-states disabled...

I also did a crazy (stupid?) experiment and set PRIMUS_SLEEP to 150. The effect was that it would sleep longer and longer with every frame, presumably it would take 150% of its previous sleep time, not knowing that it could actually have been much faster... in other words, it seems the heuristic is not good at compensating that it slept too long (and will only do that in 10% steps, with the default setting, I guess). Mind you, this is without actually looking at the code.

@amonakov
Copy link
Owner

On Tue, Mar 31, 2015 at 9:54 PM, Ralf Jung [email protected] wrote:

Changing the governor to "performance" did not have any noticeable effect.

Then I rebooted with intel_pstate=disable, and indeed now things behave
much better. Of course, I won't leave the p-states disabled...

This flag does not disable frequency scaling altogether, it switches from
Intel p-state driver to ACPI cpufreq driver. Intel p-state driver is
relatively new, and I've seen mentions that sometimes it has worse
behavior (nothing specific though). What kernel version are you running?

I also did a crazy (stupid?) experiment and set PRIMUS_SLEEP to 150. The
effect was that it would sleep longer and longer with every frame,
presumably it would take 150% of its previous sleep time, not knowing that
it could actually have been much faster... in other words, it seems the
heuristic is not good at compensating that it slept too long (and will only
do that in 10% steps, with the default setting, I guess). Mind you, this is
without actually looking at the code.

Right, setting PRIMUS_SLEEP at 100 or above is not useful, and recovering
after a long delay takes several frames. Currently the heuristic is
extremely simple.


Reply to this email directly or view it on GitHub
#164 (comment).

@RalfJung
Copy link
Contributor Author

RalfJung commented Apr 1, 2015 via email

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

No branches or pull requests

2 participants