Cgroup - vim4 Ubuntu 22.04

How do I enable the below cgroup settings in ubuntu 22.04? Usually on the raspberry pi I add the following to cmdline.txt file. How do I add this on Khadas ubuntu 22.04?

cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory

Edit /boot/uEnv.txt to add cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory to boot_user_args=.

e.g.

boot_user_args=cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory

Save the file and reboot.

Still getting these errors:

time=“2022-08-03T13:28:49.486267788Z” level=warning msg=“Failed to find cpuset cgroup, you may need to add “cgroup_enable=cpuset” to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)”
time=“2022-08-03T13:28:49.486307453Z” level=error msg=“Failed to find memory cgroup, you may need to add “cgroup_memory=1 cgroup_enable=memory” to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)”
time=“2022-08-03T13:28:49.486352036Z” level=fatal msg=“failed to find memory cgroup, you may need to add “cgroup_memory=1 cgroup_enable=memory” to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)”
2022/08/03 13:28:49 [FATAL] k3s exited with: exit status 1

Hello @mikev1963

What are these errors come from?

these are logs from the docker container.

I am running the following:
sudo docker run -d --privileged --restart=unless-stopped --name rancher -p 4080:80 -p 4443:443 rancher/rancher:v2.5.8

It appears it is not possible to set cgroup information ?

I guess I stumpe numbqq from Khadas support team. He has no clue on how to setup cgroups. This would have been.a nice SBC for Kubernetes, but he can’t figure out how to modify the cgroups. Very sad. I guess this will go into the bottom of the draw and collect dust.

Hello @mikev1963

Sorry for the late reply, could you please provide the clear steps you do on your side? So that we can try to reproduce this issue in our side.

Thanks.

I have the following settings. Not sure how to get the cgroup settings to work.

$ cat /boot/uEnv.txt
#############################DO NOT TOUCH THIS OPTION#############################
rootdev=root=UUID=64acfb24-d636-498d-9ef3-3d9fc7af72e7
partitiontype=partition_type=generic
#############################DO NOT TOUCH THIS OPTION#############################
## Add user args here, spilt with space.
## e.g. Add bootargs 'test1=111 test2=222'
## boot_user_args=test1=111 test2=222
boot_user_args='cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory'
cgroup_enable=cpuset
cgroup_memory=1
cgroup_enable=memory
$ cat /proc/cgroups
#subsys_name	hierarchy	num_cgroups	enabled
cpuset	0	154	1
cpu	0	154	1
cpuacct	0	154	1
blkio	0	154	1
memory	0	154	1
devices	0	154	1
freezer	0	154	1
net_cls	0	154	1
perf_event	0	154	1
net_prio	0	154	1
pids	0	154	1

It appears the cgroup settings above are not taking effect.

Here is the Docker Process I am running:

sudo docker run -d --privileged --restart=unless-stopped --name rancher -p 80:80 -p 443:443 rancher/rancher:v2.5.8

Here are the log errors:

time=“2022-08-08T13:27:20.944810679Z” level=info msg=“Wrote kubeconfig /etc/rancher/k3s/k3s.yaml”
time=“2022-08-08T13:27:20.944878677Z” level=info msg=“Run: k3s kubectl”
time=“2022-08-08T13:27:20.945141797Z” level=warning msg=“Failed to find cpuset cgroup, you may need to add "cgroup_enable=cpuset" to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)”
time=“2022-08-08T13:27:20.945176421Z” level=error msg=“Failed to find memory cgroup, you may need to add "cgroup_memory=1 cgroup_enable=memory" to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)”
time=“2022-08-08T13:27:20.945210462Z” level=fatal msg=“failed to find memory cgroup, you may need to add "cgroup_memory=1 cgroup_enable=memory" to your linux cmdline (/boot/cmdline.txt on a Raspberry Pi)”
2022/08/08 13:27:20 [FATAL] k3s exited with: exit status 1

How can I find such logs ? I checked on my side with latest 220721 server image installed with OOWOW, I can’t find such logs.

Here are the steps:

$ sudo -i 
# apt-get update
# mkdir -p /etc/apt/keyrings
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# apt-get update
# apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
# docker run -d --privileged --restart=unless-stopped --name rancher -p 80:80 -p 443:443 rancher/rancher:v2.5.8

Check docker container:

root@Khadas:~# docker ps
CONTAINER ID   IMAGE                    COMMAND           CREATED          STATUS         PORTS                                                                      NAMES
2065263abd93   rancher/rancher:v2.5.8   "entrypoint.sh"   10 minutes ago   Up 2 seconds   0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   rancher

System information:

root@Khadas:~# cat /etc/fenix-release 
# PLEASE DO NOT EDIT THIS FILE
BOARD=VIM4
VENDOR=Amlogic
VERSION=1.1
ARCH=arm64
INITRD_ARCH=arm64
IMAGE_VERSION=1.1-220721
################ GIT VERSION ################
UBOOT_GIT_VERSION=khadas-vims-u-boot-2019.01-v1.1-release
LINUX_GIT_VERSION=khadas-vims-linux-5.4-v1.1-release
FENIX_GIT_VERSION=v1.1
#############################################


To get the logs you need to type:

docker logs “container id” --follow

Mike

Any update onto getting rancher up and running?

This is not a hard thing to do. Just give us the place to change the cgroups settings. Obviously the /boot/uEnv.txt is not working. This is something very simple to do.

It works, but you use the wrong way, you need to remove the quotation marks, you can follow my modifications:

boot_user_args=cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory systemd.unified_cgroup_hierarchy=0

Save and reboot, then double check whether it works.

$ cat /proc/cmdline
root=UUID=7664d268-7efa-49fe-8961-efd1a4e36ffe rootflags=data=writeback rw rootfstype=ext4 console=ttyS0,921600 console=tty0 no_console_suspend earlycon=aml-uart,0xfe078000 fsck.repair=yes net.ifnames=0 ramoops.pstore_en=1 ramoops.record_size=0x8000 ramoops.console_size=0x4000 loop.max_part=4 khadas_board=VIM4 boot_source=emmc otg_device=1 logo=osd0,loaded,0x00300000 powermode=on vout=2160p60hz,enable panel_type=edp_0 lcd_ctrl=0x00000086 lcd_debug=0x00000000 hdmimode=2160p60hz outputmode=2160p60hz hdmichecksum=0x44e80000 dolby_vision_on=0 hdr_policy=0 hdr_priority= hdmitx=,420,10bit frac_rate_policy=1 hdmi_read_edid= osd_reverse=0 video_reverse=0 irq_check_en=0 androidboot.selinux=permissive androidboot.firstboot=1 wol_enable=0 jtag=disable reboot_mode=normal androidboot.bootloader=01.01.220721.170524 androidboot.hardware=amlogic androidboot.serialno=0000000000 mac=00:00:00:00:00:00 androidboot.mac=00:00:00:00:00:00 androidboot.wificountrycode=US androidboot.rpmb_state=0x0 partition_type=generic cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory systemd.unified_cgroup_hierarchy=0

With this modifications, I can access the web now.

thanks.

How did you find out about this one?
ystemd.unified_cgroup_hierarchy=0

Mike

Hello @mikev1963

Does it work now ? It works on my side.

I’m currently on 1.18 k3s and was on Ubuntu 20.04 and did not need that option, systemd.unified_cgroup_hierarchy=0. But after upgrading the OS to Ubuntu 22.04 I needed to add that option to /boot/firmware/cmdline.txt on my RPI 4. It seems to be a combination of k3s + the OS.