21

I am trying to figure out a good split for the CPU/GPU. Is there a way to monitor the CPU and GPU usage to see where I should make the split?

  • 1
    This question might be useful for you. – Jivings Jan 7 '13 at 7:04
  • 1
    IMO the question is confusing. Do you want to know the memory usage for application and graphic (so you can define the split) or do you want to know the current CPU/GPU load? – keiki Jan 7 '13 at 15:05
  • @otakun85 I want to know the current usage of the applications so that I can make a good decision about where to make the split – Scoop Jan 7 '13 at 21:33
  • @Jivings Yeah that was a good question. Is good to know that certain features come on and turn off depending on how much memory is allocated to GPU. If possible though it would be helpful to know the exact usage too determine which category I fall into – Scoop Jan 8 '13 at 0:25
12

One easy solution is to get the Raspberry Pi itself to manage how the RAM is split between the CPU and GPU with dynamic memory split. While raspi-config cannot do this for you, there are example settings for /boot/config.txt available on the forums.

  • Thanks for this. I was not aware that the team had got the dynamic split right. – Vincent P Jan 8 '13 at 5:34
14

You can get a real-time view of memory usage using either the top or htop command. You may need to install htop if you get the message htop: command not found. Assuming you are using Raspbian, install it by running sudo apt-get install htop

  • 2
    What are the benefits over the regular top? – Morgan Courbet Jan 7 '13 at 19:23
  • 1
    htop seems to be "better" htop.sourceforge.net/index.php?page=comparison – Scoop Jan 8 '13 at 0:15
  • 1
    htop is more user friendly. I always use htop instead of top – w0rldart Jan 23 '13 at 13:02
  • Plus, if you are using a multi-core machine such as RPi 2 you see the load for each core in a nice bar graph, and for example when you see 'python' in the list of tasks it shows the entire comamnd line so you see which program is running – jpwynn Jan 23 '16 at 22:39
  • @jpwynn Note that with top you press 1 and you see all processors too. But I agree that htop is generally better/easier to use. – Alexis Wilke Mar 14 '18 at 2:11
11

Basically you cannot currently get the GPU usage. You can only get the CPU usage, try the top command.

Regarding the optimum CPU/GPU split. It really depends on what you are using your RPi for. If your not playing videos and games (GPU optimized), then give the CPU the most amount of RAM. Also if your running "headless" (Not connected to a screen) then assign the CPU as much RAM as you can.

Chromium does not currently use the GPU, check the following thread. It's from one of the guys doing the development of Chromium for the Raspberry Pi. Also there are some tips on how to get Chromium to run faster in the original post.

  • so the issue is that I am not sure if chrome uses the gpu or not. And if it does, for what types of things. It would be useful to GPU usage, but might not be possible – Scoop Jan 8 '13 at 0:23
  • @Scoop I've updated my answer accordingly. – Vincent P Jan 8 '13 at 5:33
  • @Scoop From my test today (2018) support for the GPU is included in the Chrome browser. You can see it by going to chrome://gpu. – Alexis Wilke Mar 14 '18 at 4:14
7

To monitor the RAM usage, you can run free -h -s 1. Every second (-s 1), a similar table will be displayed:

             total       used       free     shared    buffers     cached
Mem:          438M       146M       292M         0B        15M       102M
-/+ buffers/cache:        28M       409M
Swap:          99M         0B        99M

The line Mem: is what you are looking for.

In the example above, you can see that, on a total of 438MB, 146MB are currently used, and 292MB remain free. On my 512MB RPi, I have set 64MB for the GPU.

  • 2
    Note that this is not actually CPU usage, it's RAM usage. – Hut8 Aug 15 '13 at 18:25
3

To monitor the CPU, RAM and SWAP usage in Raspbian, you can use TOP or HTOP.

In terminal, run top. TOP is available by default, and gives reasonably good details. TOP in Raspbian Terminal RPi3

But, I find HTOP to be more useful, with better details and features available. HTOP is not available by default, and need to be installed.

Run sudo apt-get update && sudo apt-get install htop in Terminal to install HTOP.

In terminal, run htop after the install is completed.

HTOP in Raspbian RPi 3

Hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.