Problem setting processor affinity

Does anyone know how to set processor affinity with AMD 5950x? I’m trying to set it so it can use just 8 cores, but I get this error in the logs.

2025-06-11T13:09:52 MCEBuddy.AppWrapper.Base → Setting CPU affinity to → -16711936
WARNING> 2025-06-11T13:09:52 MCEBuddy.AppWrapper.Base → Error trying process priority or setting CPU affinity to → -16711936
System.ComponentModel.Win32Exception (0x80004005): The parameter is incorrect
at System.Diagnostics.Process.set_ProcessorAffinity(IntPtr value)
at MCEBuddy.AppWrapper.Base.Run()

Assuming you have 16 cores? Can you attach the conversion log file.

Could you also take a screenshot of the CPU affinity setting page in MCEBuddy so we can see what core you are trying to use.

It has 16 cores and 32 threads. I’ve been playing around with different patterns and most show the error.

Criminal Minds - S17E05 - Conspiracy vs Theory.mkv-Process TV Shows-2025-06-11T17-39-34.log (1.1 MB)

Try limiting it to only a combination of the first 16 (leave 17-32 unchecked) and see if the error goes away.

That appears to work.

2025-06-12T06:31:14 MCEBuddy.AppWrapper.Base → Setting CPU affinity to → 255

We’re trying to figure out what’s going on, if it’s an issue with the code or how logical processors are treated with the new AMD processors.

Could you try this, in your Processor Management page, select CPU’s 1 to 17 (all 16 on the first row and 1st from the second row). Then run a conversion and let me know what you see in the logs. Tx

I kind of went through a few test by adding a CPU each time. This is what I saw:

17 CPU affinity to → 131071
18 CPU Affinity to → 262143
19 CPU affinity to → 524287
20 CPU affinity to → 1048575
21 CPU affinity to → 2097151
22 CPU affinity to → 4194303
23 CPU affinity to → 8388607
24 CPU affinity to → 16777215
25 CPU affinity to → 33554431
26 CPU affinity to → 67108863
27 CPU affinity to → 134217727
28 CPU affinity to → 268435455
29 CPU affinity to → 536870911
30 CPU affinity to → 1073741823
31 CPU affinity to → 2147483647
32 had to remove check for 1 as it would not let me check all then I got:
Setting CPU affinity to → -2
WARNING> 2025-06-12T16:18:56 MCEBuddy.AppWrapper.Base → Error trying process priority or setting CPU affinity to → -2

1 Like

Awesome. Thats very helpful.

We’ve double checked things here and the code is as per the specs but it looks like Windows is having trouble with your 32nd logical core. We’re trying to figure out if it’s a bug with Windows or if it’s something with the system configuration which is causing the issue.

Can you check a few things:

  1. In windows task manager, is showing all 32 threads/logical processors?
  2. In your BIOS settings are all 32 enabled?

We have a theory but need your assistance to test something. Could you please try one more thing, it involves manual editing for the configuration file so order of steps in important.

  1. Click on the Stop button in MCEBuddy and ensure it’s stopped before proceeding (only the Start button should be available once the engine has stopped).
  2. Open the mcebuddy.conf file and look for the line CPUAffinity
  3. Change it to CPUAffinity=-1
  4. Save the file and close it
  5. Click on the Start button in MCEBuddy
  6. Now click the Add button and run a conversion (it doesn’t have to complete, just let it run a few steps for about 20-30 seconds)

If possible could you repeat the above steps but with CPUAffinity=-2147483648

Check the log files and post back what you see in there.

Yes, it shows 32 and the bios has everything enabled.

1 Like

Here are the results:

Setting CPU affinity to → -1

2025-06-18T16:56:41 MCEBuddy.AppWrapper.Base → Setting CPU affinity to → -2147483648
WARNING> 2025-06-18T16:56:41 MCEBuddy.AppWrapper.Base → Error trying process priority or setting CPU affinity to → -2147483648
System.ComponentModel.Win32Exception (0x80004005): The parameter is incorrect
at System.Diagnostics.Process.set_ProcessorAffinity(IntPtr value)
at MCEBuddy.AppWrapper.Base.Run()

Thanks. So it appears there’s one of 2 things happening:

  1. Windows (the software API’s) has a bug, it won’t let MCEBuddy enable/disable the 32nd core thread
  2. The system / board / bios configuration has an issue where Windows either not recognizing the 32nd core thread or is unable to manage it

It seems to be working for the core threads 1-31.

Are you able to see the 32nd core thread in the task manager? Are you able to select just the 32nd core thread in the task manager for any process through task manager?

A quick to test where the issue may lie in a few steps:

  1. Start the MCEBuddy GUI (app) and keep it open
  2. Open a command prompt by going to Run and starting/typing cmd.exe
  3. In the command line, type in
    powershell.exe "Get-Process MCEBuddy.GUI | Select-Object ProcessorAffinity"
  4. That should give the default processor mask assigned, let me know what it
  5. Now type in
    powershell.exe "$proc = Get-Process MCEBuddy.GUI; $proc.ProcessorAffinity = 0x80000000"
  6. This should force MCEBuddy GUI to be assigned to the 32nd core thread. If it succeeds there will be no error and now we know that the 32nd core thread can infact be used and there’s no issue with the system/board/bios config. If you however see an error (let me know it is), then it’s likely a Windows API problem.

Not sure if this helps, but I used powershell to show the affinity and then removed the 32 process using task manager. This is what it showed:
all 32:
PS E:\plex> .\get_proc.ps1
Processor Affinity for Notepad: 4294967295
first 31:
PS E:\plex> .\get_proc.ps1
Processor Affinity for Notepad: 2147483647
PS E:\plex>

1 Like

That’s a very helpful script, however I’m assuming your running 64bit windows so you test notepad was run in 64 bit mode. The problem here is that some of the components in MCEBuddy run in 32bit (WOW64) for compatibility reasons and that’s where the issue appears to be stemming from.

Could you redo your own test script but with a 32bit program in WOW64 mode.

You can start a 32bit notepad in WOW64 from %windir%\SysWOW64\notepad.exe

If you can get the same results while running in 32 bit WOW64 that would confirm the likely root cause of the problem.

It looked like that version of notpad still shows as x64 in task manager. I did use mobaxterm which shows as x86 and it shows the same values:

PS E:\plex> .\get_proc.ps1
Processor Affinity for Notepad: 4294967295
PS E:\plex> .\get_proc.ps1
Processor Affinity for Notepad: 2147483647

Perfect, Thanks, it appears to be a bug with the windows .net API’s. Let us see if we can find a workaround for it.

Ok, we have a workaround and fix for the setup. Try today’s 2.6.6 beta build. You will need to go back into the settings and reverify your processor setup and re-save it for the changes to take effect.

With this build you can select up to 64 logical cores/threads (for 64 bit systems and 32 for 32 bit systems).

Can you try to select the 32nd processor (all processors or just the 32nd) and then without the 32nd and see how it goes.

Please feel free to post the logs here (success and failures) so we can compare them to our expected results.