Skip to main content

Using cgroup v2

fsched (fsched-10.87+) adds support for systems that use cgroup v2. On Ubuntu 22 hosts, in some cases you must manually configure systemd to ensure the system uses cgroup v2.

warning
  • On Ubuntu 22 hosts, first check /proc/1/cgroup. If there is only one line and it is 0::/init.scope, then the system is already using cgroup v2 and no extra configuration is needed. Otherwise, configure systemd as described below.
  • After modifying systemd, the host can no longer mount cgroup v1. Therefore, if SLURM is configured to use cgroup, you cannot install older fsched versions (before fsched-10.70). Otherwise, slurmd cannot start and the node will become unknown.

Configure systemd to ensure the system uses cgroup v2

On Ubuntu 22 hosts, if /proc/1/cgroup has multiple lines or the first line starts with a non-zero value, configure systemd as follows to ensure the system uses cgroup v2.

  1. Check /proc/1/cgroup and confirm systemd must be configured.

    root@jjtest-ubuntu22-3:~# cat /proc/1/cgroup
    2:cpuacct:/
    1:freezer:/
    0::/init.scope
  2. Modify grub to add the parameters systemd.unified_cgroup_hierarchy=1 systemd.legacy_systemd_cgroup_controller=0 cgroup_no_v1=all.

    For example, if GRUB_CMDLINE_LINUX is currently:

    root@jjtest-ubuntu22-3:~# grep -w GRUB_CMDLINE_LINUX /etc/default/grub
    GRUB_CMDLINE_LINUX="quiet splash net.ifnames=0 biosdevname=0"

    Then comment out the original GRUB_CMDLINE_LINUX line and set the new GRUB_CMDLINE_LINUX to append the cgroup parameters to the existing options:

    root@jjtest-ubuntu22-3:~# sed -e 's@^GRUB_CMDLINE_LINUX=@#GRUB_CMDLINE_LINUX=@' -i /etc/default/grub
    echo 'GRUB_CMDLINE_LINUX="quiet splash net.ifnames=0 biosdevname=0 systemd.unified_cgroup_hierarchy=1 systemd.legacy_systemd_cgroup_controller=0 cgroup_no_v1=all"' >> /etc/default/grub
  3. Update grub.

    root@jjtest-ubuntu22-3:~# update-grub
  4. Reboot the host to apply the new kernel command line options.

  5. Check /proc/1/cgroup. If the result is as follows, the configuration succeeded.

    root@jjtest-ubuntu22-3:~# cat /proc/1/cgroup
    0::/init.scope