I have looked everywhere (both on and off StackExchange) for this but cannot get an answer:
I have a Raspberry Pi Zero W, which has 512MB of RAM total. I am running it headless, so I want to maximize available RAM. I have set gpu_mem=16
in the \boot\config.txt
file and have rebooted the device.
When I run free -h
I get the following output:
total used free shared buff/cache available
Mem: 370M 20M 299M 2.6M 50M 300M
When I run vcgencmd get_mem arm && vcgencmd get_mem gpu
I get:
arm=384M
gpu=128M
This seems to be telling me that the GPU memory is still set to 128MB.
How can I properly free up this memory for general use by my applications?
Thanks ahead of time for any help you can give here.
1 Answer 1
Thanks to the forums over on raspberrypi.org I was able to find out the answer to this, so I am sharing it here for future reference...
ANSWER: The 128M of GPU RAM is still being reserved because I have the Raspberry Pi Camera enabled. The camera requires a minimum of 128M of GPU RAM to be held aside in order to function properly. This overrides the gpu_mem=16
setting in the \boot\config.txt
file.
Going Deeper:
If you see this happening on your Pi, you can validate if it's the camera by going into the \boot\config.txt
file and looking for the setting start_x=1
. If that setting exists, your camera is enabled (even if you don't have one connected!). To turn it off, either set it to start_x=0
or comment it out, then reboot. You should see your GPU RAM allocation go back to whatever value you placed in the gpu_mem
setting. Of course, then you won't have camera access, but hey, that's the deal, right?
Good luck, and thank you all for your help!
-
THANK YOU so much, exactly what was wrong w/ my setup.David Sword– David Sword2021年01月26日 22:09:36 +00:00Commented Jan 26, 2021 at 22:09
Explore related questions
See similar questions with these tags.
Raspbian
image or theNOOBS
image on your miniSD card? Are there anyhdmi_
configuration options in your/boot/config.txt
? I believe the defaultgpu_mem
is 64M not 128M.hdmi_*
options. To ensure that it isn't an issue of formatting or a CRLF in your/boot/config.txt
, does the problem persist if you enact the change viasudo raspi-config
?hdmi_
entries in/boot/config.txt
are commented out (this is a completely headless install). Thegpu_mem
setting is16
(the minimum).raspi-config
just to be sure, and everything is still coming up the same, so it's not a formatting issue.raspi-config
and inconfig.txt
file ?