qemu-user-static icon indicating copy to clipboard operation
qemu-user-static copied to clipboard

speed is slow when use as cross-compile solution

Open furyNerd opened this issue 3 years ago • 5 comments

Is this a bug report, feature (enhancement) request or question? (leave only one on its own line)

kind question

Description:

hi, i use qemu-user-static as a cross-compile solution, but found the time of compile consumed is average 2~5 times more than directly compile on the targe platform. since i'm not familiar with qemu, my question is this normal or there is some way to speed up?

i do some search and found kvm is a relative topic, but looks like kvm only suitable for the same architecture of both host and target platform(e.g. both host and target are x86_64 platform), so can i have some brief answer for this question?

my host is ubuntu 20.04 lts with x86_64 cpu, and a docker of arm64v8/ubuntu for cross-compile for a arm64v8 target, before i use the cross-compile docker i run the lastest multiarch/qemu-user-static as demonstrated in readme.

any suggestion?thanks very much.

Steps to reproduce the issue:

as above

Describe the results you received: as above

Describe the results you expected: as above

Environment: as above

furyNerd avatar Jul 21 '22 03:07 furyNerd

so can i have some brief answer for this question?

brief answer: yes, it is normal that emulated execution is several times slower than the same command on a real hardware

martin-g avatar Jul 21 '22 06:07 martin-g

thanks for the brief and strong confirm, so it's not a misuse and there is no way to improve just by configuring something? and is my understanding about kvm is right?

furyNerd avatar Jul 21 '22 06:07 furyNerd

there is no way to improve just by configuring something?

at least I am not aware of such way

and is my understanding about kvm is right?

yes, I think so, but I am not very familiar with the KVM internals

If you need an ARM64 system for personal needs then I'd recommend you to use Oracle Cloud. They provide free VMs. I've explained more here: https://martin-grigorov.medium.com/github-actions-arm64-runner-on-oracle-cloud-a77cdf7a325a

martin-g avatar Jul 21 '22 07:07 martin-g

thank you for the more detailed discussion, and also for the useful link. for anyone who wish a brief answer, hope this discussion could be a quick reference :)

furyNerd avatar Jul 21 '22 07:07 furyNerd

I think maybe libhoudi.so can resolve your problem,but I can not know libhoudini.so how to be used in centos or ubuntu.

jansure avatar Feb 24 '23 14:02 jansure