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