diff --git a/README.md b/README.md index 4b54918..9f88452 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,24 @@ $ cat /tmp/latency-summary.log ``` A latency plot from cyclictest histogram data will be available in `/tmp/latency-plot.png`. + + +# Running rt-tests on a non-PREEMPT_RT version of TorizonCore + +Running the `rt-tests` container on a non-PREEMPT_RT version of TorizonCore may be useful to compare the results with the PREEMPT_RT version. But if you try to run, the execution might fail: + +``` +$ docker run --rm -it --name rt-tests --cap-add=sys_nice --cap-add=ipc_lock --cap-add=sys_rawio --ulimit rtprio=99 --device-cgroup-rule='c 10:* rmw' -v /dev:/dev -v /tmp:/tmp torizon/rt-tests:$CT_TAG_RT_TESTS +Unable to change scheduling policy! +Probably missing capabilities, either run as root or increase RLIMIT_RTPRIO limits. +ERROR: cyclictest failed +``` + +That is because `CONFIG_RT_GROUP_SCHED` may be enabled on non-PREEMPT_RT versions of TorizonCore, and a cgroups configuration is required to run real-time tasks. + +So if you want to run the `rt-tests` container on a non-PREEMPT_RT version of TorizonCore, run the following commands: + +``` +sudo sh -c "echo 950000 > /sys/fs/cgroup/cpu,cpuacct/docker/cpu.rt_runtime_us" +docker run --rm -it --name rt-tests --cpu-rt-runtime=950000 --cap-add=sys_nice --cap-add=ipc_lock --cap-add=sys_rawio --ulimit rtprio=99 --device-cgroup-rule='c 10:* rmw' -v /dev:/dev -v /tmp:/tmp torizon/rt-tests:$CT_TAG_RT_TESTS +``` \ No newline at end of file