-
Notifications
You must be signed in to change notification settings - Fork 89
Proton 5.13-2 does not allow CPU affinity to be set #304
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
Comments
I think this might still work for some Windows games under Proton, but it won't work for anything that has setup commands to be run before the game itself (like installing Windows DLLs). That's because we have to start the container to run the setup commands, which already happens before Steam does anything with the launch options. When Steam gets as far as running the actual game, it's too late to change how the container started, because it was already started, and processes inside the container will inherit the default CPU affinity from the container manager, instead of inheriting the restricted CPU affinity from what Steam thinks is the actual game (but is actually a stub process that tells processes already inside the container to run the correct command over there). The same is true for all process parameters other than arguments and environment variables. The launch options interface is very, very general, and it isn't possible to propagate everything to an unrelated part of the process tree. |
I imagined that was the reason. At first I did not think this would be a problem to me because I am development a software based on the kernel Process Events Connector that could apply affinity after the game has started. I tried that but after some time I realized there is a problem in this approach. At this point the game has already seen how many cores my cpu has and launched an amount of threads that would make sense when using all the cores. Obviously not what we want when setting affinity. So in this case there is no point in setting it after the game has started. Unfortunately. |
It might be possible to set up some way to wrap just the actual game in adverbs like When using compat tools like Proton and pressure-vessel, it has also ended up with two partially-compatible meanings: some of the options apply to the compat tool, some of the options apply to the actual game, people use it for both, and sometimes the intention was to apply them to one but they really get applied to the other. |
I think I have found a workaround that would work at least for me. As I am already using the kernel Process Events Connector my app can be notified about the pressure-vessel initialization and apply affinity to it. As far as I could see the first process related to pressure-vessel to be shown by the event connector is Is |
|
As the The event connector also gives the whole command line that was used to initialize the process. I will see if I can target only |
One day I might rename the native-code executables to pv-wrap, pv-adverb and so on to make them easier to find in |
Targeting every |
We might be able to solve this in a future release by shutting down the container after the setup commands have run, and starting a new container that takes the launch options into account. I had been concerned that this would add too much time to container startup, but it looks as though it might only add a couple of seconds in practice. |
In the latest beta version of For reference, you want Depending how well it works in terms of performance and functionality, we might make this mandatory in a later version, or keep it opt-in, or drop it entirely. It might even become enabled by default with an opt-out, but probably not for very long, because if it's good enough to be on by default, making it mandatory would let us delete quite a lot of relatively complex code. |
How do I install the beta version? I never did that. My current runtime soldier version is |
It is in the properties menu. I will install it |
Affinity configuration works after setting |
The slightly slower startup should be the same for every Proton game: it's to do with the container runtime, not the game. In my tests on old/slow hardware, the "cost" of relaunching was something like 2-3 seconds. On a faster machine with We did have one report of very long startup times where this would have made a bigger difference (#323), but that's caused by a special configuration (a very high soft limit on the number of open files), and a change to avoid that problem is likely to go out in a new beta sometime in January. |
In that case I don't see a reason for not doing this by default. |
Relaunching the container seems to be causing problems in cyberpunk. I had to use its
If I do not set |
Was there any change to how |
Hello @wwmm, are you still experiencing this issue on an up to date system? |
Yes @kisak-valve. I tried the following
with Monster Hunter Rise and when I checked the affinity settings with At this moment I am using |
ValveSoftware/Proton#5927 might interest you as an alternative approach. |
Modern versions of pressure-vessel always behave like The environment variable is ignored, and the old
I'm not aware of any changes that would have affected CPU affinity behaviour, but it sounds as though there might be something that specifically affects CPU affinity and not other aspects of the execution environment? (But I don't know how that would happen... as far as I'm aware, CPU affinity is inherited in the same way as any other scheduling parameter.) |
I haven't done tests about the scheduling in a while. But |
I was not aware of |
Is it possible that Proton/Wine is resetting the CPU affinity, overruling whatever you set with |
I tried running a native Linux game under However, if the game itself is changing its CPU affinity, I suspect Wine will just pass that through to the Linux-side process that implements it, the same way that if you run
you'll find that the |
I did not consider this possibility. I tested now with As |
In older versions it was possible to set the CPU affinity using something like
taskset -c 0-4 %command%
in Steam launch options. It does not work in Proton 5.13. Is this a soldier bug?The text was updated successfully, but these errors were encountered: