Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

问一下这些报错是什么原因? #73

Open
HouLingLXH opened this issue Apr 1, 2024 · 6 comments
Open

问一下这些报错是什么原因? #73

HouLingLXH opened this issue Apr 1, 2024 · 6 comments

Comments

@HouLingLXH
Copy link

rk3588s , 4G内存

调用过 imtranslate 和 imresize

报错:
Apr 1 02:17:27 firefly kernel: [ 8594.342568] rga_mm: RGA_MMU unsupported memory larger than 4G!
Apr 1 02:17:27 firefly kernel: [ 8594.342603] rga_mm: scheduler core[4] unsupported mm_flag[0x8]!
Apr 1 02:17:27 firefly kernel: [ 8594.342623] rga_mm: rga_mm_map_buffer map virtual address error!
Apr 1 02:17:27 firefly kernel: [ 8594.342628] rga_mm: job buffer map failed!
Apr 1 02:17:27 firefly kernel: [ 8594.342633] rga_mm: src channel map job buffer failed!
Apr 1 02:17:27 firefly kernel: [ 8594.342636] rga_mm: failed to map buffer
Apr 1 02:17:27 firefly kernel: [ 8594.342644] rga_job: rga_job_commit: failed to map job info
Apr 1 02:17:27 firefly kernel: [ 8594.342659] rga_job: request[633374] task[0] job_commit failed.
Apr 1 02:17:27 firefly kernel: [ 8594.342665] rga_job: rga request[633374] commit failed!
Apr 1 02:17:27 firefly kernel: [ 8594.342670] rga: request[633374] submit failed!
Apr 1 02:18:18 firefly kernel: [ 8645.375707] rga_mm: RGA_MMU unsupported memory larger than 4G!
Apr 1 02:18:18 firefly kernel: [ 8645.375748] rga_mm: scheduler core[4] unsupported mm_flag[0x8]!
Apr 1 02:18:18 firefly kernel: [ 8645.375833] rga_mm: rga_mm_map_buffer map virtual address error!
Apr 1 02:18:18 firefly kernel: [ 8645.375842] rga_mm: job buffer map failed!
Apr 1 02:18:18 firefly kernel: [ 8645.375849] rga_mm: dst channel map job buffer failed!
Apr 1 02:18:18 firefly kernel: [ 8645.376261] rga_mm: failed to map buffer
Apr 1 02:18:18 firefly kernel: [ 8645.376273] rga_job: rga_job_commit: failed to map job info
Apr 1 02:18:18 firefly kernel: [ 8645.376300] rga_job: request[638814] task[0] job_commit failed.
Apr 1 02:18:18 firefly kernel: [ 8645.376310] rga_job: rga request[638814] commit failed!
Apr 1 02:18:18 firefly kernel: [ 8645.376318] rga: request[638814] submit failed!

@Meonardo
Copy link

Meonardo commented Apr 1, 2024

@HouLingLXH 请问你这个问题毕现吗? 我在3568上跑偶发出现这个问题, 同4G内存.

@HouLingLXH
Copy link
Author

持续一段时间,肯定是必现

@lztmfx
Copy link

lztmfx commented May 8, 2024

我也遇到同样问题 4G DDR没有超过4G呀,搞不懂为什么报这个错

@Meonardo
Copy link

Meonardo commented May 8, 2024

@lztmfx 你用的什么集成商的板子? 我用RK提供的开发板, Android 13系统就没这个问题.
可能需要更新某些补丁, 去 redmine 上问问吧.

@nyanmisaka
Copy link

猜测是高负载下RAM不足,buffer被分配到了swap交换分区,因此不满足RGA2只能用dma32的4GB限制,所以报错。

要么修改程序来用dma-heap/drm gem的dma32模式来分配buffer,要么修改配置图像任务的参数,使得其满足RGA3的限制(比如1/8~8缩放倍率),然后用core flag来强制使用RGA3。后者只适用于rk3588(s)。

参考 https://github.com/airockchip/librga/blob/main/docs/Rockchip_FAQ_RGA_CN.md


Q4.5:“RGA_MMU unsupported Memory larger than 4G!”报错该如何解决?

A4.5:该报错通常对应HAL层报错:

RgaBlit(1483) RGA_BLIT fail: Invalid argument
Failed to call RockChipRga interface, please use 'dmesg' command to view driver error log.

该报错标识当前配置的图像任务配置的内存无法满足当前匹配到的硬件核心对内存的要求,由于不同的硬件版本的RGA的IOMMU对内存位数的要求不同,当分配的内存超过对应硬件的限制时,则会出现该该报错,详细的不同硬件版本RGA的限制可见《Rockchip_Developer_Guide_RGA_CN》中的概述——设计指标小节。

当出现该报错时,通常有以下几种场景以及对应的解决方案:

  1. 在搭载多种RGA的芯片平台(例如RK3588搭载有2颗RGA3核心、1颗RGA2核心)上,没有使用importbuffer_xx接口获取handle,而是直接使用wrapbuffer_xx接口调用im2d api时:

    由于没有使用importbuffer_xx来提前映射外部内存到RGA驱动内存,因此在实际任务匹配中无法提前获知内存是否不满足对应核心的限制,因此在高负载场景下可能会出现该报错,建议使用importbuffer_xx提前将外部内存导入到RGA驱动内部,避免该问题。

  2. 在搭载多种RGA的芯片平台(例如RK3588搭载有2颗RGA3核心、1颗RGA2核心)上,使用了importbuffer_xx接口获取handle,但是依旧存在该问题:

    可以检查一下配置的图像任务的参数,确认是否配置了仅有RGA2核心(内存访问受限制的核心)支持的功能或格式,以RK3588为例,color fill功能和YUV422/420 planar格式均是RGA2核心特有的功能和格式,因此该场景下必须分配4G以内内存空间的内存调用RGA。

    常见的分配4G内存方式可以查看以下示例代码:

    <librga_souce_path>/samples/allocator_demo/src/rga_allocator_dma32_demo.cpp

    <librga_souce_path>/samples/allocator_demo/src/rga_allocator_graphicbuffer_demo.cpp

    如果使用的其他分配器,例如mpp_buffer、v4l2_buffer、drm_buffer等,请查询对应分配器是否支持限制分配4G以内内存空间内存,并按照对应方式申请复合RGA硬件要求的内存。

  3. 仅搭载一种RGA的芯片平台(例如仅搭载RGA2的RK3399、RK3568、Rk3566)上:

    当芯片平台上仅搭载内存访问受限制的核心时,则调用RGA时必须申请符合搭载核心对内存要求的内存,解决方案同上场景2。

  4. 当使用DRM、malloc、new等不支持指定分配4G以内内存空间的内存的内存分配器时,也可以通过修改uboot的内存映射范围来解决。

    uboot相关修改可以参考SDK文档中 uboot开发文档->Chapter-8 调试手段->修改DDR容量 ,将内存映射范围全局限制在0~4G内存空间以内即可。

@HouLingLXH
Copy link
Author

我参考这个方法 https://github-wiki-see.page/m/jjm2473/ffmpeg-rk/wiki/FAQ
重新编译了固件,确实不再报错,但是一段时间后会死机, 花屏,屏幕显示一些横条

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants