extols
Posts: 1
Joined: Wed Feb 04, 2015 8:09 am

Pi 2 Memory Split

Wed Feb 04, 2015 8:20 am

I've just set up my new Pi 2 and configured config.txt with gpu_mem=16 as this is just going to be a headless install.

But when I look at 'free -h' its giving me a total memory of just 744M.

Am I missing something here - shouldn't memory + gpu_mem add up to 1G (approx)

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1705
Joined: Thu Jul 11, 2013 2:37 pm

Re: Pi 2 Memory Split

Wed Feb 04, 2015 8:54 am

The user/kernel virtual memory split currently in use is

CONFIG_VMSPLIT=3G

Which has a side effect of "eating" 240MiB of ram (for vmallocs). The ideal virtual split would be 2G/2G but this has caused problems with a couple of applications, namely Sonic Pi. Once the userland programs are fixed then we can move to a split that doesn't have this limitation.

https://www.kernel.org/doc/gorman/html/ ... ss%20Space
Rockets are loud.
https://astro-pi.org

tesla01
Posts: 10
Joined: Thu Feb 05, 2015 8:37 am

Re: Pi 2 Memory Split

Thu Feb 05, 2015 9:57 am

Thanks for the response :)
So for people that dont use this software it's usefull to use a custom kernel with valid split no?

User avatar
DougieLawson
Posts: 30943
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Pi 2 Memory Split

Thu Feb 05, 2015 11:19 am

jdb wrote:The user/kernel virtual memory split currently in use is

CONFIG_VMSPLIT=3G

Which has a side effect of "eating" 240MiB of ram (for vmallocs). The ideal virtual split would be 2G/2G but this has caused problems with a couple of applications, namely Sonic Pi. Once the userland programs are fixed then we can move to a split that doesn't have this limitation.

https://www.kernel.org/doc/gorman/html/ ... ss%20Space
Since I have no desire to run Sonic-Pi can I override this stuff with a /boot/config.txt parm or do I have to rebuild the kernel?
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Pi 2 Memory Split

Thu Feb 05, 2015 11:29 am

DougieLawson wrote:
jdb wrote:The user/kernel virtual memory split currently in use is

CONFIG_VMSPLIT=3G

Which has a side effect of "eating" 240MiB of ram (for vmallocs). The ideal virtual split would be 2G/2G but this has caused problems with a couple of applications, namely Sonic Pi. Once the userland programs are fixed then we can move to a split that doesn't have this limitation.

https://www.kernel.org/doc/gorman/html/ ... ss%20Space
Since I have no desire to run Sonic-Pi can I override this stuff with a /boot/config.txt parm or do I have to rebuild the kernel?
I'm just about to build 3.18.5+ to see if that corrects the initramfs problem I've been having since 3.18.1+. It'd be nice to try out this config in there too.

User avatar
DougieLawson
Posts: 30943
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Pi 2 Memory Split

Thu Feb 05, 2015 11:31 am

ktb wrote:
DougieLawson wrote:
jdb wrote:The user/kernel virtual memory split currently in use is

CONFIG_VMSPLIT=3G

Which has a side effect of "eating" 240MiB of ram (for vmallocs). The ideal virtual split would be 2G/2G but this has caused problems with a couple of applications, namely Sonic Pi. Once the userland programs are fixed then we can move to a split that doesn't have this limitation.

https://www.kernel.org/doc/gorman/html/ ... ss%20Space
Since I have no desire to run Sonic-Pi can I override this stuff with a /boot/config.txt parm or do I have to rebuild the kernel?
I'm just about to build 3.18.5+ to see if that corrects the initramfs problem I've been having since 3.18.1+. It'd be nice to try out this config in there too.
I've been using an Ubuntu virtualbox to cross compile kernels because it was an overnight job on a RPi1. I may run it on the RPi2 just to see what 4 cores with some overclocking can do.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

ktb
Posts: 1380
Joined: Fri Dec 26, 2014 7:53 pm

Re: Pi 2 Memory Split

Thu Feb 05, 2015 11:35 am

DougieLawson wrote:I've been using an Ubuntu virtualbox to cross compile kernels because it was an overnight job on a RPi1. I may run it on the RPi2 just to see what 4 cores with some overclocking can do.
That's my plan, but I've only compiled kernels for the Pi on the Pi. It really didn't take that long on my B+ @1200MHz. It's nice that compiling on the Pi should be a much more viable option now.

User avatar
RaTTuS
Posts: 9630
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Pi 2 Memory Split

Thu Feb 05, 2015 11:43 am

DougieLawson wrote:....
I've been using an Ubuntu virtualbox to cross compile kernels because it was an overnight job on a RPi1. I may run it on the RPi2 just to see what 4 cores with some overclocking can do.
you have more than one RPi ?
install distcc on them all
that's how I was doing it when I was building kernels ;)
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

tesla01
Posts: 10
Joined: Thu Feb 05, 2015 8:37 am

Re: Pi 2 Memory Split

Thu Feb 05, 2015 3:32 pm

I'm current compile the same last image with CONFIG_VMSPLIT set to 2G/2G
I'll try when it's ready and i will return

tesla01
Posts: 10
Joined: Thu Feb 05, 2015 8:37 am

Re: Pi 2 Memory Split

Thu Feb 05, 2015 8:04 pm

Hi,
I confirm that the 2G/2G option works when use custom kernel


Feb 5 19:17:12 raspberrypi kernel: [ 0.000000] Memory: 940776K/966656K available (5785K kernel code, 377K rwdata, 1760K rodata, 396K init, 771K bss, 25880K reserved)


Thanks :)

tesla01
Posts: 10
Joined: Thu Feb 05, 2015 8:37 am

Re: Pi 2 Memory Split

Fri Feb 06, 2015 11:34 am

Hi
I have upload the kernel on github with CONFIG_VMSPLIT=2G

https://github.com/realPy/rpikernelV2Custom.git


mount the SD ext4 partition on an other system and backup the kernel7.img and replace with the new one
backup the /lib/modules/3.18.5-v7+ and replace with the new one.
Boot on your PI!


Work perfectly :)
Enjoy

User avatar
jsebean
Posts: 50
Joined: Sun Jan 13, 2013 12:00 am
Location: Atlantic Canada
Contact: Website

Re: Pi 2 Memory Split

Tue Feb 10, 2015 3:20 pm

jdb wrote:The user/kernel virtual memory split currently in use is

CONFIG_VMSPLIT=3G

Which has a side effect of "eating" 240MiB of ram (for vmallocs). The ideal virtual split would be 2G/2G but this has caused problems with a couple of applications, namely Sonic Pi. Once the userland programs are fixed then we can move to a split that doesn't have this limitation.

https://www.kernel.org/doc/gorman/html/ ... ss%20Space
So in the future we can expect an update that will fix this? Thanks.
Last edited by jsebean on Tue Feb 10, 2015 3:50 pm, edited 2 times in total.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 18377
Joined: Sat Jul 30, 2011 7:41 pm

Re: Pi 2 Memory Split

Tue Feb 10, 2015 3:26 pm

jsebean wrote:
jdb wrote:The user/kernel virtual memory split currently in use is

CONFIG_VMSPLIT=3G

Which has a side effect of "eating" 240MiB of ram (for vmallocs). The ideal virtual split would be 2G/2G but this has caused problems with a couple of applications, namely Sonic Pi. Once the userland programs are fixed then we can move to a split that doesn't have this limitation.

https://www.kernel.org/doc/gorman/html/ ... ss%20Space
So in the future we can expect an update that will fix this? Thanks.
Yes.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
jsebean
Posts: 50
Joined: Sun Jan 13, 2013 12:00 am
Location: Atlantic Canada
Contact: Website

Re: Pi 2 Memory Split

Tue Feb 10, 2015 3:52 pm

Awesome.

I've got two Raspberry Pi 2's coming that I can hack with more. I ended up buying one from a data center to run as a server, so I don't want to do too much hacking, specifically compiling a kernel while risking my installation especially since the official one will have it in due time haha.

Guess I'm stuck at 744MB atm.

tesla01
Posts: 10
Joined: Thu Feb 05, 2015 8:37 am

Re: Pi 2 Memory Split

Wed Feb 11, 2015 9:10 am

jsebean wrote:Awesome.

I've got two Raspberry Pi 2's coming that I can hack with more. I ended up buying one from a data center to run as a server, so I don't want to do too much hacking, specifically compiling a kernel while risking my installation especially since the official one will have it in due time haha.

Guess I'm stuck at 744MB atm.
Recompile a kernel is very easy and here that is just one option to check.
The mainly risk is have a kernel panic at startup or the kernel wont start.
If you rename the old kernel and modules you can revert easly with plug the memory card in another system and rename the old files and your system will boot.

Trust me, if you just change some options in kernel config, is very very rare (i've never seen) to break piece of software in your system.

birdman
Posts: 21
Joined: Fri Nov 04, 2011 1:11 am
Contact: Website

Re: Pi 2 Memory Split

Thu Feb 12, 2015 10:01 pm

Just this minute had an update to libraspberrypi-* and raspberrypi-bootloader.
kernel now 3.18.7-v7+.
memory now reported by top as "KiB Mem: 998096"

Thanks!!

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1705
Joined: Thu Jul 11, 2013 2:37 pm

Re: Pi 2 Memory Split

Thu Feb 12, 2015 10:59 pm

I believe a fix is now implemented for Sonic-Pi (which was the application that was gating the move to 2G/2G).
Rockets are loud.
https://astro-pi.org

User avatar
jbeale
Posts: 3315
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Pi 2 Memory Split

Sat Feb 14, 2015 11:23 pm

I just got my new RPi 2, and am testing it out. I started out with Raspbian on an old RPi Model B+, I have done sudo apt-get update and sudo apt-get dist-upgrade both on the old machine, and again on the new R-Pi (when it said 0 files to update).

Everything seems to work, but 'top' says:

Code: Select all

top - 15:18:42 up 12 min,  2 users,  load average: 0.18, 0.30, 0.18
Tasks:  88 total,   1 running,  87 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.2 us,  0.4 sy,  0.0 ni, 99.4 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem:    234660 total,   174124 used,    60536 free,    15920 buffers
KiB Swap:   102396 total,        0 used,   102396 free,   122456 cached
Shouldn't I be seeing more memory than that? Is there a configuration problem of some kind? I have a /boot/config.txt with every line commented out, so that leaves things at the default (?) The version seems pretty recent:

Code: Select all

pi@rp0 ~ $ uname -a
Linux rp0 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

DirkS
Posts: 7733
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Pi 2 Memory Split

Sat Feb 14, 2015 11:45 pm

jbeale wrote:Shouldn't I be seeing more memory than that? Is there a configuration problem of some kind? I have a /boot/config.txt with every line commented out, so that leaves things at the default (?) The version seems pretty recent:

Code: Select all

pi@rp0 ~ $ uname -a
Linux rp0 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux
That doesn't look right; you should have close to 950MB total memory when using the defaults.
What is the output of

Code: Select all

vcgencmd get_mem arm
vcgencmd get_mem gpu
IIRC the default gpu mem setting is 64.

User avatar
jbeale
Posts: 3315
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Pi 2 Memory Split

Sun Feb 15, 2015 12:32 am

Code: Select all

pi@rp0 ~ $ vcgencmd get_mem arm
arm=240M
pi@rp0 ~ $ vcgencmd get_mem gpu
gpu=16M
I seem to be missing quite a bit of memory!

User avatar
DougieLawson
Posts: 30943
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Pi 2 Memory Split

Sun Feb 15, 2015 12:48 am

What have you got in /boot/config.txt?
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
jbeale
Posts: 3315
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Pi 2 Memory Split

Sun Feb 15, 2015 1:01 am

Nothing in /boot/config.txt, every single line is commented out. I removed config.txt entirely, rebooted, but got same result. gpu=16M, arm=240M.

User avatar
DougieLawson
Posts: 30943
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Pi 2 Memory Split

Sun Feb 15, 2015 1:09 am

Grab another SDCard, stick a fresh copy of Raspbian on it and see what happens when that boots.

You'd expect to get

Code: Select all

root@apollo /proc/2063 #  vcgencmd get_mem gpu
gpu=128M
root@apollo /proc/2063 #  vcgencmd get_mem arm
arm=880M
on a RPi2 (and that's with start_x=1 & gpu_mem=128 in /boot/config to enable the camera).
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

User avatar
jbeale
Posts: 3315
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Pi 2 Memory Split

Sun Feb 15, 2015 3:08 am

I put the current NOOBS Lite on a card, that gives me:

Code: Select all

arm=880M  gpu=128M
Linux raspberrypi 3.18.5-v7+ #225 SMP PREEMPT Fri Jan 30 18:53:55 GMT 2015 armv7l GNU/Linux
which looks right. So apparently the simple apt-get update/dist-upgrade process from a B+ is not fool-proof, seems better to simply re-install.

azbest_hu
Posts: 8
Joined: Thu Sep 20, 2012 9:18 am

Re: Pi 2 Memory Split

Tue Feb 17, 2015 8:50 pm

RaTTuS wrote: you have more than one RPi ?
install distcc on them all
that's how I was doing it when I was building kernels ;)
Two years ago I played with icecc. I created a cross toolchain also and the PCs helped doing the build that was started on the pi.
http://logout.hu/dl/upc/2012-11/23987_starview.png
(The image is edited to show all machines details in the same time.)
The Pi1 was not so poweful to feed the PCs with enought job, but it was ok.
Tvheadend build was 380sec on the pi alone. With icecc it took only 50sec.
Kernel build was 6 hours on the pi alone, with icecc it was done in 3 hours :)

With the Pi2 it would be more efficient and probably it can feed more PC with data.
I know, building in chrooted environment its way more efficient, but it can be also speed up with distributed compilation by distcc or icecc and a cross toolchain.
In my workplace we are using 20-30 pc in a "farm" to build webkit in minutes. It's really fast with -j40 :) We had also buildbots for arm target.

Return to “Troubleshooting”

Who is online

Users browsing this forum: raspz1 and 74 guests