i.MX6 GPU Memory Allocation

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX6 GPU Memory Allocation

5,646 Views
davidwretman
Contributor II

Hello,

I am working on a custom i.MX6Q based board with 1 GiB of RAM. I am using Linux kernel version 4.1.15-2.0.0.

Currently the GPU is allocated 32MB of RAM as confirmed by:

# cat /sys/kernel/debug/gc/meminfo
VIDEO MEMORY:
 gcvPOOL_SYSTEM:
 Free : 9792956 B
 Used : 23761476 B
 Total : 33554432 B
 gcvPOOL_CONTIGUOUS:
 Used : 0 B
 gcvPOOL_VIRTUAL:
 Used : 0 B

NON PAGED MEMORY:
 Used : 0 B

I want to increase this allocation to 64 or 128 MB. I have tried to achieve this by setting the kernel command line parameter galcore.contiguousSize=67108864, but /sys/kernel/debug/gc/meminfo still reports 32 MB. The galcore info on the other hand indicates that the driver seems to have accepted my kernel command line:

Galcore version 5.0.11.41671
Galcore options:
 irqLine = 301
 registerMemBase = 0x00130000
 registerMemSize = 0x00004000
 irqLine2D = 302
 registerMemBase2D = 0x00134000
 registerMemSize2D = 0x00004000
 irqLineVG = 303
 registerMemBaseVG = 0x02204000
 registerMemSizeVG = 0x00004000
 contiguousSize = 67108864
 contiguousBase = 0x00000000
 bankSize = 0x00000000
 fastClear = -1
 compression = -1
 signal = 48
 powerManagement = -1
 baseAddress = 0x00000000
 physSize = 0x80000000
 logFileSize = 0 KB 
 recovery = 1
 stuckDump = 0
 gpuProfiler = 0

Using the same command line parameter to lower the memory allocation works for me e.g. setting galcore.contiguousSize=8388608, gives:

# cat /sys/kernel/debug/gc/meminfo
VIDEO MEMORY:
 gcvPOOL_SYSTEM:
 Free : 185276 B
 Used : 8203332 B
 Total : 8388608 B
 gcvPOOL_CONTIGUOUS:
 Used : 15558144 B
 gcvPOOL_VIRTUAL:
 Used : 0 B

NON PAGED MEMORY:
 Used : 0 B

This makes me think I need to adjust the size of some other memory area to allocate more to the GPU. I just cannot figure out what. Please help me.

Regards,

David

Labels (3)
0 Kudos
5 Replies

1,640 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hi David,

On Uboot, try gpumem = 128M.

Regards

0 Kudos

1,640 Views
davidwretman
Contributor II

Hi,

Thanks for your reply!

I tried this but unfortunately it has no effect. My kernel command line is now:

console=ttymxc1,115200 vt.global_cursor_default=0 consoleblank=0 no_console_suspend=1 root=/dev/mmcblk3p3 rootwait rw rootfstype=ext4 galcore.contiguousSize=67108864 galcore.showArgs=1 gpumem=128M

For reference, the memory layout reported by the kernel on boot is:

Memory: 701612K/1048576K available (5766K kernel code, 220K rwdata, 1864K rodata, 1688K init, 398K bss, 346964K reserved, 0K cma-reserved)

Virtual kernel memory layout:
 vector : 0xffff0000 - 0xffff1000 ( 4 kB)
 fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
 vmalloc : 0xc0800000 - 0xff000000 (1000 MB)
 lowmem : 0x80000000 - 0xc0000000 (1024 MB)
 modules : 0x7f000000 - 0x80000000 ( 16 MB)
 .text : 0x80008000 - 0x8077be54 (7632 kB)
 .init : 0x8077c000 - 0x80922000 (1688 kB)
 .data : 0x80922000 - 0x809591a0 ( 221 kB)
 .bss : 0x809591a0 - 0x809bcc50 ( 399 kB)
SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
0 Kudos

1,640 Views
solkim
Contributor I

HI David.

I have gpu memory problem like you.

Did you resolve this problem?

0 Kudos

1,640 Views
davidwretman
Contributor II

Turned out not to be a real problem.

The GPU memory appeared to be only 32MB:

$ cat /sys/kernel/debug/gc/meminfo
VIDEO MEMORY:
gcvPOOL_SYSTEM:
Free : 9792956 B
Used : 23761476 B
Total : 33554432 B
gcvPOOL_CONTIGUOUS:
Used : 0 B
gcvPOOL_VIRTUAL:
Used : 0 B

NON PAGED MEMORY:
Used : 0 B

This is confusing as it only shows the system pool at 32MB and not the total GPU memory.

However, the kernel module reports this value if you enable the correct switch on the kernel command line ...

galcore.showArgs=1

The correct total is shown as 128MB (contiguousSize = 134217728)

This is controlled by the device-tree item contiguous_mem for the gpu. Which in the example is 0x8000000 (128MB).


Worth noting is that this is allocated from the "shared-dma-pool" (cma) which should always be larger than the gpu contiguous_mem.

0 Kudos

1,495 Views
phanikirankara
Contributor I

In Linux kernel 5.4 or maybe even before the Video memory is governed by contiguous_mem whose setting seems to be <0x0 0x8000000>. It is enabled even if cma is completely commented out from the device tree.

0 Kudos