amitsaha
Posts: 11
Joined: Sat Dec 08, 2012 2:51 am
Location: Brisbane, Australia

Video Memory Allocation

Sat Jan 12, 2013 7:01 pm

How do I find out using a command or reading from a file, what is the allocation for the video memory is? Yes, I can subtract the available memory from my total memory. Any other solution?

Also, how can I change it?

Thanks.

Deteros
Posts: 13
Joined: Thu Jan 10, 2013 6:33 pm

Re: Video Memory Allocation

Sat Jan 12, 2013 7:50 pm

Hi amitsaha,

> How do I find out using a command or reading from a file,
> what is the allocation for the video memory is?

You could read /boot/config.txt and look for
gpu_mem=, gpu_mem_256= or gpu_mem_512=
If not existing, then the default is 64,
compare http://elinux.org/RPi_config.txt

I assume the GPU memory is set during boot
and cannot be changed during runtime.

amitsaha
Posts: 11
Joined: Sat Dec 08, 2012 2:51 am
Location: Brisbane, Australia

Re: Video Memory Allocation

Sat Jan 12, 2013 11:51 pm

Deteros wrote:Hi amitsaha,

> How do I find out using a command or reading from a file,
> what is the allocation for the video memory is?

You could read /boot/config.txt and look for
gpu_mem=, gpu_mem_256= or gpu_mem_512=
If not existing, then the default is 64,
compare http://elinux.org/RPi_config.txt

I assume the GPU memory is set during boot
and cannot be changed during runtime.
Ah. Thanks a lot. I could do that by setting the gpu_mem_512 variable. By default, it was allocating 64 MB as shared memory.

Another query: Now, I have 466 MB for OS memory and 32 MB for shared graphics. Where am I missing the remaining 14 MB of my 512 MB memory?

Thanks for any ideas.

Deteros
Posts: 13
Joined: Thu Jan 10, 2013 6:33 pm

Re: Video Memory Allocation

Sun Jan 13, 2013 9:23 am

Hi amitsaha,

> Another query: Now, I have 466 MB for OS memory and 32 MB for shared graphics.
> Where am I missing the remaining 14 MB of my 512 MB memory?

Available memory is 477648k = 466 MByte.

If you study the kernel log messages (on my system in /var/log/messages)
you'll find (I have the same config then you: 512 MB with 32 MB shared graphics):

[ 0.000000] Memory: 480MB = 480MB total
[ 0.000000] Memory: 477476k/477476k available, 14044k reserved, 0K highmem
-> Linux reserves 14044k
...
[ 8.554283] Freeing init memory: 172K
-> frees 172k, thus free memory is now 477476k+172k = 477648k - same as above.

amitsaha
Posts: 11
Joined: Sat Dec 08, 2012 2:51 am
Location: Brisbane, Australia

Re: Video Memory Allocation

Sun Jan 13, 2013 2:35 pm

Hi Deteros,
Deteros wrote:Hi amitsaha,

> Another query: Now, I have 466 MB for OS memory and 32 MB for shared graphics.
> Where am I missing the remaining 14 MB of my 512 MB memory?

Available memory is 477648k = 466 MByte.

If you study the kernel log messages (on my system in /var/log/messages)
you'll find (I have the same config then you: 512 MB with 32 MB shared graphics):

[ 0.000000] Memory: 480MB = 480MB total
[ 0.000000] Memory: 477476k/477476k available, 14044k reserved, 0K highmem
-> Linux reserves 14044k
...
[ 8.554283] Freeing init memory: 172K
-> frees 172k, thus free memory is now 477476k+172k = 477648k - same as above.
Thank you for your reply. I had a feeling that it must be the reserved memory. Thank you for confirming this. I also checked it myself.


Thanks.

amitsaha
Posts: 11
Joined: Sat Dec 08, 2012 2:51 am
Location: Brisbane, Australia

Re: Video Memory Allocation

Sun Jan 13, 2013 2:37 pm

And this is a great post explaining about the memory allocation: http://winfred-lu.blogspot.com.au/2011/ ... -mips.html

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

Re: Video Memory Allocation

Sun Jan 13, 2013 5:22 pm

If you start to use CMA (beta at the moment) then the sharing between Arm and GPU is dynamic- the GPU gives up memory to the Arm and vica versa as required.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

Return to “Pidora / Fedora”