Disable GPU to free RAM

Post Reply
evrflx
Posts: 11
Joined: Fri Apr 05, 2019 4:16 am
languages_spoken: english
ODROIDs: 4 C2, 2 XU4, 5 N2
Has thanked: 0
Been thanked: 3 times
Contact:

Disable GPU to free RAM

Unread post by evrflx » Tue Apr 30, 2019 3:10 pm

Hi,

for the C2 I need to set the 'nographics' option in order to free up the RAM allocated to the GPU.
Is the same possible for the N2?

Currently only about 3.7GB are usable - since the 4GB option was the primary driver for me to upgrade to the N2 it would be really appreciated if the RAM could be maximized.

Code: Select all

free -m
              total        used        free      shared  buff/cache   available
Mem:           3710         168        3472           0          68        3507

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Disable GPU to free RAM

Unread post by odroid » Tue Apr 30, 2019 3:14 pm

We have a plan to implement that Kernel option in May or June.
These users thanked the author odroid for the post:
xabolcs (Tue Apr 30, 2019 5:48 pm)

evrflx
Posts: 11
Joined: Fri Apr 05, 2019 4:16 am
languages_spoken: english
ODROIDs: 4 C2, 2 XU4, 5 N2
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Disable GPU to free RAM

Unread post by evrflx » Tue May 21, 2019 5:02 pm

Will this become part of the mainline linux kernel (5.2 ?) as well, or is it specific for the odroid kernel for the time beeing?

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Disable GPU to free RAM

Unread post by odroid » Tue May 21, 2019 5:35 pm

We've tried with on our own Kernel tree 4.9.
But there were many negative side effects and it is very hard to tell you when it is available.

evrflx
Posts: 11
Joined: Fri Apr 05, 2019 4:16 am
languages_spoken: english
ODROIDs: 4 C2, 2 XU4, 5 N2
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Disable GPU to free RAM

Unread post by evrflx » Tue May 21, 2019 6:40 pm

Thanks for working on that!
I would appreciate it very much if it was at least possible to limit the amount of memory dedicated to the GPU, f.e. to 64mb instead of the 300mb which is about 10% of the 4GB board.
Though I am not a kernel developer, is there any way to help to get that feature shipped?

BadPritt
Posts: 159
Joined: Wed Jan 17, 2018 4:08 am
languages_spoken: english dutch french spanish german
ODROIDs: Odroid C2
Odroid XU4Q
Has thanked: 18 times
Been thanked: 17 times
Contact:

Re: Disable GPU to free RAM

Unread post by BadPritt » Wed May 22, 2019 1:10 am

Have you thought of using zram?
You can have another 1.8GB if you activate zram. It comes at a very light cost of cpu performance. But on the N2 you can't notice this since the CPU's are so powerful. Even a raspberry pi handles zram well.
I use 1.8GB zram + a swapfile of 10gb. I use the 128GB eMMC for that. Those are the fastest. I would not do that on 16GB eMMC or less.
So I've got +15GB of useable memory. I use it for blender, and it works great. I don't care about how long my renders take, only about good quality of them.
Look here at post 8 from Phaseshifter for instructions on how to use zram. You need to configure it yourself. You can also configure it better to your needs.
viewtopic.php?f=177&t=34540
These users thanked the author BadPritt for the post:
alvarow (Thu Aug 08, 2019 10:16 am)

evrflx
Posts: 11
Joined: Fri Apr 05, 2019 4:16 am
languages_spoken: english
ODROIDs: 4 C2, 2 XU4, 5 N2
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Disable GPU to free RAM

Unread post by evrflx » Wed May 22, 2019 3:22 am

Yes, I did, thanks for the suggestion, though. I especially bought the N2 to get 4gb ram machines and it is a little disappointing to get just 90% there after all.
Talking about zram: Make sure to use the right algorithm, I believe zstd is much faster and better at the same time compared to lz4 or deflate. If you kernel has the algorithm compiled in or as a module, it is a mere parameter setting.

evrflx
Posts: 11
Joined: Fri Apr 05, 2019 4:16 am
languages_spoken: english
ODROIDs: 4 C2, 2 XU4, 5 N2
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Disable GPU to free RAM

Unread post by evrflx » Thu Jul 18, 2019 5:37 am

@odroid any update on this? I would be happy to use the mainline kernel if that brings the machine any nearer to full 4gb ram. (if side effect of turning off the gpu would be loosing usb that would be fine, btw ;) )

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Disable GPU to free RAM

Unread post by odroid » Thu Jul 18, 2019 11:51 am

Because some internal peripheral registers are located in the 4GB memory space, we couldn't free ~200MB of RAM probably. Sorry about that.

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Disable GPU to free RAM

Unread post by odroid » Wed Aug 14, 2019 10:26 am

We found a hidden 128MiB block. :o
Please update the system with today's uboot package.

Code: Select all

root@odroid:~# free -m                                                          
              total        used        free      shared  buff/cache   available 
Mem:           3838         484        2826          20         527        3298 
Swap:             0           0           0   
These users thanked the author odroid for the post (total 3):
alvarow (Wed Aug 14, 2019 11:20 am) • elatllat (Thu Aug 15, 2019 4:35 am) • xabolcs (Thu Aug 15, 2019 2:30 pm)

alvarow
Posts: 35
Joined: Wed Apr 10, 2019 10:44 pm
languages_spoken: english
ODROIDs: N2
Has thanked: 16 times
Been thanked: 1 time
Contact:

Re: Disable GPU to free RAM

Unread post by alvarow » Wed Aug 14, 2019 11:22 am

Yay! :-D . Just updated here:

Code: Select all

alvaro@odroid:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3712         169        2006           3        1536        3504
Swap:             0           0           0
After:

Code: Select all

alvaro@odroid:~$ free -m
              total        used        free      shared  buff/cache   available
Mem:           3838         169        3318           3         350        3630
Swap:             0           0           0
Good job! Thanks for looking into this! Much appreciated!

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Disable GPU to free RAM

Unread post by odroid » Wed Aug 14, 2019 11:46 am

Thank you for the confirmation. :)

User avatar
mad_ady
Posts: 6860
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 236 times
Been thanked: 177 times
Contact:

Re: Disable GPU to free RAM

Unread post by mad_ady » Wed Aug 14, 2019 2:25 pm

Yay! Free ram upgrade!
These users thanked the author mad_ady for the post:
xabolcs (Thu Aug 22, 2019 1:45 am)

User avatar
odroid
Site Admin
Posts: 32677
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 209 times
Been thanked: 364 times
Contact:

Re: Disable GPU to free RAM

Unread post by odroid » Wed Aug 21, 2019 10:33 am

The boot-loader update caused serious system instability. :oops:
So we reverted the changes.
Sorry about that.
These users thanked the author odroid for the post:
paulcrawford (Wed Aug 21, 2019 9:49 pm)

evrflx
Posts: 11
Joined: Fri Apr 05, 2019 4:16 am
languages_spoken: english
ODROIDs: 4 C2, 2 XU4, 5 N2
Has thanked: 0
Been thanked: 3 times
Contact:

Re: Disable GPU to free RAM

Unread post by evrflx » Thu Oct 10, 2019 6:00 am

I keep on hoping that there is a way to get to more usable memory, please have a look at it (again), if possible. Thanks!
These users thanked the author evrflx for the post:
vjoel (Fri Oct 11, 2019 5:28 am)

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 0 guests