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?
You can get a real-time view of memory usage using either the
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
Basically you cannot currently get the GPU usage. You can only get the CPU usage, try the
Update Raspbian now includes
htop which is more verbose and easier to read
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.
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
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.
To monitor the CPU, RAM and SWAP usage in Raspbian, you can use TOP or HTOP.
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.
sudo apt-get update && sudo apt-get install htop in Terminal to install HTOP.
In terminal, run
htop after the install is completed.
Hope that helps.
The command that will give you insight into what's being allocated by the GPU is
sudo vcdbg reloc. The output looks like what begins here. In my case, I could see that the 236M allocated was too close to the value in
gpu_mem=256 so I needed to bump that up a little.
Relocatable heap version 4 found at 0x30000000 total space allocated is 236M, with 234M relocatable, 2.3M legacy and 0 offline 1 legacy blocks of size 2359296 free list at 0x3ad9aaa0 352 free memory in 2 free block(s) largest free block is 320 bytes 0x30000000: legacy block 2.3M 0x30240000: free 320 [ 80] 0x30240140: used 608 (refcount 1 lock count 0, size 540, align 4, data 0x30240160, d0rual) 'GLXX_TEXTURE_T' [ 78] 0x302403a0: used 192 (refcount 1 lock count 0, size 128, align 4, data 0x302403c0, D1rual) 'GLXX_BUFFER_INNER_T.storage'