CPU Cores / Virtual Cores reported by Linux to WINE application

Questions about Wine on Linux
Locked
aidyw
Newbie
Newbie
Posts: 1
Joined: Sat May 06, 2023 11:00 am

CPU Cores / Virtual Cores reported by Linux to WINE application

Post by aidyw »

Hi,
I have been using WINE for many years to run an application called LTSpice. For those who are not aware it is a circuit simulator and schematic capture tool. It works quite well and I believe although it is a native Windows app, it does actually have some tweaks available (optional CLI switch) which helps it run under wine and specifically WINE. Therefore the author is well aware and supportive of WINE.

For many years I have been running a Quad core Intel Duo processor none hyper-threading CPU. This worked wonderfully and LTSpice was able to 100% max out all 4 cores with 4 separate threads during simulation.

I just upgraded after some 15 years to a new Ryzen R9 5950X 16 Core hyper-threading (32 virtual core) processor.

LTSpice has good controls available to make use of multi-threading and it is possible to define in LTSpice how many total threads to allow. The maximum is obtained somehow by interacting with the OS. Now in my case this is WINEs layer. In the past I would see a maximum of 4 threads. One for each core on the Quad Duo Intel. Now I see a maximum of 16 threads. It would seem again one thread for each CORE on the Ryzen. But NOT one thread per virtual core. ie. max 32 threads.

I do not know for sure if LTSpice has a maximum limit on the threads it will handle. I can not find this information, but nothing suggests that it does.

When I look in Linux I always see 32 processors available, all the tools (htop, glances, mpstat etc) report 32 processors. I know that it is virtual processors, but still I see 32. When I run LTSpice with 16 threads, I see a maximum of 50% CPU utilisation. I am fairly convinced that the actual CPU usage is much higher than this, but because LTSpice is limited to 1 thread per core, the system tools don't correctly report the actual CPU usage.

It is probably fair to say that CPU usage is pretty high but without any concurrency on each core due to the fact the only a single thread is running on any 1 core. Therefore if stalls are occurring then this thread is having to wait rather than the core switching context.

So finally my question. How does WINE report the number or processors to an application. Is it limited to the number of real Cores (as it would seem by max 16 threads), or does it report number of virtual cores 32 and the limits I see are related to the multi-threading implementation within LTSpice.

How can I query what is being reported within the WINE environment. I have tried to run some of MS tools to get this information, but with no luck. Therefore I am guessing is this the OS layer failing to report 32 CPU or is this LTSpice that will only run 1 thread per real CORE, or that is hard-coded to a 16 thread limit and this co-incidentally is the same as the number of real Cores I now have in my system?

I'm running Ubuntu 22.04.2
Wine v6.0.3

All the best
Aidan
Locked