webbsmurfen
Posts: 59
Joined: Fri Jun 27, 2014 12:22 pm
Location: Sweden

To limit the amount of GPU memory in RPI4 B

Tue Jul 23, 2019 8:48 am

In the older Raspberry PI you could limit the amount of memory the GPU used by the system by entering a line in config.txt
gpu_mem=16

But how do you do this with the new Raspberry PI 4 that have 2 HDMI-ports? I intend only to use one of the ports

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

Re: To limit the amount of GPU memory in RPI4 B

Tue Jul 23, 2019 9:12 am

The same. Set max_framebuffers to 1 in config.txt to reduce memory requirements for the framebuffers in legacy mode, and probably has some effect in FKMS mode as well.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

jahboater
Posts: 5759
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: To limit the amount of GPU memory in RPI4 B

Tue Jul 23, 2019 9:16 am

jamesh wrote:
Tue Jul 23, 2019 9:12 am
The same. Set max_framebuffers to 1 in config.txt to reduce memory requirements for the framebuffers in legacy mode, and probably has some effect in FKMS mode as well.
I don't suppose you can set max_framebuffers=0 for a headless Pi?

webbsmurfen
Posts: 59
Joined: Fri Jun 27, 2014 12:22 pm
Location: Sweden

Re: To limit the amount of GPU memory in RPI4 B

Tue Jul 23, 2019 9:32 am

jamesh wrote:
Tue Jul 23, 2019 9:12 am
The same. Set max_framebuffers to 1 in config.txt to reduce memory requirements for the framebuffers in legacy mode, and probably has some effect in FKMS mode as well.
Thanks!

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

Re: To limit the amount of GPU memory in RPI4 B

Tue Jul 23, 2019 11:13 am

jahboater wrote:
Tue Jul 23, 2019 9:16 am
jamesh wrote:
Tue Jul 23, 2019 9:12 am
The same. Set max_framebuffers to 1 in config.txt to reduce memory requirements for the framebuffers in legacy mode, and probably has some effect in FKMS mode as well.
I don't suppose you can set max_framebuffers=0 for a headless Pi?
Not sure, try it and see?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

jahboater
Posts: 5759
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: To limit the amount of GPU memory in RPI4 B

Tue Jul 23, 2019 12:59 pm

jamesh wrote:
Tue Jul 23, 2019 11:13 am
jahboater wrote:
Tue Jul 23, 2019 9:16 am
jamesh wrote:
Tue Jul 23, 2019 9:12 am
The same. Set max_framebuffers to 1 in config.txt to reduce memory requirements for the framebuffers in legacy mode, and probably has some effect in FKMS mode as well.
I don't suppose you can set max_framebuffers=0 for a headless Pi?
Not sure, try it and see?
Seems to work!

Code: Select all

pi@pi4:~ $ free -h
              total        used        free      shared  buff/cache   available
Mem:          3.9Gi        77Mi       3.7Gi       8.0Mi        68Mi       3.7Gi
Swap:          99Mi          0B        99Mi
pi@pi4:~ $ 

Return to “Beginners”