WINE 6.0.3 throwing errors on 400+ core/1.5TB RAM Linux server

Questions about Wine on Linux
Locked
martinfg2
Newbie
Newbie
Posts: 3
Joined: Tue Sep 13, 2022 9:59 pm

WINE 6.0.3 throwing errors on 400+ core/1.5TB RAM Linux server

Post by martinfg2 »

WINE Development Team,

I am supporting a team using a rather large (400+ core, 1.5TB RAM) multi-user Linux server, and one issue we have run into involves using WINE to run a Windows application inside rootless containers/pods for various users. I have built WINE v6.0.3 (32-bit to support my application) on a development machine, confirmed it worked nominally, containerized it, confirmed nominal operation, moved the container image to the large server, then experienced 40+ second delays to simply run "wine notepad.exe", with a number of unusual errors thrown before notepad appears and subsequently works as expected. Things I have tried (all using basically identical OS=RedHat8.6):
- ran same container image on single-core/16GB RAM VM - WINE worked nominally
- rebuilt WINE v6.0.3 64-bit on large server - same errors just trying to run notepad.exe
- rebuilt WINE v6.0.3 in a WOW64 config - same errors

I am suspecting that WINE does not handle huge numbers of CPU cores or large available RAM sizes well, but can't find any documentation explicitly stating that. When I crank up the debugging, I can see that WINE is kicking off each child process with NUMBER_OF_PROCESSORS=400 as part of the invocation. Using regedit to change that value in HKLM doesn't seem to help - it gets overwritten when I run WINE the next time. The errors seem to be with all the services that wineserver initiates, such as "mountmgr", "plugplay", "winebus", "NDIS", etc - about 10 seconds for each. If I start a "wineserver -p", then I can avoid the delays on subsequent runs of WINE within that running container, but our use case means most of these containers running WINE would be ephemeral rather than persistent.

If anyone can suggest a method to build WINE such that it ignores enumeration of CPU cores and sets "NUMBER_OF_PROCESSORS=1", that might be helpful to troubleshoot further. I am also open to the idea that the number of processors or the huge RAM is not the issue. Here are some additional details:

WINE v6.0.3, built on RHEL 8.6 Linux host
ERRORS:
err:service:validate_context_handle Handle is of an invalid type (1, 2)
err:ole:start_rpcss Failed to start RpcSs service
err:ole:NDRCContextBinding invalid handle <hex#>
fixme:service:scmdatabase_autostart_services Auto-start service "Eventlog" failed to start: 1053
...
......"MountMgr" failed to start...
......"NDIS"....
......"PlugPlay"...
......"winebus"....

Thanks in advance for any assistance! I am planning to pursue grabbing the latest WINE v7.xx version to try that, but I have to jump through some administrative hoops to get it to my large server, which could take weeks. My current best workaround is simply to minimize the number of auto-start services, so I can reduce the initial delay to around 12 seconds. Other advice for either workarounds, troubleshooting, or solutions is most welcome!

-Martin G.
spoon0042
Level 6
Level 6
Posts: 566
Joined: Thu Dec 24, 2009 11:00 am

Re: WINE 6.0.3 throwing errors on 400+ core/1.5TB RAM Linux server

Post by spoon0042 »

I know linux has 'taskset' for tying a process to one or more processors, on a typical system anyway. No idea how that interacts with VMs on 400 processors. Seems to me there should be some way to do that one way or another.

It's also possible wine wasn't designed with such a system in mind. Seems like it shouldn't be seeing physical processors if it's in a VM but who knows. In the wine tree I have here NUMBER_OF_PROCESSORS looks like it's just set in the registry (in programs/wineboot/wineboot.c) based on the NumberOfProcessors value in some data structure. You could track down where that is set up but hacking the source should probably be a last resort. Unless whatever wine is doing could be considered a bug, anyway.
martinfg2
Newbie
Newbie
Posts: 3
Joined: Tue Sep 13, 2022 9:59 pm

Re: WINE 6.0.3 throwing errors on 400+ core/1.5TB RAM Linux server

Post by martinfg2 »

@spoon0042: Thanks for the reply! I did try using taskset, but that had no effect on the delays or the variable NUMBER_OF_PROCESSORS I could see being passed to wine components being invoked behind the scenes. I agree my scenario is probably not the normal use-case the developers had in mind. As it happens, my 400+ CPU system is a physical machine, not a VM. Hacking the wineboot.c code to just jam-set NUMBER_OF_PROCESSORS=32 might be interesting to try, thanks for locating that.
martinfg2
Newbie
Newbie
Posts: 3
Joined: Tue Sep 13, 2022 9:59 pm

Re: WINE 6.0.3 throwing errors on 400+ core/1.5TB RAM Linux server

Post by martinfg2 »

UPDATE: Setting NUMBER_OF_PROCESSORS=32 in the registry by changing wineboot.c and recompiling has no effect on the problem, probably because it does not seem to be read by any of the other WINE components - they use the same call that wineboot.c uses to determine the number of processors, not the registry entry. I have also been playing with running the container specifying --cpuset-cpus=0-23 , which is reflected when I run "nproc" inside the container, but NOT when I try "lscpu", and not when I run WINE - if I bring up regedit, besides the errors and delays, I can still see the registry being populated with NUMBER_OF_PROCESSORS=400. Any other ideas? And note that the issue could still be the 1.5TB of available RAM rather than the number of CPUs, but various 64-bit versions of Windows support more than that.
Locked