13

I have a Raspberry B and a Raspberry 2.

In the B model, I set the config file to gpu_mem_512=256 in order to get more memory for the graphics. It works fine. If I type the command vcgencmd get_mem gpu it shows gpu=256M as requested.

Now , with the Raspberry 2 model, there is a 1024M GPU, but, we can set it to work. We type gpu_mem_1024=512, but the command vcgencmd get_mem gpu shows gpu=64M, and the application throws a OUT_OF_MEMORY when loading textures.

What is the correct config line?

Piotr Kula
  • 17,307
  • 6
  • 65
  • 104
diego.martinez
  • 245
  • 1
  • 2
  • 8
  • For anyone not following this clearly: the 1024M of the RPi 2 is shared between the GPU and the CPU - indeed that is what the setting controls. {It is so that the same SD Card can be used in different RPi versions and the _256, _512 and now _1024 suffix settings control the split for each of those base-memory sizes and which one is used depends on what is on the RPi reading it.} I suspect that using a gpu_mem without will override one with if they BOTH appear... – SlySven Feb 07 '16 at 00:28

6 Answers6

15

I don't have any problem with this, although I am using a custom setup. In config.txt:

gpu_mem_1024=512

When I boot, I only have half the RAM:

> free
              total
Mem:         495684
             ^^^^^^

And the correct amount appears to be allocated to the GPU:

> vcgencmd get_mem gpu
gpu=512M

768 worked too; the docs claim the limit is 944.

goldilocks
  • 58,859
  • 17
  • 112
  • 227
9

Just run sudo raspi-config, then go to Advanced Options then Memory Split:

Raspi-Config Shot

techie007
  • 123
  • 7
ppersia37
  • 159
  • 1
  • 3
  • 3
    Note this solution works only with Raspbian – Matthew Cordaro Aug 13 '15 at 01:30
  • Just had problems using Kodi with Raspbian on the Pi 2 as the video kept not displaying. Changing the gpu memory to 512 MB using raspi-config worked first time. –  Feb 06 '16 at 23:10
2

I don't see any documentation on the RPi 2's max GPU setting. It appears that the max memory split is 448MB for the 512MB RPi. My guess is that since the RPi 2 doesn't currently allow for the max ram to be used by default, they also haven't upped that limit yet.

My suggestion is to try and set it at 448, and wait for more news.

source

Jacobm001
  • 11,898
  • 7
  • 46
  • 56
1

you could set the GPU-setting in general:

Open /boot/config.txt and add the line "gpu_mem=512".

After reboot it should work. However, you should not use the SD-card in other Raspberries than the Raspberry 2 with this setting. I just set my one to 128MB, so I am not sure if it works with 512MB.

Nayaro
  • 11
  • 1
0

The highest I've set the gpu_mem on a rpi2 is 720mb. 756mb and it wouldn't get past the rainbow splash screen. Openelec runs fine, but I also have an 8gb usb stick as swap. I just read a 32gb stick is actually 3x the speed of an 8gb though. A 32gb stick is only about $10.

greenbag
  • 31
  • 2
  • The speed of a USB flash drive is not directly related to its size, though it's not infrequently the case that larger drives will be faster because they are newer or have more internal memory bandwidth. If you're concerned, you need to test the specific drive. – cjs Apr 20 '17 at 08:23
-3

It seems that the Raspberry Pi software has a bug that defaults it to 64M after change. In rpi they say they will publish a update.

Steve Robillard
  • 34,687
  • 17
  • 103
  • 109
diego.martinez
  • 245
  • 1
  • 2
  • 8