Wine Multi CPU max usable Threads

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
pyblackout
Level 1
Level 1
Posts: 5
Joined: Sat Jun 23, 2018 3:28 pm

Wine Multi CPU max usable Threads

Post by pyblackout » Fri Apr 19, 2019 8:58 am

Hey I tested cpuz benchmark and also cinebench with different windows OS versions win 10, win server with wine
but I'm always stuck at 64 threads.
Is there something I can do to remove this limitation?
recompile something, .... NUMA ???
anything.

I have a Supermicro X11DPH-T
2x Xeon 8160 with 24 Core / 48 Threads (96Threads together)
Thanks for any hints

User avatar
Bob Wya
Level 12
Level 12
Posts: 2772
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: Wine Multi CPU max usable Threads

Post by Bob Wya » Sun Apr 21, 2019 9:37 am

@pyblackout

I'm not familiar with any hard limits, that Wine imposes, on thread counts...
But I gather 64-bit Windows should support 256...

Perhaps a debug log of ntdll would elicit some useful info...
What's the output with:

Code: Select all

export WINEDEBUG=+tid,+ntdll
wine ...
Looking specifically at the internal functions:
void fill_cpu_info()
ULONG WINAPI NtGetCurrentProcessorNumber().

Also running wineserver, via strace:

Code: Select all

strace wineserver -f
might pick up a thread creation limit??

If we get stuck, I can always ping a Wine Developer (or two) for further help! 8)

I presume NUMA isn't an issue - if you can bust through the (single-core) thread limit of 48...
But that would be an obvious issue. I know Wine takes some shortcuts with NUMA support, looking at the source code:

Code: Select all

/**********************************************************************
 *           GetNumaHighestNodeNumber     (KERNEL32.@)
 */
BOOL WINAPI GetNumaHighestNodeNumber(PULONG highestnode)
{
    *highestnode = 0;
    FIXME("(%p): semi-stub\n", highestnode);
    return TRUE;
}

/**********************************************************************
 *           GetNumaNodeProcessorMask     (KERNEL32.@)
 */
BOOL WINAPI GetNumaNodeProcessorMask(UCHAR node, PULONGLONG mask)
{
    FIXME("(%c %p): stub\n", node, mask);
    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    return FALSE;
}

/**********************************************************************
 *           GetNumaNodeProcessorMaskEx     (KERNEL32.@)
 */
BOOL WINAPI GetNumaNodeProcessorMaskEx(USHORT node, PGROUP_AFFINITY mask)
{
    FIXME("(%hu %p): stub\n", node, mask);
    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
    return FALSE;
}
You'd want to 'pastebin' (obviously alternatives are available!) the terminal logs.

Bob

pyblackout
Level 1
Level 1
Posts: 5
Joined: Sat Jun 23, 2018 3:28 pm

Re: Wine Multi CPU max usable Threads

Post by pyblackout » Tue Apr 23, 2019 12:27 pm

Hey Thank you so much

first I did winedebug as mentioned

and found following line

Code: Select all

002a:fixme:ntdll:create_logical_proc_info Improve CPU info reporting: system supports 96 logical cores, but only 64 supported!
So I digged deeper and found

https://github.com/wine-mirror/wine/blo ... nt.c#L1687

It's freaky that there are over 22500 "FIXME" in the wine project :)

I don't know if I have that much time to work it out, but if someone is here who is involved I would be pleased.
Or at least if someone would tell me what to do and what I have to take in mind.

User avatar
Bob Wya
Level 12
Level 12
Posts: 2772
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: Wine Multi CPU max usable Threads

Post by Bob Wya » Tue Apr 23, 2019 1:28 pm

@pyblackout

Nice catch! 8)

OK so it is a NUMA issue..

Arising from: SetThreadAffinityMask function()
To quote MSDN:
On a system with more than 64 processors, the affinity mask must specify processors in the thread's current processor group.
The obvious first solution would be (if possible) to split your workload into two.
Running a wineserver instance on each NUMA node.

Otherwise...
My cursory look at the Wine Source, would imply that a fair bit of refactoring would be required... :cry:

Bob

User avatar
Bob Wya
Level 12
Level 12
Posts: 2772
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: Wine Multi CPU max usable Threads

Post by Bob Wya » Wed Apr 24, 2019 2:58 pm


User avatar
Bob Wya
Level 12
Level 12
Posts: 2772
Joined: Sat Oct 16, 2010 7:40 pm
Location: Cambridge
Contact:

Re: Wine Multi CPU max usable Threads

Post by Bob Wya » Fri Apr 26, 2019 1:12 pm

@pyblackout

Not to deter you from your mission to fix Wine's processor groups... But... :wink:
Surely if you try to address 48 cores using a single WINEPREFIX.
Then the resulting single-threaded wineserver process is surely going to cause one huge bottleneck!
The cross-NUMA wineserver communication will surely reduce your core scaling enormously.

I can't see any way around that issue...
Although the eventfd_synchronization patchset in Wine Staging might help a bit.

Just my personal $0.02 as always... 8)

Bob

Locked