Memory split

Moderators: mdrjr, odroid

Memory split

Unread postby MacFizz » Fri Mar 25, 2016 5:50 pm

I'm using my C2 headless with xrdp, so "wasting" 250MB of Ram on GPU is a bummer.
Is there a way to modify the split of the RAM (like on a rpi where you just tell in the config how much memory goes to graphics).
If not, would there be any ways to use this unused ram as ramdisk, zram, swap or whatever.
By default, there's no swap configured and as I'm using some RAM hungry apps, I'm concerned it mught become a problem.

Any thoughts?
MacFizz
 
Posts: 17
Joined: Tue Mar 15, 2016 12:04 am
languages_spoken: english, french
ODROIDs: C2

Re: Memory split

Unread postby meveric » Fri Mar 25, 2016 6:20 pm

This is no RPi.
The RAM that is missing is not on the GPU, but actually on the VPU and HDMI support.
On the C1 there were options in the boot.ini file to disable VPU support and HDMI output, which gave about 150 MB extra RAM.

You can create a file on your rootfs and use it as SWAP if you want. Or use ZRAM if you run an OS that supports it, or a combination of both.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 9310
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go

Re: Memory split

Unread postby MacFizz » Fri Mar 25, 2016 8:37 pm

meveric wrote:This is no RPi.
The RAM that is missing is not on the GPU, but actually on the VPU and HDMI support.
On the C1 there were options in the boot.ini file to disable VPU support and HDMI output, which gave about 150 MB extra RAM.

You can create a file on your rootfs and use it as SWAP if you want. Or use ZRAM if you run an OS that supports it, or a combination of both.

Yeah, kind of noticed that's no RPi, but a sbc is still a sbc.
So, what you're saying is that, this RAM if effectively useless (16Mb for a headless server, making hdmi available for debug would be far enough).
It cannot be "re-used" in any easy and convinient ways .
This option is probably kernel dependent, I'll investigate.
I'm a not sure of the effects of putting a swap file on an eMMC or SDcard...
MacFizz
 
Posts: 17
Joined: Tue Mar 15, 2016 12:04 am
languages_spoken: english, french
ODROIDs: C2

Re: Memory split

Unread postby crashoverride » Sat Mar 26, 2016 2:36 am

There is a thread somewhere where it was announced that the boot.ini switches would be added for C2 at a future date. In the meantime, if you want to "do it yourself", you can manually remove the device tree entries that reserve memory and enable the GPU and VPU. This is exactly what the C1 boot.ini does.

https://github.com/mdrjr/c1_bootini/blob/master/boot.ini#L89-L91

https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts
crashoverride
 
Posts: 4023
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Memory split

Unread postby meveric » Sat Mar 26, 2016 7:13 am

MacFizz wrote:Yeah, kind of noticed that's no RPi, but a sbc is still a sbc.

No it's not. Not every SBC is doing it the same way.
For example, if you have a ODROID U3 it boots up with 2023 out of 2047 MB of RAM and still has GPU VPU and HDMI powered.
While on the C1 and C2 it uses vast amount of memory to get these things into "ready" state. Which are wasted if you use it headless.
MacFizz wrote:So, what you're saying is that, this RAM if effectively useless (16Mb for a headless server, making hdmi available for debug would be far enough).
It cannot be "re-used" in any easy and convinient ways .

Not until the changes are done by hardkernel or as crashoverride suggested you remove the options from the device tree.
I'm a not sure of the effects of putting a swap file on an eMMC or SDcard...

ok, first you ask why there is no SWAP active, they you are like "I don't want to put swap on eMMC or SD card"
Makes me wonder what you expect how it should work.
The only other way to do it is using ZRAM which is no realy SWAP, but compressed memory (but still shown as SWAP).
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.
User avatar
meveric
 
Posts: 9310
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go

Re: Memory split

Unread postby Paint » Sat Mar 26, 2016 9:52 am

crashoverride wrote:There is a thread somewhere where it was announced that the boot.ini switches would be added for C2 at a future date. In the meantime, if you want to "do it yourself", you can manually remove the device tree entries that reserve memory and enable the GPU and VPU. This is exactly what the C1 boot.ini does.

https://github.com/mdrjr/c1_bootini/blob/master/boot.ini#L89-L91

https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts


can you give an example of what needs to be removed from meson64_odroidc2.dts to remove memory reservations?
Paint
 
Posts: 88
Joined: Tue Mar 15, 2016 7:41 am
languages_spoken: English
ODROIDs: C2 with 64gb eMMC

Re: Memory split

Unread postby crashoverride » Sat Mar 26, 2016 10:08 am

Paint wrote:can you give an example of what needs to be removed from meson64_odroidc2.dts to remove memory reservations?

https://github.com/mdrjr/c1_bootini/blob/master/boot.ini#L89-L91

if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi

if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi

fdt = flattened device tree
rm = remove
/(name) = node name

/mesonstream
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L197-L209

/vdec
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L222-L238

/ppmgr
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L247-L252

/mesonfb (now called meson-fb)
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L119-L132

If the C2 uboot already has the 'fdt' command enabled, then you can just copy/paste the lines from the C1 boot.ini.
crashoverride
 
Posts: 4023
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Memory split

Unread postby Paint » Sat Mar 26, 2016 10:12 am

crashoverride wrote:
Paint wrote:can you give an example of what needs to be removed from meson64_odroidc2.dts to remove memory reservations?

https://github.com/mdrjr/c1_bootini/blob/master/boot.ini#L89-L91

if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi

if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi

fdt = flattened device tree
rm = remove
/(name) = node name

/mesonstream
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L197-L209

/vdec
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L222-L238

/ppmgr
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L247-L252

/mesonfb (now called meson-fb)
https://github.com/hardkernel/linux/blob/odroidc2-3.14.y/arch/arm64/boot/dts/meson64_odroidc2.dts#L119-L132

If the C2 uboot already has the 'fdt' command enabled, then you can just copy/paste the lines from the C1 boot.ini.


FDT is not included in the C2 uboot. I only have fdp, fdtdump, fdtget, and fdtput.
How do I add fdt to my kernel build? https://github.com/JoshDi/linux/tree/odroidc2-3.14.y

Once FDT is enabled, I only need to add the following to boot.ini and set the variables as per the earlier lines in the c1 boot.ini? Thank you for your help!

Code: Select all
if test "${vpu}" = "0"; then fdt rm /mesonstream; fdt rm /vdec; fdt rm /ppmgr; fi

if test "${hdmioutput}" = "0"; then fdt rm /mesonfb; fi
Last edited by Paint on Sat Mar 26, 2016 10:19 am, edited 1 time in total.
Paint
 
Posts: 88
Joined: Tue Mar 15, 2016 7:41 am
languages_spoken: English
ODROIDs: C2 with 64gb eMMC

Re: Memory split

Unread postby crashoverride » Sat Mar 26, 2016 10:18 am

Uboot needs to support the "fdt" command and the boot.ini entries needs to be syntactically correct. The configuration needs to be tested to ensure the kernel will boot and run in the absence of the entries and is not failing dependency assumptions.

[edit]
In other words, it works by disabling device tree entries so the drivers are not loaded. If you have the required skills/tools and are comfortable performing tests, the relevant information has been presented. Do not expect technical support until an official solution is released.
crashoverride
 
Posts: 4023
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Memory split

Unread postby crashoverride » Sat Mar 26, 2016 10:24 am

Paint wrote:How do I add fdt to my kernel build?

Its a uboot command:
https://github.com/hardkernel/u-boot/tree/odroidc2-v2015.01
crashoverride
 
Posts: 4023
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1

Re: Memory split

Unread postby Paint » Sat Mar 26, 2016 10:28 am

crashoverride wrote:
Paint wrote:How do I add fdt to my kernel build?

Its a uboot command:
https://github.com/hardkernel/u-boot/tree/odroidc2-v2015.01


thank you! I will take a look
Paint
 
Posts: 88
Joined: Tue Mar 15, 2016 7:41 am
languages_spoken: English
ODROIDs: C2 with 64gb eMMC

Re: Memory split

Unread postby MacFizz » Sat Mar 26, 2016 9:15 pm

meveric wrote:ok, first you ask why there is no SWAP active, they you are like "I don't want to put swap on eMMC or SD card"
Makes me wonder what you expect how it should work.
The only other way to do it is using ZRAM which is no realy SWAP, but compressed memory (but still shown as SWAP).

What I was implying when talking about swap is that, if that VPU memory cannot be accounted as RAM, it might be addressed differently and used as a ramdisk, where you coul put a swap file.
Not an ideal solution but better than nothing.

Anyway, I'll make a few tests with the modifications proposed.
MacFizz
 
Posts: 17
Joined: Tue Mar 15, 2016 12:04 am
languages_spoken: english, french
ODROIDs: C2

Re: Memory split

Unread postby mogu2 » Sat May 07, 2016 6:56 pm

Did anyone manage to get it working with the boot.ini "fdt rm" changes ? I tried it, but it just freezes at boot...
mogu2
 
Posts: 3
Joined: Sun Nov 01, 2015 11:34 pm
languages_spoken: english
ODROIDs: XU3

Re: Memory split

Unread postby pjb304 » Wed Sep 12, 2018 7:47 pm

crashoverride wrote:There is a thread somewhere where it was announced that the boot.ini switches would be added for C2 at a future date.


2 years later does anyone know if these switches have been implemented? Or is the best way still to edit the dts file?
pjb304
 
Posts: 2
Joined: Wed Sep 12, 2018 7:40 pm
languages_spoken: english
ODROIDs: C2

Re: Memory split

Unread postby igorpec » Wed Sep 12, 2018 7:50 pm

2 years later


... you might check a modern kernel (4.18.y) especially if you are running headless.
ARMBIAN - follow on Twitter
linux for ARM development boards with user friendly development tools
User avatar
igorpec
 
Posts: 239
Joined: Sat Dec 12, 2015 4:34 pm
languages_spoken: english,german,slovene
ODROIDs: XU4, HC1, C2, C1+

Re: Memory split

Unread postby pjb304 » Wed Sep 12, 2018 8:49 pm

Having done some more digging it seems that yes the switch is now available. I edited /media/boot/boot.ini and set the following option

Code: Select all
setenv nographics "1"


At which point my available RAM went from 1717MB to 1974MB or 2021784Bytes.
pjb304
 
Posts: 2
Joined: Wed Sep 12, 2018 7:40 pm
languages_spoken: english
ODROIDs: C2


Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 2 guests