Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Suspend when non-BOINC CPU usage is above" setting fails with VirtualBox tasks #5841

Open
JonathanBush opened this issue Oct 7, 2024 · 7 comments

Comments

@JonathanBush
Copy link

Describe the bug
BOINC client detects VirtualBox Headless Frontend as non-BOINC CPU usage and pauses computation based on the "Suspend when non-BOINC CPU usage is above" setting.

Steps To Reproduce

  1. Attach a project that uses VirtualBox (e.g. LHC@home). VirtualBox must be installed. Project should be set to utilize all available cores.
  2. In Advanced View, open Computing Preferences. Enable the "Suspend when non-BOINC CPU usage is above" and enter 90 in the text field. Save the new computing preferences.
  3. Ensure that "Run based on preferences" is selected in the Activity menu.
  4. Observe CPU usage in Task Manager. Ensure that no other user processes have high CPU utilization.
  5. Wait for a VBox task to initialize and start heavy computation. If this bug is reproducible, you should see the task status switch to "Suspended - CPU is busy" and see "Suspending computation - CPU is busy" in the event log.

Expected behavior
BOINC should continue running until non-BOINC CPU load exceeds the set threshold.

System Information

  • OS: Windows 10
  • BOINC Version: 8.0.2

Additional context
I enabled this setting with a non-BOINC utilization percentage of 90% so that BOINC would pause when I run workloads that need full use of the CPU cache. Recently noticed this issue with LHC@home tasks. I also noticed that the VM keeps running in the background when BOINC is suspended.

@davidpanderson
Copy link
Contributor

The BOINC client looks for a program called 'VBoxSVC.exe' (case sensitive) and, if any VM apps are running,
counts its CPU time as due to BOINC.

To check this, can you please (while a BOINC VM app is running)

  • run Task Manager (ctrl-alt-del)
  • look for 'VirtualBox Interface' under Background Processes
  • check its CPU usage (should be high)
  • right-click on it and select Properties
  • verify that the program name is exactly 'VBoxSVC.exe'

Let me know if this is what you see.
Also let me know what version of VBox you have installed
(run VirtualBox Manager, click Help / About Virtualbox)

Thanks -- David

@JonathanBush
Copy link
Author

I see 'VBoxSVC.exe' running, but its CPU utilization is 0%. The high CPU utilization is coming from one instance of 'VBoxHeadless.exe'. This was running VirtualBox 6.1.50. I also upgraded to VirtualBox 7.0.20 and observed the same behavior

@davidpanderson
Copy link
Contributor

Aha. That's the culprit. We'll fix it ASAP. Thanks.

@AenBleidd AenBleidd removed the Validate label Oct 8, 2024
@computezrmle
Copy link
Contributor

VBoxSVC typically maintains the command queue sent by VBoxManage or the Vbox GUI.
It's CPU usage is very low with small peaks when a VM is created, modified or shut down.
Nonetheless those cycles should be counted for BOINC to avoid the total non-BOINC value goes right above the limit.

There may be more than one VBoxSVC instance on the same computer, 1 per user account running Vbox VMs.
Example:
VBoxSVC_1: related to a VM started by a service at boot time
VBoxSVC_2: related to an account running BOINC

Here, VBoxSVC_1 doesn't count for BOINC.

@JonathanBush
Copy link
Author

It looks like BOINC already has access to the PID of the VBoxHeadless.exe instance (PID shown in stderr.txt in the slots dir matches PID shown in Task Manger), so would it be possible to include only the CPU utilization from the known BOINC VM PID(s)? This would address @computezrmle's concern about non-BOINC VMs.

@davidpanderson
Copy link
Contributor

It would be possible but I doubt that happens in practice
(running BOINC/LHC and running another CPU-intensive VBox VM)
so let's hold off.

BTW, looking at the vboxwrapper code (vbox_common.cpp)
I see a function VBOX_BASE::launch_vboxvm() that's never called.
Should we remove it?

@computezrmle
Copy link
Contributor

What people run inside separate VMs:

  • special services like mailservers
  • compile jobs
  • other DC clients like Folding at Home
  • even other BOINC clients

There are also people running multiple BOINC clients concurrently on the host and each of them may run VirtualBox VMs.

As for VBOX_BASE::launch_vboxvm():
Yes, it is never called.
I'll prepare a PR to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

No branches or pull requests

4 participants