eclipse-iceoryx / iceoryx2

Eclipse iceoryx2™ - true zero-copy inter-process-communication in pure Rust
https://iceoryx.io
Apache License 2.0
512 stars 23 forks source link

Zero-Copy IPC between Native Windows Applications and Linux Containers on WSL #316

Open yakiro-nvg opened 1 month ago

yakiro-nvg commented 1 month ago

Hi,

Is there any support for zero-copy between native Windows applications and Linux containers running on Windows Subsystem for Linux (WSL)?

Use Case: We are using Media Foundation to encode video streams from a camera on a native Windows application. The raw frames are also needed by an AI component running in a Linux container on WSL2. Efficient zero-copy IPC would greatly enhance performance in this scenario.

If there is support, could you provide guidance on how to achieve this? If not, are there any alternative approaches you recommend?

Thanks!

elfenpiff commented 1 month ago

It is not yet supported and also not yet on our Roadmap (oversight), but I will put it there since iceoryx2 should definitely support this use case!

To achieve this you have to share a memory-mapped file between windows and the WSL instance - something that already works. The linux pendant requires a data segment implementation that is based on memory-mapped files instead of posix shared memory and then the communication could be established.

The event messaging-pattern could be implemented via UDP between Windows and WSL, and then everything should work.

I think that everything could be implemented in 2 months, but the sad news is that we focus currently on feature requests from our customers like C/C++/python binding, Request-Response and the ROS2 rmw layer and do not have the capacity to realize it yet.

@yakiro-nvg When would you need this feature?

If not, are there any alternative approaches you recommend?

Sadly no.

yakiro-nvg commented 1 month ago

Thank you for your response.

Regarding the need for this feature, we can work around the limitation at this time. For example, instead of using Media Foundation on Windows, we can move that component to WSL 2, forward the camera USB port, and use ffmpeg, or write a proxy on WSL 2 that publishes the data to iceoryx2.

However, our use case is quite complex and this feature would be very helpful.

Our product is an ADAS/AD/CDC system for cars. It would be incredibly useful to have zero-copy pub/sub from different OSs using hypervisor primitives. For now, we can proceed with a single OS, but in the future, it would be more flexible if we could relocate ADAS/AD components to different OSs.

Thanks again for your support!

elfenpiff commented 1 month ago

Our product is an ADAS/AD/CDC system for cars. It would be incredibly useful to have zero-copy pub/sub from different OSs using hypervisor primitives. For now, we can proceed with a single OS, but in the future, it would be more flexible if we could relocate ADAS/AD components to different OSs.

On our roadmap is also exactly this use case. The thing is that the Windows <-> WSL2 communication is realized completely different than a hypervisor communication between for instance QNX <-> Linux, the typical automotive use case. But from an iceoryx2 user perspective you shouldn't care about those details and iceoryx2 will in the future take care of this completely.

The iceoryx2 hypervisor support should be available beginning of next year but it will be a commercial extension from us (https://ekxide.io) to iceoryx2 and not part of the open-source project. The architecture of iceoryx2 is designed so that extensions can be added on all layers and this will be one of them.