6

Instructions for enabling the memory cgroup on Ubuntu 18 and 19 involve adding cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to /boot/firmware/nobtcmd.txt and restarting. After rebooting, grep mem /proc/cgroups should show it as enabled.

I find that on Ubuntu 20.04 the above instructions are not working for me, and Kubernetes continues to error [ERROR SystemVerification]: missing cgroups: memory. Any suggestions?

Com
  • 141

2 Answers2

8

I was able to get this working by appending cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to the file /boot/firmware/cmdline.txt. Changes made to /boot/firmware/nobtcmd.txt in Ubuntu 20.04 appear to be ignored (there's a note in config.txt about cmdline=nobtcmd.txt being deprecated in favour of include commands).

Com
  • 141
5

On 22.04 (kernel 5.15.0) booting via Grub:

  • add cgroup_enable=memory cgroup_memory=1 to GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub;
  • followed by sudo update-grub and kernel reboot.

Verify with cat /proc/cmdline.

ulidtko
  • 5,782
  • 2
    GRUB_CMDLINE_LINUX="cgroup_enable=memory cgroup_memory=1 systemd.unified_cgroup_hierarchy=0" issue – Time Killer Dec 25 '22 at 09:23
  • 2
    After upgrade to 22.04, Docker failed to start complaining about "Your kernel does not support cgroup memory limit". This fixed it. – andrei Mar 01 '23 at 15:16