Rpi3 target memory usage by GPU configurable?

nerves
nerves-system

#1

Hi,

when building for the rpi3 target - how much memory is allocated to the GPU - i normally run with 16MB (as its the minimum you can set in raspi-config) to free up as much memory as possible and i run them the headless and no need for a gui.

Is this possible or is it already the default? Reading through the docs and a search does not give me any answers

Thanks

Tom


#2

192 seems to be the default… you should be able to override it though - not sure how


#3

Since this config file is stored in the boot partition on the device, it can be overridden from your project by using a custom fwup.conf file to specify a custom version of config.txt: https://hexdocs.pm/nerves/advanced-configuration.html#overwriting-files-in-the-boot-partition

When overriding either of these files, you need to copy the original one from the system you are using, because the override will replace the original, not merge with it. You can download these files from GitHub and then add them to your project.


#4

Many thanks - I will give it a go!

cheers

Tom


#5

i have tried using the blinky example program, built and deployed to the pi3+ and it works fine.

I make the changes i think are correct reading the docs and it will not even boot. I am obviously doing something wrong but not sure what.

I have copied the fwup.conf and options.txt from:

~/.nerves/artifacts/nerves_system_rpi3-portable-1.6.2/images

into blinky/config folder (all the following changes are to those files)

I changed options.txt ‘gpu_mem=192’ to ‘gpu_mem=16’
I changed config.exs to
config :nerves, :firmware,
rootfs_overlay: “rootfs_overlay”,
fwup_conf: “config/fwup.conf”

and then changed fwup from

file-resource config.txt {
host-path = ${NERVES_SYSTEM}/images/config.txt"
}

to

file-resource config.txt {
host-path = “${NERVES_APP}/config/config.txt”
}

Any ideas?


#6

When I experiment with the config.txt settings, I usually put the MicroSD card into my laptop and modify the file directly. When I have something that boots, then I update the fwup.conf.

My only guess is that 16 MB is too small for the “X” version of the Raspberry Pi’s VideoCore firmware. The Pi has several firmware images. See here: https://github.com/raspberrypi/firmware/tree/master/boot. The “_x” one is the most capable. The “_cd” one is the smallest and most limited, I believe. Everything is relative, but in my opinion, we enable a ton on our Raspberry Pi systems since this area tends to be harder to people to debug and for us to support. To select the other firmware images, I’d probably download them from the github link above and manually copy them over to the boot partition to make sure that your configuration boots. After you’re happy with that, it’s a Buildroot configuration option to select the Raspberry Pi firmware. If you going to be modifying Buildroot options, you might as well disable rpi-userland, alsalib and espeak and shrink your firmware by maybe 1/3rd.

Good luck.