I’m using a RPi CM5 on a custom compute board. I have an NVMe SSD on the board via PCIe. I noticed in the kernel log the message:
Oct 13 17:00:01 localhost kernel: nvme nvme0: min host memory (32 MiB) above limit (0 MiB).
From what I understand, I have to set the kernel option nvme.max_host_mem_size_mb=64 to allow the NVMe to request memory. Is there any way to set that in balenaOS? I didn’t see it in the fleet or device configuration.
short answer: there is currently no supported way to add kernel command line parameters in balenaOS. A balenaOS engineer wrote that directly here in the forums, in the thread “Adding kernel boot parameters” (October 2022): balenaOS does not support adding custom kernel command line configuration variables, and a feature request is on record. In an older thread about cmdline.txt on Raspberry Pi, the team added that they decided not to offer cmdline customization in the product, and a user there reported that manual edits on the boot partition were removed again by a balenaOS update.
The workaround pattern balena staff suggest for module parameters is to load the driver from your application container and pass the arguments at load time. That only helps if the driver ships as a loadable module. Whether the NVMe driver is built as a module in the CM5 image I have not verified, so treat that part as an open question - for storage that holds the root filesystem I would not count on it.
If the SSD otherwise works normally, it may be worth asking balena support whether this kernel notice has any practical impact on your board before you invest in a workaround.
Thanks for the info. My understanding is that the NVMe host memory allows the drive to store lookup tables in RAM so it doesn’t have to use the drive directly, which can extend the life of the drive. The drive is working fine without the option, but with the price of storage these days, if I can squeeze more life out of an SSD, I want to try it!