AnsweredAssumed Answered

i.MX6 VPU mem allocation failed

Question asked by David Thompson on Dec 3, 2013
Latest reply on Apr 18, 2016 by Dilshad Alam

I'm looking for information on the correct way to reserve memory for the VPU to use for decoding. We are encountering errors where, while the board is under heavy load, video decoding cannot be started. We see the following error message:

[ERR] mem allocation failed!

 

What we're attempting to do, is test performance of video, while other processes are also using a lot of system resources. We start a video decoding, and everything is working well. Then we launch a separate process that consumes a lot of memory and cpu. Video decode continues to work correctly though. When the first video has completed, we attempt to launch another video. However, this time, it appears that the VPU cannot allocate enough memory for decoding, and fails immediately.

 

I have found similar issues posted here from the last year or two, although I haven't seen any definitive fix. Typically, the fix involves editting the board file and changing various reserved memory values, or changing kernel parameters. I believe I have tried nearly all of these fixes, but I haven't had much success. Is there a specific option to guarantee that certain memory will only be used for the VPU?

Here is a simplified version of the gstreamer pipeline I'm using to launch the decode.

gst-launch filesrc location=/home/root/test.h264 ! vpudec ! fakesink

 

The text of the kernel error is below

VPU interrupt received.

VPU interrupt received.

source-queue:sr: page allocation failure: order:11, mode:0xd1

[<8004a304>] (unwind_backtrace+0x0/0xf4) from [<800e8268>] (warn_alloc_failed+0xd4/0x10c)

[<800e8268>] (warn_alloc_failed+0xd4/0x10c) from [<800eb01c>] (__alloc_pages_nodemask+0x5f4/0x78c)

[<800eb01c>] (__alloc_pages_nodemask+0x5f4/0x78c) from [<8004d018>] (__dma_alloc+0x9c/0x2fc)

[<8004d018>] (__dma_alloc+0x9c/0x2fc) from [<8004d5b0>] (dma_alloc_coherent+0x60/0x68)

[<8004d5b0>] (dma_alloc_coherent+0x60/0x68) from [<803ecc7c>] (vpu_alloc_dma_buffer+0x2c/0x54)

[<803ecc7c>] (vpu_alloc_dma_buffer+0x2c/0x54) from [<803ed0cc>] (vpu_ioctl+0x428/0x8c4)

[<803ed0cc>] (vpu_ioctl+0x428/0x8c4) from [<801301bc>] (do_vfs_ioctl+0x3b4/0x530)

[<801301bc>] (do_vfs_ioctl+0x3b4/0x530) from [<8013036c>] (sys_ioctl+0x34/0x60)

[<8013036c>] (sys_ioctl+0x34/0x60) from [<80043840>] (ret_fast_syscall+0x0/0x30)

Mem-info:

DMA per-cpu:

CPU    0: hi:   90, btch:  15 usd:  14

CPU    1: hi:   90, btch:  15 usd:   4

CPU    2: hi:   90, btch:  15 usd:  75

CPU    3: hi:   90, btch:  15 usd:   0

Normal per-cpu:

CPU    0: hi:  186, btch:  31 usd:  58

CPU    1: hi:  186, btch:  31 usd:  30

CPU    2: hi:  186, btch:  31 usd: 163

CPU    3: hi:  186, btch:  31 usd:   0

active_anon:5222 inactive_anon:2012 isolated_anon:0

active_file:32654 inactive_file:118028 isolated_file:0

unevictable:0 dirty:4232 writeback:19 unstable:0

free:19417 slab_reclaimable:2524 slab_unreclaimable:1995

mapped:6132 shmem:2104 pagetables:441 bounce:0

DMA free:93640kB min:844kB low:1052kB high:1264kB active_anon:4992kB inactive_anon:2704kB active_file:428kB inactive_file:50252kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:186944kB mlocked:0kB dirty:6004kB writeback:0kB mapped:2888kB shmem:2812kB slab_reclaimable:1380kB slab_unreclaimable:96kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:6 all_unreclaimable? no

lowmem_reserve[]: 0 577 577 577

Normal free:3288kB min:2680kB low:3348kB high:4020kB active_anon:18196kB inactive_anon:5344kB active_file:130188kB inactive_file:400232kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:591296kB mlocked:0kB dirty:11892kB writeback:84kB mapped:21640kB shmem:5604kB slab_reclaimable:8716kB slab_unreclaimable:7884kB kernel_stack:976kB pagetables:1764kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:26 all_unreclaimable? no

lowmem_reserve[]: 0 0 0 0

DMA: 1773*4kB 1674*8kB 1224*16kB 818*32kB 444*64kB 144*128kB 50*256kB 8*512kB 3*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 133060kB

Normal: 48*4kB 2563*8kB 297*16kB 36*32kB 16*64kB 9*128kB 7*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB 0*8192kB 0*16384kB 0*32768kB = 30568kB

125865 total pagecache pages

0 pages in swap cache

Swap cache stats: add 0, delete 0, find 0/0

Free swap  = 0kB

Total swap = 0kB

262144 pages of RAM

57374 free pages

71094 reserved pages

2797 slab pages

56553 pages shared

0 pages swap cached

Physical memory allocation error!

Physical memory allocation error!

 

Kernel: linux-imx 3.0.35-4.1.0 yocto

Board: imx6q Sabre SD

 

Thanks for any advice

David

Outcomes