VMware Communities
akornilov82
Contributor
Contributor

Over CPU usage in idle

I use VMware Player on Linux to run Windows 10.
The first issue I faced was Windows 10 UI freezing.
I have solved it by updating $USER/.vmware/preferences:
mks.gl.allowBlacklistedDrivers = "TRUE"
mks.enableMTLRenderer = "FALSE"
mks.enableGLRenderer = "TRUE"

Now Windows UI doesn't freeze and warning about hardware 3D acceleration absent on start doesn't appear, but when Windows 10 is in an idle state without any application running the CPU usage of VMware process is more than 150% (can reach 300% sometimes).
34380 akornil+ 20 0 18,8g 10,5g 10,4g S 150,7 16,9 41:45.10 vmware-vmx

Host: Debian 11
Guest: Windows 10 (include all latest updates)
Guest VM tools: 11.2.6
VMware® Workstation 16 Player: 16.1.2 build-17966106

Feel free to ask me about any logs to help solve the issue.

Thanks.

Reply
0 Kudos
19 Replies
akornilov82
Contributor
Contributor

glxinfo |grep -A 15 Extended
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Intel (0x8086)
Device: Mesa Intel(R) UHD Graphics 630 (CFL GT2) (0x3e98)
Version: 20.3.5
Accelerated: yes
Video memory: 3072MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.6
Max compat profile version: 4.6
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.3.5
OpenGL core profile shading language version string: 4.60

Reply
0 Kudos
RaSystemlord
Expert
Expert

I have no experience in this particular type of a problem, but ...

Is there a reason why you just didn't disable "3D hardware acceleration" in the VM settings, if there is a problem? I would first try that (and take away those parameters). I usually take it out, if I don't use any 3D programs on Windows - haven't noticed any bad effects. I try to keep the desktop functional rather than flashy - in principle - perhaps that is why acceleration doesn't seem to make any difference for me.

What do you mean by those percentage numbers? With 300%, do you mean that 3 threads (for instance out of 8 or 12) are working 100%? Maximum for the CPU is 100% in typical ways of measuring.

Reply
0 Kudos
akornilov82
Contributor
Contributor

I can try to disable "3D hardware acceleration" in the VM settings, but from my point of view, it is not a solution it's look like some trick or workaround without an understanding of the root cause of the issue.

150% of usage is an output of Linux's 'top' command. CPU usage of more than 100% is possible in multicores systems: https://unix.stackexchange.com/questions/34435/top-output-cpu-usage-100

 

Reply
0 Kudos
RaSystemlord
Expert
Expert

Well, like I said over 100% CPU load is not a typical way of measuring or let's say contemporary. I have attached you a picture how it looks on Kubuntu 2020.04.2 - there is no scale over 100%.

Reading the header of the link, it says 1.2 core load is possible ... and that is how you get more than 100% cpu load. Well, that assumes that core=cpu ... if you ask me, that is messing with established terminology. In my computer, I can get about 800% cpu load when doing flac to mp3 sound conversion - that doesn't make any sense and Kubuntu does not report it like that.

If not obvious, with modern processors, best of them go easily over nominal speed, if you let them (or rather, if you don't deny it) ... not sure how that is taken into account, but I don't think this was relevant to this discussion.

Disabling 3D hardware acceleration IS a solution, if you don't need it. If that is ON by default, it doesn't mean that you have to use it - you may discuss if that is a bug or a documented feature. Just to give you an idea of the past, not REALLY relevant, but still:
- 3D hardware acceleration did NOT work on high-end (price class 4000 euros) XP 32-bit OS Dell computers in VMware

- however, it DID work on Ubuntu 64-bit (don't remember the version anymore, probably under 10.x) with a moderate prized nVidia card
- what these examples mean is that getting it to work, is not an exact science and depends on many factors. I used it for OpenGL applications

But, like I said in the very beginning, I don't know if disable is the solution. Maybe somebody else can give you firmware parameters, which work better.

Reply
0 Kudos
akornilov82
Contributor
Contributor

The 'top' utility is not modern and was long before any UI tools. I don't think that such stable tool which used by millions users of Linux for many years has a bug in measure algorithm 🙂 But I think it is offtopic in this thread. Overusing of CPU by VMware Player is explicit.

I have disabled "3D hardware acceleration" but it only increases CPU usage.

 

Reply
0 Kudos
RaSystemlord
Expert
Expert

OK, if you also took away your firmware parameters and the situation is still the same, you need more advice from somebody else. If not obvious, please check what your Windows is doing - there may be something running, like an attempt to move into Win 11 (it DID happen to me, without a cancel option - connected to Microsoft login and its profile).

As for this, slightly off-topic (which was important to understand since you brought it up). I didn't say that there is an error. It just uses different terminology.

Top does NOT actually say "%Cpu is 1.2" (or similar). It says "%Cpu(s) is 1.2". Thus it clearly assumes that you have multiple CPUs in a single physical CPU-chip on the motherboard.

But you are right - sometimes CPU = Core. Sometimes the CPU is the physical CPU in terminology. Multiple meanings for the same thing are unfortunately rather common in IT-technology. (like object oriented, modem, router etc). Personally, I would like to stick into cpu-core-thread terminology since that clear terminology exists.

Reply
0 Kudos
akornilov82
Contributor
Contributor

I don't see that CPU usage in guest os is much high...

Reply
0 Kudos
wila
Immortal
Immortal

Hi,

The .vmx entries you added

First one: "allow blacklisted GPU drivers"... that tends to be not the best idea for stability. Not sure if the intel GPU is on a blacklist, but it isn't one of the most performant ones.

Then "enable Metal Renderer" set to FALSE ... umm... your Linux host has not metal renderer as it is not macOS.

"enableGLrenderer" to TRUE, tells Player to use the openGL renderer. That one is probably fine.

150%-300% CPU with only a few percent CPU in the windows guest isn't normal.

It might be that you overprovisioned the guest.
What is the host CPU?

How many CPU's did you assign to the guest?

A rule of thumb here is to assign no more than halve the physical cores to the guest (threads don't count)

--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
Reply
0 Kudos
akornilov82
Contributor
Contributor


@wila wrote:

Hi,

The .vmx entries you added

First one: "allow blacklisted GPU drivers"... that tends to be not the best idea for stability. Not sure if the intel GPU is on a blacklist, but it isn't one of the most performant ones.

But this solves issue with freezing UI on guest Windows.

Then "enable Metal Renderer" set to FALSE ... umm... your Linux host has not metal renderer as it is not macOS.

Ok. Removed. Thanks for advice!

"enableGLrenderer" to TRUE, tells Player to use the openGL renderer. That one is probably fine.

150%-300% CPU with only a few percent CPU in the windows guest isn't normal.

Totally agree 🙂

It might be that you overprovisioned the guest.
What is the host CPU?

cpu-info
Packages:
0: Intel Core i7-9700
Microarchitectures:
8x Sky Lake
Cores:
0: 1 processor (0), Intel Sky Lake
1: 1 processor (1), Intel Sky Lake
2: 1 processor (2), Intel Sky Lake
3: 1 processor (3), Intel Sky Lake
4: 1 processor (4), Intel Sky Lake
5: 1 processor (5), Intel Sky Lake
6: 1 processor (6), Intel Sky Lake
7: 1 processor (7), Intel Sky Lake
Logical processors (System ID):
0 (0): APIC ID 0x00000000
1 (1): APIC ID 0x00000002
2 (2): APIC ID 0x00000004
3 (3): APIC ID 0x00000006
4 (4): APIC ID 0x00000008
5 (5): APIC ID 0x0000000a
6 (6): APIC ID 0x0000000c
7 (7): APIC ID 0x0000000e

How many CPU's did you assign to the guest?

4

A rule of thumb here is to assign no more than halve the physical cores to the guest (threads don't count)

Correct in my case.

--
Wil


 

Reply
0 Kudos
RaSystemlord
Expert
Expert

"First one: "allow blacklisted GPU drivers"... that tends to be not the best idea for stability. Not sure if the intel GPU is on a blacklist, but it isn't one of the most performant ones.

But this solves issue with freezing UI on guest Windows."

----------------

Did you really try without 3D acceleration AND without these parameters?

If that isn't it, I faintly remember discussion here, when Intel motherboard graphics card is used, instead of a proper graphics card. Perhaps then you could achieve a proper situation with 3D acceleration ON. I don't remember how exactly you corrected the situation. @wila  ?

Reply
0 Kudos
akornilov82
Contributor
Contributor

No. I just disabled 3D acceleration without removing parameters.

So you think that parameters of 3D acceleration can affect performance with disabled 3D acceleration itself?

Reply
0 Kudos
RaSystemlord
Expert
Expert

Not really, but it is very easy to test and rule out. If you have an unknown bug somewhere, it's not logical to assume that you know where the bug is. If not obvious, if your Windows 10 Guest requires a hard reset in the problem situation, make a reliable backup from the Guest first.

Reply
0 Kudos
wila
Immortal
Immortal

Hi,

Sounds all fine...

Seems like that by allowing the blacklisted GPU driver to be used that the VM is capable of using 3D as you're no longer getting the error on boot. I already warned about the possible instability issues, but that is not your concern right now.

So what's CPU intensive for a VM?

- using a GPU software renderer - which explains why you see the CPU higher when not using the hardware renderer.
- having assigned too many CPU cores to a VM as then the host has troubles scheduling. As you indicated this _should_ not be your problem as your host has plenty of CPU scheduling opportunities left with 4 cores free.
- having a lot of network traffic in the VM. Network packets are routed by the CPU,  so that could take a lot of CPU if you are doing things like copying files over the network. Your screenshot has 0% network traffic.

Hmm.. none of the above applies for explaining high CPU in your case.

Did you enable any virtualisation options for the guest?

--
Wil

| Author of Vimalin. The virtual machine Backup app for VMware Fusion, VMware Workstation and Player |
| More info at vimalin.com | Twitter @wilva
Reply
0 Kudos
RaSystemlord
Expert
Expert

I have attached a couple of pictures from my system. On the surface, it seems that nothing happens, because Windows Update is running in the background. It is now in the Install phase. Top shows between 50%-150%, a more clearer picture of what is happening on the Host is attached. Network load is nothing.

Host is Kubuntu 20.04.02, guest is Windows 10 20H2.

Reply
0 Kudos
akornilov82
Contributor
Contributor

Hello,

Sorry for the delay. Please take a look at the attached screenshots (virtual machine CPU settings and CPU load on host and guest OS in the same time).
CPU load in guest Windows (4 cores of CPU provided to VM): 15%
CPU load in host Linux (GUI) by VMware process: 16%
'top' measure of Linux host of VMware process: 122.8%

In CPU settings of VM checked only 'Virtualize Intel VT-x' option.
Is it correct? Should I set other options to improve performance?

I use the whole NVM disk for Windows guest.
I have removed the check of 'Enable write cache...', is it correct?

Reply
0 Kudos
RaSystemlord
Expert
Expert

Thanks for these further details.

I don't know whether your choices have an effect or not - I can only compare to my system, which for one reason or the other, works correctly.

1. 

Virtualization options. I have all checked. In some previous comments, it has been mentioned that "CPU performance counters" need to be checked with Windows 10. (When you first (in the first screen) create a Win 10 VM, that's the only one possible to check).

2.

Not sure what the entire nVME-disk means, but mostly likely it means the max allocation for virtual disk(s). With SSD, traditionally, using more than 90% is leading to a fast deterioration of the disk. I'm not sure if that is relevant in all types of SSD anymore, could be. Now, if you have allocated the entire disk, you may use more than 90% depending on how your allocation is done. Mine is, not pre-allocated, is in slices - which is NOT the max performance setting, but typically just fine (only in special cases consideration should be something else, like with large Oracle databases (well over 10 GB, large is relative) with high-performance requirements).

3.

I have not changed Write Cache options. That may well affect performance, but does it affect dramatically CPU use - no idea.

Reply
0 Kudos
akornilov82
Contributor
Contributor

Hello,

I have found the "root of the evil" - VM starts freezing and strongly use CPU when kcompactd0 started on host which also use CPU 100%.
As I undersrand this tool do memory defragmentation and optimizations. I have 64Gb RAM on PC and 16 of them is owned by VM. So look likes kcompactd0 try to optmize 16Gb of VM RAM and it leads to freezing of VM. This service is enabled by default on Debian based distributives (include Ubuntu). On Fedora for example it disabled by default.
Solution here: https://gist.github.com/2E0PGS/2560d054819843d1e6da76ae57378989

The second minor cause is inside VM: Telemetry and Data Collection in Windows 10.
Solution here: https://wethegeek.com/how-to-disable-telemetry-and-data-collection-in-windows-10

akornilov82
Contributor
Contributor

Update: In my case kcompatd0 still appers from time to time and freezes VM.

I have found additonal information about settings for kcompatd0:
https://nitingupta.dev/post/proactive-compaction/

Guys from here https://forums.mageia.org/en/viewtopic.php?f=8&t=13913 reduced value from 20 to 10:
sudo sysctl -w vm.compaction_proactiveness=10

In my case the zero value works better:
sudo sysctl -w vm.compaction_proactiveness=0

Reply
0 Kudos
djbarrett
Enthusiast
Enthusiast

Here's a solution I haven't seen posted here: editing the .vmx file for the virtual machine. It seems to have worked for me. Credit: Timothy C. Quinn's answer to this question.

  1. Shut down the VM
  2. Open the <vm_name>.vmx file for the VM using a text editor
  3. Add the following to the end of the vmx file:
vm.compaction_proactiveness=0

Then save file and restart VM

Reply
0 Kudos