7950X3D: CPU Sets behave like Affinities

Started by Garouga, October 29, 2023, 07:14:18 AM

Previous topic - Next topic

Garouga

I have a 7950X3D and when I create a rule for CPU sets, the application never uses CPUs outside the set.

This can easily be reproduced with Cinebench: As soon as a CPU sets rule is in place, the application behaves like it has been assigned a hard affinity.

I have disabled the AMD 3D Cache optimization, turned off Windows Game Mode and set the BIOS to prefer the frequency, enabled Performance mode and the Bitsum Highest Performance mode in Process Lasso. However, the problem persists.

From what I understand, the application should "spill over" to other CPUs if more threads are needed? Might I be missing something?

Jeremy Collake

#1
Your experience is a common disappointment with CPU Sets. Since they are a native Windows feature, we have no control over how they are enforced, or when spill-over is allowed. It seems to vary a lot between CPU models, and the parameters Windows uses are still mysterious.

We hope to better document the behavior of CPU Sets in the future. For the moment, this is the only answer I have.
Software Engineer. Bitsum LLC.

Garouga

Thanks for the information. It would be interesting to know how CPU Sets behave on Intels CPUs with their P-Cores and E-Cores.

When I heard that games like Starfield and Metro Exodus behaved weirdly when affinity-locked, the CPU Sets seemed to be the perfect solution. Everything is working fine for now, though I haven't tried those games yet.

Garouga

Quote from: Jeremy Collake on October 30, 2023, 07:01:56 AM...
We hope to better document the behavior of CPU Sets in the future. For the moment, this is the only answer I have.

I did some quick testing and found the following (odd?) behavior in Cinebench when enforcing confilcting rules:
  • Using Process Lasso Pro: Rules for CPU Sets (0-15) and CPU affinities (16-31) --> The affinity is ignored and the process runs exclusively on threads 0-15. According to Microsoft's documentation,
    QuoteIf a thread or process has a restrictive affinity mask set, the affinity mask is respected above any conflicting CPU Set assignment
    However, this doesn't seem to be the case. The rule for CPU Sets overrides any affinity assignment.
  • Using Process Lasso Pro: Rules for CPU Sets (0-15) and using Windows 11 Task Manager: CPU affinities (16-31) --> Nothing happens, Cinebench cannot use any of the CPUs.

It appears that CPU affinities are handled differently in Process Lasso and the Windows 11 Task Manager. Additionally, the CPU Sets do not behave according to Microsofts own documentation. Is this an expected behavior of Process Lasso or could this be a bug?

Jeremy Collake

#4
That's an interesting observation!

I believe any perceived difference in behavior is due to the order of operations (affinity or sets applied first), and/or if the changes are made before or after the threads begin their work, with the latter being most likely.

In some quick testing, current Windows 11 builds will not enforce a CPU affinity change to the process on already running threads. In other words, when a thread is already scheduled, it won't be immediately moved if the process's affinity is changed.

We will need to study this more, but it is not due to any bug in Process Lasso. Thank you for bringing it to our attention.
Software Engineer. Bitsum LLC.

Garouga

Thanks for the quick reply.

It does seem like the CPU Sets rule from Process Lasso it applied after the threads start to work. I can see all cores working for a second or two after the Cinebench run has started. After that brief period of time, only the cores assigned in the CPU Set continue to run.

florencepugh

Quote from: Garouga on October 29, 2023, 07:14:18 AMI have a 7950X3D and when I create a rule for CPU sets, the application never uses CPUs outside the set.

This can easily be reproduced with Cinebench: As soon as a CPU sets rule is in place, the application behaves like it has been assigned a hard affinity.
I have disabled the AMD 3D Cache optimization, turned off Windows Game Mode and set the BIOS to prefer the frequency, enabled Performance mode and the Bitsum Highest Performance mode in Process Lasso. However, the problem persists.

From what I understand, the application should "spill over" to other CPUs if more threads are needed? Might I be missing something?

You're right, CPU Sets in Process Lasso shouldn't restrict Cinebench entirely. You can check your rule configuration, and ensure enough cores are included in the set.

Garouga

Quote from: florencepugh on March 27, 2024, 04:05:27 AMYou're right, CPU Sets in Process Lasso shouldn't restrict Cinebench entirely. You can check your rule configuration, and ensure enough cores are included in the set.


I have only the 8 Cache Cores in the Set and was hoping the Windows scheduler would allow more Cores to be used if the utilization of the Set is high enough. ("Spill over") That is how I understand the concept of CPU Sets versus hard affinities, at least.

maruusa

#8
Review the settings in your application to see if there are any options regarding the use of multiple CPU threads. You may need to adjust this setting so that the application uses all CPU cores and threads.

tromp33

Could you guide how to configure CPU Sets in Process Lasso to ensure optimal utilization of CPU cores and threads, particularly in scenarios where applications may benefit from using all available CPU resources?
dinosaur game

wyliec2

I recently purchased a 7950X and do a lot of video encoding.

Some encodes use 85%+ CPU utilization and run consistently.

Others only use 45-50% CPU - these vary dramatically in processing time and my presumption is that this is due to how worker processes are distributed over the two CCX cores.

CPU Sets sounded like an ideal solution to configure 'preferred cores' while still allowing access to additional cores as needed.

I was considering purchasing the Pro license for the CPU Set configurability but based on this discussion, it seems that it doesn't actually work due to Windows limitations???

 :'(

Jeremy Collake

Quote from: wyliec2 on June 16, 2024, 09:42:55 AMI was considering purchasing the Pro license for the CPU Set configurability but based on this discussion, it seems that it doesn't actually work due to Windows limitations???

YMMV, so I encourage you to try CPU Sets. If you are beyond your trial period, then you can request a refund after purchase if it doesn't work out for you.
Software Engineer. Bitsum LLC.

wyliec2

Quote from: Jeremy Collake on June 16, 2024, 01:21:23 PMYMMV, so I encourage you to try CPU Sets. If you are beyond your trial period, then you can request a refund after purchase if it doesn't work out for you.

Thanks for the quick reply!

I'll give it a try.

wyliec2

Quote from: Jeremy Collake on June 16, 2024, 01:21:23 PMYMMV, so I encourage you to try CPU Sets. If you are beyond your trial period, then you can request a refund after purchase if it doesn't work out for you.

I tried it and unfortunately the result is exactly like CPU Affinity. Creating a CPU set rule locks the process to only those logical processors with no spillover to other idle cores.