Soulex
Posts: 58
Joined: Tue Feb 09, 2021 10:09 am

How much gpu memory should i use

Thu Jun 17, 2021 8:10 pm

hello, I have been using raspian for the past few months and am trying to get the best performance out of it. I was wondering what i should set the gpu_mem to be? some articals say go as high as to can (1024mb) , which i have tried and it is stable and some say dont go above 256mb or above 512mb. I have a 8GB raspberry pi 4.
Thank you :D

trejan
Posts: 3345
Joined: Tue Jul 02, 2019 2:28 pm

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:12 pm

The best option for nearly everybody is to use the default. Increasing the allocation doesn't improve performance.

Soulex
Posts: 58
Joined: Tue Feb 09, 2021 10:09 am

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:15 pm

trejan wrote:
Thu Jun 17, 2021 8:12 pm
The best option for nearly everybody is to use the default. Increasing the allocation doesn't improve performance.
What is the default?

trejan
Posts: 3345
Joined: Tue Jul 02, 2019 2:28 pm

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:21 pm

Soulex wrote:
Thu Jun 17, 2021 8:15 pm
trejan wrote:
Thu Jun 17, 2021 8:12 pm
The best option for nearly everybody is to use the default. Increasing the allocation doesn't improve performance.
What is the default?
Don't set any gpu_mem= line in /boot/config.txt and it'll use the default.
https://www.raspberrypi.org/documentation/configuration/config-txt/memory.md wrote:For Pis with less than 1GB of memory, the default is 64; for Pis with 1GB or more of memory the default is 76.

Soulex
Posts: 58
Joined: Tue Feb 09, 2021 10:09 am

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:23 pm

trejan wrote:
Thu Jun 17, 2021 8:21 pm
Soulex wrote:
Thu Jun 17, 2021 8:15 pm
trejan wrote:
Thu Jun 17, 2021 8:12 pm
The best option for nearly everybody is to use the default. Increasing the allocation doesn't improve performance.
What is the default?
Don't set any gpu_mem= line in /boot/config.txt and it'll use the default.
https://www.raspberrypi.org/documentation/configuration/config-txt/memory.md wrote:For Pis with less than 1GB of memory, the default is 64; for Pis with 1GB or more of memory the default is 76.
oh ok thank you
What would happen if i use like 1024 gpu mem

trejan
Posts: 3345
Joined: Tue Jul 02, 2019 2:28 pm

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:25 pm

Soulex wrote:
Thu Jun 17, 2021 8:23 pm
What would happen if i use like 1024 gpu mem
It won't boot.

Read https://www.raspberrypi.org/documentati ... /memory.md

Soulex
Posts: 58
Joined: Tue Feb 09, 2021 10:09 am

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:26 pm

trejan wrote:
Thu Jun 17, 2021 8:25 pm
Soulex wrote:
Thu Jun 17, 2021 8:23 pm
What would happen if i use like 1024 gpu mem
It won't boot.
is that with all pis or just most of them because i can boot with 1024

trejan
Posts: 3345
Joined: Tue Jul 02, 2019 2:28 pm

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:29 pm

Soulex wrote:
Thu Jun 17, 2021 8:26 pm
trejan wrote:
Thu Jun 17, 2021 8:25 pm
Soulex wrote:
Thu Jun 17, 2021 8:23 pm
What would happen if i use like 1024 gpu mem
It won't boot.
is that with all pis or just most of them because i can boot with 1024
If it does boot then they've changed the firmware to either clamp it at a lower value or it is ignoring your attempt to set to 1GB. Either way, it will be decreasing available resources as it will be taking away memory from Linux. Go read https://www.raspberrypi.org/documentati ... /memory.md as it answers all of these questions...

Soulex
Posts: 58
Joined: Tue Feb 09, 2021 10:09 am

Re: How much gpu memory should i use

Thu Jun 17, 2021 8:30 pm

trejan wrote:
Thu Jun 17, 2021 8:29 pm
Soulex wrote:
Thu Jun 17, 2021 8:26 pm
trejan wrote:
Thu Jun 17, 2021 8:25 pm

It won't boot.
is that with all pis or just most of them because i can boot with 1024
If it does boot then they've changed the firmware to either clamp it at a lower value or it is ignoring your attempt to set to 1GB. Either way, it will be decreasing available resources as it will be taking away memory from Linux. Go read https://www.raspberrypi.org/documentati ... /memory.md as it answers all of these questions...
ok thank you

User avatar
kerry_s
Posts: 2190
Joined: Thu Jan 30, 2020 7:14 pm

Re: How much gpu memory should i use

Fri Jun 18, 2021 3:06 am

Soulex wrote:
Thu Jun 17, 2021 8:30 pm
trejan wrote:
Thu Jun 17, 2021 8:29 pm
Soulex wrote:
Thu Jun 17, 2021 8:26 pm


is that with all pis or just most of them because i can boot with 1024
If it does boot then they've changed the firmware to either clamp it at a lower value or it is ignoring your attempt to set to 1GB. Either way, it will be decreasing available resources as it will be taking away memory from Linux. Go read https://www.raspberrypi.org/documentati ... /memory.md as it answers all of these questions...
ok thank you
doesn't matter how much ram there is over all, it shares 1024 between cpu & gpu, so for example you set to 512gpu, cpu only gets 512 to use, your basically slowing things down. you should not need to go higher than 128, for normal use, you can also set it lower giving cpu more, i've gone down to 24 without issues.

User avatar
Imperf3kt
Posts: 4582
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia
Contact: Twitter

Re: How much gpu memory should i use

Fri Jun 18, 2021 8:04 am

viewtopic.php?t=249122#p1534581

There were seversl posts around the time this post was created that explain the issue better, but essentially you only need more than the default memory if you're using things like the camera. The Pi can only access the first GB of RAM for certain uses, and some of that is lost to overhead as it is.
55:55:44:44:4C
52:4C:52:42:41

Rose tinted glasses are difficult to see through.

LTolledo
Posts: 5563
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: How much gpu memory should i use

Fri Jun 18, 2021 10:11 am

I set mine at 192MB.... its required by Kodi..
no arguments there.... just works!
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

Soulex
Posts: 58
Joined: Tue Feb 09, 2021 10:09 am

Re: How much gpu memory should i use

Fri Jun 18, 2021 6:01 pm

kerry_s wrote:
Fri Jun 18, 2021 3:06 am
Soulex wrote:
Thu Jun 17, 2021 8:30 pm
trejan wrote:
Thu Jun 17, 2021 8:29 pm

If it does boot then they've changed the firmware to either clamp it at a lower value or it is ignoring your attempt to set to 1GB. Either way, it will be decreasing available resources as it will be taking away memory from Linux. Go read https://www.raspberrypi.org/documentati ... /memory.md as it answers all of these questions...
ok thank you
doesn't matter how much ram there is over all, it shares 1024 between cpu & gpu, so for example you set to 512gpu, cpu only gets 512 to use, your basically slowing things down. you should not need to go higher than 128, for normal use, you can also set it lower giving cpu more, i've gone down to 24 without issues.
ok thank you for explaining that

Soulex
Posts: 58
Joined: Tue Feb 09, 2021 10:09 am

Re: How much gpu memory should i use

Fri Jun 18, 2021 6:02 pm

Imperf3kt wrote:
Fri Jun 18, 2021 8:04 am
viewtopic.php?t=249122#p1534581

There were seversl posts around the time this post was created that explain the issue better, but essentially you only need more than the default memory if you're using things like the camera. The Pi can only access the first GB of RAM for certain uses, and some of that is lost to overhead as it is.
Thanks i shall have a read of that forum

Return to “Advanced users”