Beorn_Bear
Posts: 113
Joined: Tue Feb 27, 2018 6:04 pm
Location: Vancouver, Canada

What is the optimum split of main versus GPU memory for RP4?

Tue Aug 13, 2019 9:01 pm

What is the optimum split of main versus GPU memory for a Raspberry Pi 4 with 4GB RAM?! The default configuration is 64. Would 128? 256? 1 gb?What would provide the best performance balance? Will it assist in reducing the choppy youtube videos?!

User avatar
bomblord
Posts: 200
Joined: Sun Jul 14, 2019 2:54 am

Re: What is the optimum split of main versus GPU memory for RP4?

Tue Aug 13, 2019 9:04 pm

Someone told me that the Pi 4 on buster does it dynamically so setting it is an exercise in futility. You know what they say about people telling you things on the internet though.

User avatar
davidcoton
Posts: 4537
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: What is the optimum split of main versus GPU memory for RP4?

Tue Aug 13, 2019 9:25 pm

bomblord wrote:
Tue Aug 13, 2019 9:04 pm
Someone told me that the Pi 4 on buster does it dynamically so setting it is an exercise in futility. You know what they say about people telling you things on the internet though.
You'll find that same advice here, posted by One Who Knows.
Signature retired

andrum99
Posts: 1023
Joined: Fri Jul 20, 2012 2:41 pm

Re: What is the optimum split of main versus GPU memory for RP4?

Wed Aug 14, 2019 1:59 am

Beorn_Bear wrote:
Tue Aug 13, 2019 9:01 pm
What is the optimum split of main versus GPU memory for a Raspberry Pi 4 with 4GB RAM?! The default configuration is 64. Would 128? 256? 1 gb?What would provide the best performance balance? Will it assist in reducing the choppy youtube videos?!

The optimum split is to leave it on the default. On Pi 4 all of the 3D stuff has been removed from the static gpu_mem allocation, and is instead dynamically allocated within Linux. Also, on my Pi 4 there is no gpu_mem option set in config.txt - it seems to be automagically configured by the firmware at boot.

You can find what your current static GPU memory allocation is using the following command:

Code: Select all

vcgencmd get_mem gpu

On my Pi 4 running 1080p60Hz this reports 76MB. If you are using 4K it may be set higher.

Youtube video performance is known to be suboptimal at present - it is being worked on. Which videos are you having trouble with?

For reference, the docs will soon say something like this (work is in progress at the moment to update it):
gpu_mem refers to memory that is addressable from the GPU, which includes the VPU, HVS, legacy codecs (e.g. H264), and camera, and on devices before the Raspberry Pi 4, the 3D system. The Raspberry Pi 4 3D system now has it's own Memory Mangement Unit (MMU) so textures and other GL resources are not allocated from the gpu_mem but Linux system memory instead. This means that gpu_mem can be set to a lower value, so even if you are using the H264 and camera then 128MB will probably be enough. On earlier models without the 3D MMU, you may need up to 256 or 512 in some more unusual cases.

For performance reasons, you should set gpu_mem as low as possible to give the Linux system as much memory as possible. However, setting gpu_mem to too low values may automatically disable certain firmware features, as there are some things the GPU cannot do if it has access to too little memory. So if a feature you are trying to use isn't working, try setting a larger GPU memory split.

Values of gpu_mem over 512 are not recommended, will provide no performance improvements, and are untested.

klricks
Posts: 6783
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: What is the optimum split of main versus GPU memory for RP4?

Wed Aug 14, 2019 2:37 am

Some info on 4B memory split here: https://www.raspberrypi.org/forums/view ... 8&t=247820
(Especially read posts by jamesh).
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

Return to “General discussion”