Page 1 of 1

How to check if dynamic memory split is working?

Posted: Sun Dec 22, 2019 1:57 pm
by Shiqi
I have added coherent_pool=6M smsc95xx.turbo_mode=N in cmdline.txt
and
cma_lwm=16
cma_hwm=32
cma_offline_start=16
in config,txt
But how to check if dynamic memory split is working?

Re: How to check if dynamic memory split is working?

Posted: Sun Dec 22, 2019 10:01 pm
by 6by9
Where have you got those config.txt settings from? None of them are supported, and I thought had been removed.
They were from old Broadcom android platforms, and even then it was a bit hit and miss.

Re: How to check if dynamic memory split is working?

Posted: Mon Dec 23, 2019 5:42 am
by Shiqi
6by9 wrote:
Sun Dec 22, 2019 10:01 pm
Where have you got those config.txt settings from? None of them are supported, and I thought had been removed.
They were from old Broadcom android platforms, and even then it was a bit hit and miss.
Here
https://elinux.org/RPiconfig

Re: How to check if dynamic memory split is working?

Posted: Mon Dec 23, 2019 7:04 am
by 6by9
3rd party content. It also contains the sentence
Note: As per https://github.com/raspberrypi/linux/issues/503 popcornmix states that CMA is not officially supported.
A static cma heap is supported and used (particularly with pi4).

Re: How to check if dynamic memory split is working?

Posted: Mon Dec 23, 2019 7:20 am
by 6by9
https://github.com/raspberrypi/linux/co ... e8d115b104
commit b017e4f94b17ac322340159f63c546e8d115b104
Author: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Tue Oct 17 16:21:13 2017 +0100

vc-cma: Remove the driver as non-functional on Pi

vc-cma was pulled in from previous platforms. It
supposedly allowed the VPU relocatable heap to be
released to the kernel as CMA, but it was always
a little fragile.

Remove it to avoid complications.
That was on the 4.9 branch.

Re: How to check if dynamic memory split is working?

Posted: Sat Jan 11, 2020 4:54 am
by bluenote
6by9 wrote:
Mon Dec 23, 2019 7:20 am
https://github.com/raspberrypi/linux/co ... e8d115b104
commit b017e4f94b17ac322340159f63c546e8d115b104
Author: Dave Stevenson <dave.stevenson@raspberrypi.org>
Date: Tue Oct 17 16:21:13 2017 +0100

vc-cma: Remove the driver as non-functional on Pi

vc-cma was pulled in from previous platforms. It
supposedly allowed the VPU relocatable heap to be
released to the kernel as CMA, but it was always
a little fragile.

Remove it to avoid complications.
That was on the 4.9 branch.
Sorry to be dense here, but does this mean there's no way to dynamically assign video memory in raspbian anymore? For example to run Kodi but then go back to more regular ram intensive applications?
Thanks.

Re: How to check if dynamic memory split is working?

Posted: Sat Jan 11, 2020 3:00 pm
by 6by9
bluenote wrote:
Sat Jan 11, 2020 4:54 am
Sorry to be dense here, but does this mean there's no way to dynamically assign video memory in raspbian anymore? For example to run Kodi but then go back to more regular ram intensive applications?
No, there is no way to dynamically assign gpu_mem to hand memory back to the ARM. The old mechanism was just too unstable to be worth supporting.
Very few use cases need more than 128MB of gpu_mem which isn't a huge sacrifice on any of the 1GB models. 512MB versions you'll probably want to reboot with alternate settings.

Re: How to check if dynamic memory split is working?

Posted: Sat Jan 11, 2020 4:45 pm
by andrum99
6by9 wrote:
Sat Jan 11, 2020 3:00 pm
bluenote wrote:
Sat Jan 11, 2020 4:54 am
Sorry to be dense here, but does this mean there's no way to dynamically assign video memory in raspbian anymore? For example to run Kodi but then go back to more regular ram intensive applications?
No, there is no way to dynamically assign gpu_mem to hand memory back to the ARM. The old mechanism was just too unstable to be worth supporting.
Very few use cases need more than 128MB of gpu_mem which isn't a huge sacrifice on any of the 1GB models. 512MB versions you'll probably want to reboot with alternate settings.
Just to add - the Pi 4B doesn't use the gpu_mem allocation for most of its GPU activities. Instead, the memory is dynamically allocated at run time from within Linux.

Re: How to check if dynamic memory split is working?

Posted: Sat Jan 11, 2020 8:17 pm
by bluenote
6by9 wrote:
Sat Jan 11, 2020 3:00 pm
bluenote wrote:
Sat Jan 11, 2020 4:54 am
Sorry to be dense here, but does this mean there's no way to dynamically assign video memory in raspbian anymore? For example to run Kodi but then go back to more regular ram intensive applications?
No, there is no way to dynamically assign gpu_mem to hand memory back to the ARM. The old mechanism was just too unstable to be worth supporting.
Very few use cases need more than 128MB of gpu_mem which isn't a huge sacrifice on any of the 1GB models. 512MB versions you'll probably want to reboot with alternate settings.
Ok thanks for clarifying. I find on my pi2b 200 MB GPU is too little to get HEVC decoding to work, 300 is enough though (haven't tested in between as yet..). I guess I have a choice of either dual booting raspbian/libreelec or writing a little script to change config.txt and reboot to switch between raspbian memory configs. But really HEVC decoding on the pi2b is ... a fantastic bonus as it is.