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

Add support for hosts that have both CGroups v1 and v2 #125

Open
HenrikBengtsson opened this issue Jan 17, 2025 · 2 comments
Open

Add support for hosts that have both CGroups v1 and v2 #125

HenrikBengtsson opened this issue Jan 17, 2025 · 2 comments
Milestone

Comments

@HenrikBengtsson
Copy link
Collaborator

The availableCores() function queries CGroups for CPU limits. It supports both CGroups v1 and CGroups v2. However, it does not handle hosts that have both CGroups v1 and CGroups v2 enabled at the time. When such a host is discovered, a warning is produced;

> ncores <- parallelly::availableCores()
Warning message:
In getCGroupsRoot(controller = controller) :
  Mixed CGroups versions are not supported:cgroup2’, ‘cgroup

This warning means that it detected that both CGroups v1 (cgroups) and CGroups v2 (cgroups2) were discovered on the current machine, but that the current implementation does not know how to navigate that and will simply ignore both of them. One reason for not support this case is that I do have access to a machine is configured this way.

Now, today, @skertberg reported (futureverse/future#758) that they experienced this on one of their machines, which provides an opportunity to implement support for this mixed case.

@skertberg, I've updated the internals of parallelly to allow us to gather some more information about your CGroups v1+v2 setup, which would allow me to start working on this. Could you please install parallelly (>= 1.41.0-9004) by calling:

remotes::install_github("futureverse/parallelly", ref="develop")

Then, after restarting R, call:

> parallelly:::cloneCGroups()
[1] "cgroups.tar.gz"

This saves a file cgroups.tar.gz to the current directory. Could you please send that file to me? That way I'll be able to implement and test support for your machine too.

@HenrikBengtsson
Copy link
Collaborator Author

@cmicek1, in #124 (comment) you mentioned you also get this warning. If so, could you please install the develop version;

remotes::install_github("futureverse/parallelly", ref="develop")

restart R, and call:

> parallelly:::cloneCGroups()
[1] "cgroups.tar.gz"

Could you please send me the cgroups.tar.gz to file that was saved to the current directory?

@cmicek1
Copy link

cmicek1 commented Jan 19, 2025

Here you are!

cgroups.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants