Score:0

How can I run Unbuntu on raspberry-pi 3 or 4 using only a single core?

cn flag

I would like to use the Raspberry-Pi 3 or 4 to get a ballpark performance estimate for a 64bit-ARM embedded system that runs Linux but only has a single core. (I don't have the target system yet). I am using Ubuntu to get 64bit.

For this aim I would like to run the system using only one core.

I am not sure if Ubuntu uses u-Boot or Grub (/boot seems to use Grub), I have tried setting maxcpus=1 in GRUB_CMDLINE_LINUX_DEFAULT (then update-grub) which didn't work.

The RasberryPi does not seem to have /sys/devices/system/cpu/cpu*/online either

so "echo 0 > /sys/devices/system/cpu/cpu[1-3]/online" cannot be used.

Am I missing something? Is there a different way to do this?

Thank you!

==== Update ====

Reading Ubuntu wiki page (link in noisefloor's answer), It seems Ubuntu is using u-boot, which explains why the Grub change didn't work.

The question is now how to pass "maxcpus=1" to Linux using u-Boot?

Score:2
ec flag

Updated, based on modified question:

As far as I am aware, Uboot does not support, in contrast to GRUB, a boot parameter to set the numbers of CPUs used, see Uboot Environment and Uboot env command.

An alternative way could be to install Canonical's Multipass, which allows the quick and easy setup of virtual machines running Ubuntu. When creating a Multipass instance, the number of CPU cores to be used by Multipass can be set, defaults to one core only.

There will be a performance penalty running Ubuntu in a VM instead of directly on real hardware, but for trial purposes it is typically good enough.


original answered, based on the assumption that Ubuntu should be run on a single-core Raspberry Pi:

There is no Ubuntu release which support single core Raspberries, namely the Zero / Zero W and the 1B series. These have an ARM V6 CPU, which was never supported by Ubuntu. On the 2, 3 and 4 series as well as the Zero2 W, which have ARMv7 or ARMv8 CPUs, Ubuntu can be installed, see Ubuntu Wiki page for further details.

PolarBear2015 avatar
cn flag
thank you for raising this point. I am using Raspberry 3 and 4 - I have installed Ubuntu successfully, but it is using by default all cores. I want to use only one. I have edited my questions to better clarify this point.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.