User avatar
KnightMB
Posts: 40
Joined: Sun Dec 23, 2012 4:31 pm
Contact: Website

Arch linux maximized RAM vs GPU

Thu Jan 31, 2013 1:43 am

Is Arch Linux optimized to use the most RAM for the CPU vs graphics or does it balance it? The reason I ask, I wanted to basically put all the RAM into the OS rather than the graphics as it just sits at the command line all the time. Checking top, it seems that 32MB is perhaps reserved for the GPU, but is there a lower limit I can set?
Raspberry Pi + Timekoin = Next Generation Digital Currency

elatllat
Posts: 1337
Joined: Sat Dec 17, 2011 5:05 pm

Re: Arch linux maximized RAM vs GPU

Thu Jan 31, 2013 6:39 am

Code: Select all

md5sum /boot/*.elf
2160p + USB3 + Wayland: https://hardkernel.com

FAQ : https://raspberrypi.stackexchange.com

Unanswered: https://www.raspberrypi.org/forums/search.php?search_id=unanswered

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: Arch linux maximized RAM vs GPU

Thu Jan 31, 2013 9:47 am

The discussion on settings start about here
http://www.raspberrypi.org/phpBB3/viewt ... &start=125
To be honest it looks quite tricky to get settings to work without hang.
If you find something please report back

drirr
Posts: 54
Joined: Sun Sep 09, 2012 8:06 am

Re: Arch linux maximized RAM vs GPU

Thu Jan 31, 2013 6:21 pm

As far as I know, the lowest limit is 16M, add the following to your /boot/config.txt:

Code: Select all

# Memory split ARM/GPU.
gpu_mem=16
And read more: here.
Raspberry Pi (rev 000f, 512MB RAM) with heatsinks and a modmypi case running Arch Linux ARM (armv6h) hooked up to a 750GB 2.5" USB-harddrive

User avatar
KnightMB
Posts: 40
Joined: Sun Dec 23, 2012 4:31 pm
Contact: Website

Re: Arch linux maximized RAM vs GPU

Thu Jan 31, 2013 6:45 pm

drirr wrote:As far as I know, the lowest limit is 16M, add the following to your /boot/config.txt:

Code: Select all

# Memory split ARM/GPU.
gpu_mem=16
And read more: here.
Excellent, exactly what I was looking for, thanks!
Raspberry Pi + Timekoin = Next Generation Digital Currency

johnny123
Posts: 1
Joined: Sat Feb 02, 2013 1:53 pm

Re: Arch linux maximized RAM vs GPU

Sat Feb 02, 2013 2:37 pm

Today I did a fresh install of Arch Linux "archlinux-hf-2013-01-22". gpu_mem256=128 is set by default in /boot/config.txt. When I change this value to 16 as recommended for headless use of the RPi, it hangs on boot. Only the red PWR light is on. See code below.

Code: Select all

gpu_mem_512=316
gpu_mem_256=16
cma_lwm=16
cma_hwm=32
cma_offline_start=16
This hanging doesn't occur when gpu_mem256 is set to 48.
How can I set gpu_mem256 as low as 16?

remsnet
Posts: 151
Joined: Wed Dec 19, 2012 7:32 pm
Location: Planet Gaia
Contact: Website Yahoo Messenger

Re: Arch linux maximized RAM vs GPU

Sat Feb 02, 2013 7:00 pm

The answer is allmost : Not below 32MB with BIG Filesystems.

my Tests with debian , FC , suse resulted in kernel paincs and unstable systems when i added my Multble TB size storange to one of my PI´s

regards

User avatar
KnightMB
Posts: 40
Joined: Sun Dec 23, 2012 4:31 pm
Contact: Website

Re: Arch linux maximized RAM vs GPU

Sat Feb 02, 2013 8:00 pm

I thought the GPU was for the graphics, so if you have a headless version, the minimum 16 should work since it's just a command prompt when booted?

I have to agree though, the gpu_mem=16 has no affect on GPU memory usage as far as I can see.

Using the other defaults on the Arch Image

gpu_mem_512=316
or
gpu_mem_256=128

Setting anything lower prevents the Pi from booting. :(
Raspberry Pi + Timekoin = Next Generation Digital Currency

User avatar
KnightMB
Posts: 40
Joined: Sun Dec 23, 2012 4:31 pm
Contact: Website

Re: Arch linux maximized RAM vs GPU

Sat Feb 02, 2013 8:17 pm

drirr wrote:As far as I know, the lowest limit is 16M, add the following to your /boot/config.txt:

Code: Select all

# Memory split ARM/GPU.
gpu_mem=16
And read more: here.
Just to note, I found out the other options
gpu_mem_512=316
gpu_mem_256=128

will over-ride this, but if you remove them, the system won't boot.
Raspberry Pi + Timekoin = Next Generation Digital Currency

EdwinJ85
Posts: 264
Joined: Wed Feb 01, 2012 4:44 pm
Contact: Website

Re: Arch linux maximized RAM vs GPU

Sun Feb 17, 2013 8:18 pm

Is there any way to lower the GPU memory usage for the pi running arch? I don't even have x installed, why do I need 300MB plus of ram for the GPU?

If I try and set the GPU split any lower than the default level for the 512ram config setting the pi won't boot. :(
Hello!

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: Arch linux maximized RAM vs GPU

Sun Feb 17, 2013 10:01 pm

gpu_mem_512=316 doesn't mean is used for the gpu (sounds crazy?)
free shows what ram you have, probably until the gpu needs it, only 32Mb will be used

hunterpi
Posts: 6
Joined: Fri Sep 14, 2012 11:22 pm

Re: Arch linux maximized RAM vs GPU

Wed Mar 27, 2013 8:00 am

My Raspberry Pi is B model with 512MB version.
I tried several values ​​in the variables gpu_mem_512 and gpu_mem_256 and almost all values ​​have caused a system crash. With these values ​​the system booted me perfectly:

gpu_mem_512=48
gpu_mem_256=48

I know in my case gpu_mem_256 variable has no effect, but I prefer to be very sure that my system does not use more RAM than necessary for the GPU.

clark800
Posts: 1
Joined: Sun Apr 06, 2014 5:42 pm

Re: Arch linux maximized RAM vs GPU

Sun Apr 06, 2014 5:57 pm

@hunterpi Thanks for the info, the gpu_mem_512=48 setting worked for me. I am running RPi Rev B 512MB with Arch Linux ARM:

uname -a
Linux test 3.10.35-1-ARCH #1 PREEMPT Tue Apr 1 20:32:04 MDT 2014 armv6l GNU/Linux

/opt/vc/bin/vcgencmd version
Mar 30 2014 16:02:33
Copyright (c) 2012 Broadcom
version 8f13fa508997a043a3d78822e3f67ec044b4e7bf (clean) (release)

Does anyone know why setting gpu_mem to 16 or 32 causes the RPi to not boot (red PWR light only)? There are several sources online which claim that 16 is the minimum. Did this change for more recent firmwares?

I noticed that the "free" command doesn't seem to show much of a difference regardless of the GPU setting, but the kernel starts killing processes with the Out Of Memory killer much sooner if the GPU reserved memory is high. I was confused by this for a while because I was getting out-of-memory failures when I still had over 300MB of free memory. It turned out that Arch Linux has a default of 316MB reserved for the GPU!

This command shows how much is actually reserved:

dmesg | grep Memory:

I'm curious if the "free" command should reflect the reserved memory and if so, is this some kind of a bug?

ikwyl6
Posts: 16
Joined: Mon Nov 19, 2012 1:10 am

Re: Arch linux maximized RAM vs GPU

Thu May 01, 2014 1:49 am

I would also like to know how to change the reserved memory for arch linux to maximize my memory for my Rpi. Running as headless. I run transmission with minimal torrents (less than 10) and I get a Out of Memory after 10 minutes.

$ dmesg |grep Memor
[ 0.000000] Memory policy: ECC disabled, Data cache writeback
[ 0.000000] Memory: 196MB 280MB = 476MB total
[ 0.000000] Memory: 170128k/170128k available, 317296k reserved, 0K highmem

Watching 'free' shows my memory doesn't go below 300MB but I assume that once it hits below 317296k that it will shut the process down. Seems very unreasonable!

Return to “Arch”