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

Initial support for foreign architectures (i686 and aarch64). #197

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Dec 10, 2022

Replaces #144; cc @IanButterworth @DilumAluthge
Fixes #97

Tested that this works by installing qemu-user-static and whatever binfmt-integration package your distro uses:

julia> config = Configuration(julia="1.9-alpha1", arch="aarch64")

julia> result = PkgEval.evaluate_test(config, Package(;name="Example"))

julia> println(result.log)
Package evaluation of Example started at 2022-12-10T20:59:20.579

Julia Version 1.9.0-alpha1
Commit 0540f9d7394 (2022-11-15 14:37 UTC)
Platform Info:
  OS: Linux (aarch64-linux-gnu)
  CPU: 32 × AMD Ryzen 9 5950X 16-Core Processor
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, generic)
  Threads: 1 on 32 virtual cores
Environment:
  JULIA_DEPOT_PATH = ::/usr/local/share/julia
  JULIA_PKGEVAL = true

...

Testing completed after 0.0s

PkgEval succeeded

Although that's pretty neat, emulation is way slower than I expected:

julia> config = Configuration(julia="1.9-alpha1", arch="aarch64")
julia> @time result = PkgEval.evaluate_test(config, Package(;name="Example"))
 44.638430 seconds (3.41 M allocations: 338.130 MiB, 0.26% gc time, 1.06% compilation time: 32% of which was recompilation)

julia> config = Configuration(julia="1.9-alpha1")
julia> @time result = PkgEval.evaluate_test(config, Package(;name="Example"))
  4.488381 seconds (6.57 k allocations: 634.000 KiB, 0.00% compilation time)

I originally also wanted to integrate PkgEval.jl with Qemu_jll.jl and automatically use qemu's user-mode emulation, but turns out it doesn't actually handle execve, so we need to use binfmt for transparent emulation. But since it's way too slow for actual PkgEval purposes, I won't explore that any further anyway.

Finally, as you see in the output above cpu_time reporting doesn't work properly in the case of qemu emulation, but I assume it does with native aarch64 execution, so that shouldn't hold this PR back.

@maleadt maleadt changed the title Support for foreign architectures (i686 and aarch64). Initial support for foreign architectures (i686 and aarch64). Dec 10, 2022
@maleadt
Copy link
Member Author

maleadt commented Dec 10, 2022

If we ever want to make emulation transparent without requiring binfmt, we'd need to add something like https://patchwork.ozlabs.org/project/qemu-devel/patch/1455515507-26877-1-git-send-email-petrosagg@resin.io/ to our Qemu_jll.

@maleadt maleadt changed the base branch from master to tb/crun December 11, 2022 21:46
@maleadt
Copy link
Member Author

maleadt commented Dec 11, 2022

If we ever want to make emulation transparent without requiring binfmt, we'd need to add something like https://patchwork.ozlabs.org/project/qemu-devel/patch/1455515507-26877-1-git-send-email-petrosagg@resin.io/ to our Qemu_jll.

Well, I've implemented that.

@maleadt maleadt force-pushed the tb/crun branch 2 times, most recently from 2d9d5c3 to 4a14a44 Compare February 8, 2023 07:09
Base automatically changed from tb/crun to master February 9, 2023 15:19
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

Successfully merging this pull request may close these issues.

1 participant