Overv/outrun

cross-architecture

Opened this issue ยท 8 comments

It may be possible to run cross architecture binaries using qemu-user.

Even though this means emulation, it would be helpful since ARM machines are mostly slower currently than server-class x86 machines.

Another vote for this one.

Came here super excited with the prospect of using outrun between my tiny raspberry pi's and arm chromebooks (both arm 32 and arm 64) , and my beefy x64 systems. I' using Archlinux.

Then I bumped into the README:

Since the software to be executed is copied from your own machine to the remote machine, it must be binary compatible. Itโ€™s not possible to set up a session from an x86 machine to an ARM machine, for example.

Just like kapillhp, I also suspect this might be possible. But i need to study it further.

There are so many many tools and related concepts.
Qemu, binfmt, user static, emulation vs virtualization, distcc .... etc ...

Was wondering if Alexander Overvoorde could add a few extra words and thoughts about this. You already wrote a superb README, so maybe open up the wiki for extra documentation ?

Overv commented

I haven't played with user emulation before but looking at documentation like this it seems feasible to integrate into outrun itself, assuming that the target system is already set up properly for it.

The use case you mention is quite compelling and I hadn't thought about it before. I have a Raspberry Pi myself so I will experiment with this and see what would be the easiest way to get this to run.

On the topic of the wiki, I think it'd be best to start building some knowledge through Q&A in the issues first, so that we can discover what would be the most interesting to document.

Thanks for giving it a chance!

Overv commented

I just did some experiments with running ARM executables on an x86_64 machine and vice versa (not with outrun, but just copying statically compiled ones) and I have a rough idea of how to implement this with outrun now. Assuming that you've installed a binary like qemu-arm-static on the remote system when connecting from ARM to x86_64, for example, it should be reasonably straightforward to support this functionality.

I just need to set up a fresh Raspberry Pi to properly prototype this since the one I have right now is far too slow to provide a pleasant development experience.

Update: I was able to get this working from a Pi Zero to my Arch desktop with a more than 30x speed up in FFMPEG! The only thing I had to do was disable these 3 lines and install the QEMU static binaries on the Raspberry Pi.

I was able to get this working from a Pi Zero to my Arch desktop with a more than 30x speed up in FFMPEG!

This is great ! Exactly what I was suspecting.

Any more recent experiments you might have been doing lately ?

Any chance of adding these tips, hints and the necessary pre requisites step by step to the README ?

ValTM commented

Hey, @Overv , any update on how to run multiarch? I really want to stop troubling my raspberry pi for certain workloads when I got a 5900X.

Overv commented

See my instructions at the end of my last comment. You can edit the __main__.py file where outrun is installed on the desktop to patch out the architecture check by deleting those lines.

If you can't find that file then you can figure out where it's installed this way:

$ python
Python 3.9.6 (default, Jun 30 2021, 10:22:16) 
[GCC 11.1.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import outrun
>>> outrun
<module 'outrun' from '/home/overv/projects/outrun/outrun/__init__.py'>

Other than that you need to install the QEMU binaries on the raspberry pi. Install the three packages listed here:

$ apt-get install -y qemu qemu-user-static binfmt-support

I'll add official support/instructions sometime soon.

Any plan to officially support this ? I would love to use this as a way to offload x64 workloads from a Linux VM under M1.