-
Notifications
You must be signed in to change notification settings - Fork 184
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
4G limit on an 8G board #560
Comments
The 32bit iova space is hardware limit. But we still can use some tick in driver to workaround this problem. We are trying. |
Thank you! Lots of people have this issue. At one point I was considering of getting a secondary board with 16GB but then I found out more people had this problem. |
any updates? |
It is not fixed yet. |
just pinging in the hopes of getting a message back from you saying that 4 devs are working on a fix. :) from design perspective, why was this ever limited to 32 bit? |
any updates @HermanChen ? |
0001-DEBUG-video-rockchip-mpp-disable-CONFIG_DMABUF_CACHE.patch |
this patch doesn't apply with 5.10 rkr3.4 (aka the latest 5.10 from radxa) |
It‘s okay to ignore the code conflict between different branch and commit. |
Hey, did anyone successfully try out the patch above? I spent some time figuring out how to compile the kernel but I had no success. @HermanChen @chencl9410 please prioritize this issue. It is known for a long time and not fixed yet. Please apply the fix to the BSP kernel so that it lands in all distributions. This issue is critical and the reason why I can't use my Rockchip board. I would have recommended Rockchip board to friends, but I can't recommend it with this issue. Please fix it fast. |
@HermanChen @chencl9410 |
it would help in case of frigate... |
@great9 @MarcA711 |
Thanks for confirming that, that sounds very promising. Hopefully we can work around this limitation someday. |
@HermanChen @chencl9410 Sorry for asking again but some time has passed since last time. Is there any progress? Do you know how long it will take to finally fix this awful bug? I have been wanting to buy another SBC for some time now. I would like to buy another one with Rockchip SOC but not before this problem is finally fixed. My other Rockchip SBC crashes regularly and works unreliably because of this error. If I knew that this will be definitely fixed in the near future I can finally buy. |
@MarcA711 |
are there any news on this? any temporary fixes or any other thing that is a workaround for this issue? |
ping @chencl9410 @HermanChen |
Workaround Solutions for MPP IOVA 4G Limitation for now: 1. Fixed Domain Solution for Dual-Core Codec:
2. Domain Switching Solution for Single-Core Codec:
3. Domain Switching Solution for Dual-Core Codec:
4. Handling Potential Single-Session Requirements Exceeding 4G:
|
Thanks for the update! If I understand correctly, using FFmpeg as an example, each FFmpeg process corresponds to one MPP decoder session, is that correct? If so, can we expect that multiple FFmpeg processes decoding multiple 1080p videos (e.g. > 16 times ffmpeg processes and exceeded 4GB but within 8GB in total) will not cause crashes, but will only slow down? As far as I know the RGA hardware is also affected and it is used as post-processing (downscaling and pixel format conversion such as yuv2rgb) for the MPP decoder. RK3588 has dual-core RGA3, which doesn't require DMA32 flag. Can these improvements also be applied to the RGA3 driver? Just in case you need an example to verify the MPP+RGA use case, this FFmpeg command can be used. And here's the Wiki page for it.
When the 4GB issue occurs, the return value is -12 (-ENOMEM). Tracing the RGA3 kernel driver revealed that this is also related to the IOMMU being unable to bind the required FD. |
can we expect that multiple FFmpeg processes decoding multiple 1080p videos (e.g. > 16 times ffmpeg processes and exceeded 4GB but within 8GB in total) will not cause crashes, but will only slow down And about slowing down performance: As for RGA, it also requires the RGA driver to implement similar measures for handling IOVA mappings that exceed 4G. I will discuss this issue with my colleague responsible for the RGA driver. Considering that RGA is primarily used for image format conversion, it may not require the same frame buffer management as a codec, and there might be a more flexible solution for releasing buffers. Additionally, I will spend some time preparing the FFmpeg environment you mentioned for experimentation. |
Thx again for the comment, that's very informative. Relaxing the limit to 8GB can satisfy 99% of use cases.
FYI if you find building ffmpeg time consuming, you can get the pre-built portable ffmpeg binaries. |
@nyanmisaka |
I have read through the RGA documentation and know the hardware limitations of RGA2 so I disabled RGA2 and used only RGA3. But RGA3 is still affected by the IOVA 4G issue. Here are some logs that I hope will be of interest to RGA developers. 8k(7680x4320) video is used to trigger the 4G limitation more easily. The pipeline is MPP decoder(nv12) -> RGA conversion (rgba).
|
have you submitted this as an issue to librga devs on that repo? |
i can confirm that on joshua's ubuntu the patch doesn't work, like it's not even there. here are some info:
is there really no fix for this? |
These logs are prints from RGA mapping failures. I have already reported the trigger conditions for similar issues to the RGA developers. I was able to trigger the errors from both RGA and MPP by running the ffmpeg test case provided by Nyanmiska in multiple instances. After applying the patch, the MPP import fd error no longer occurs. The effectiveness of this patch can also be verified through the simplest mpi_dec_multi_test.c multi-instance test (using mpi_dec_multi_test -i /path/to/8Kvideo.h265 -s 20 -n -1) for pure decoder testing. It directly shows the effect of the patch on multi-session 8K decoding before and after the patch is applied. |
The above is a completely different issue specific to gstreamer-rockchip, which fails because it does not allocate the buffer used by RGA2 with the DMA32 flag. This does not exist in ffmpeg-rockchip. #define MPP_BUFFER_FLAGS_DMA32 0x00200000 //ROCKCHIP_BO_DMA32 << 16 |
thank you for pointing the right direction of my issue, how can i fix it with gstreamer? |
There seems to be a memory limit of 4G even though my board is 8G.
I've described it on nyanmisaka's ffmpeg-rockchip repo: nyanmisaka/ffmpeg-rockchip#51
The text was updated successfully, but these errors were encountered: