Skip to content

Commit

Permalink
configuration/config-txt/memory.md - minor fixup (#1610)
Browse files Browse the repository at this point in the history
* Update memory.md

* Update memory.md

* Lose the technical maximums - they're not relevant

Give recommended maximums instead - that's what 99% of users actually need from the documentation.

* fix table

* Update memory.md

* Update memory.md

* Update memory.md

* Update memory.md

* Update memory.md

* Update memory.md

* Update memory.md

* Update memory.md

* default is now 76MB on Pi 2 and later
  • Loading branch information
JamesH65 authored Jul 7, 2020
2 parents c66aa96 + 81ebe50 commit a7d4b11
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions configuration/config-txt/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,36 @@

## gpu_mem

GPU memory in megabytes, sets the memory split between the CPU and GPU; the CPU gets the remaining memory. The minimum value is `16`; the technical maximum value is `192`, `448`, or `944`, depending on whether you are using a 256MB, 512MB, or 1024MB Pi. The default value is `64`, values above `512` will not provide increased performance and should not be used. For the Raspberry Pi 4, which is available in 1GB, 2GB and 4GB versions, the minimum and maximum values are the same as for a 1GB device.
Specifies how much memory, in megabytes, to reserve for the exclusive use of the GPU: the remaining memory is allocated to the ARM CPU. The default value is `76`, except on the Pi Zero and Pi 1 where it is `64`. You should set `gpu_mem` to the lowest possible value to ensure best performance. If a particular graphics feature is not working correctly, try increasing the value of `gpu_mem`, being mindful of the recommended maximums shown below.

`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 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.
The recommended maximum values are as follows:

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.
| total RAM | `gpu_mem` recommended maximum |
|-----------|-------------------------------|
| 256MB | `128` |
| 512MB | `384` |
| 1GB or greater | `512` |

Values of `gpu_mem` over 512 are not recommended, will provide no performance improvements, and are untested.
It is possible to set `gpu_mem` to larger values, however this should be avoided since it can cause problems, such as preventing Linux from booting. There is no performance advantage to specifying values larger than is necessary. The minimum value is `16`, however this disables certain GPU features.

Using `gpu_mem_256`, `gpu_mem_512`, and `gpu_mem_1024` allows you to swap the same SD card between 256MB, 512MB, and 1024MB Pis without having to edit `config.txt` each time:
On the Raspberry Pi 4 the 3D component of the GPU has its own memory management unit (MMU), and does not use memory from the `gpu_mem` allocation. Instead memory is allocated dynamically within Linux. This may allow a smaller value to be specified for `gpu_mem` on the Pi 4, compared to previous models.

You can also use `gpu_mem_256`, `gpu_mem_512`, and `gpu_mem_1024` to allow swapping the same SD card between Pis with different amounts of RAM without having to edit `config.txt` each time:

## gpu_mem_256

The `gpu_mem_256` command sets the GPU memory in megabytes for the 256MB Raspberry Pi. (It is ignored if memory size is not 256MB). This overrides `gpu_mem`. The maximum value is `192`, and the default is not set.
The `gpu_mem_256` command sets the GPU memory in megabytes for Raspberry Pis 256MB of memory. (It is ignored if memory size is not 256MB). This overrides `gpu_mem`.

## gpu_mem_512

The `gpu_mem_512` command sets the GPU memory in megabytes for the 512MB Raspberry Pi. (It is ignored if memory size is not 512MB). This overrides `gpu_mem`. The maximum value is `448`, and the default is not set.
The `gpu_mem_512` command sets the GPU memory in megabytes for Raspberry Pis with 256MB of memory. (It is ignored if memory size is not 512MB). This overrides `gpu_mem`.

## gpu_mem_1024

The `gpu_mem_1024` command sets the GPU memory in megabytes for Raspberry Pi devices with 1024MB or more of memory. (It is ignored if memory size is smaller than 1024MB). This overrides `gpu_mem`. The maximum value is `944`, and the default is not set.
The `gpu_mem_1024` command sets the GPU memory in megabytes for Raspberry Pis with 1GB or more of memory. (It is ignored if memory size is smaller than 1GB). This overrides `gpu_mem`.

## disable_l2cache

Setting this to `1` disables the CPU's access to the GPU's L2 cache and requires a corresponding L2 disabled kernel. Default value on BCM2835 is `0`. On BCM2836, BCM2837, and BCM2711, the ARMs have their own L2 cache and therefore the default is `1`.
The standard Pi kernel.img and kernel7.img builds reflect this difference in cache setting.
Setting this to `1` disables the CPU's access to the GPU's L2 cache and requires a corresponding L2 disabled kernel. Default value on BCM2835 is `0`. On BCM2836, BCM2837, and BCM2711, the ARMs have their own L2 cache and therefore the default is `1`. The standard Pi kernel.img and kernel7.img builds reflect this difference in cache setting.

*This article uses content from the eLinux wiki page [RPiconfig](http://elinux.org/RPiconfig), which is shared under the [Creative Commons Attribution-ShareAlike 3.0 Unported license](http://creativecommons.org/licenses/by-sa/3.0/)*

0 comments on commit a7d4b11

Please sign in to comment.