{"id":131,"date":"2021-01-12T15:27:56","date_gmt":"2021-01-12T14:27:56","guid":{"rendered":"https:\/\/threedots.ovh\/blog\/?p=131"},"modified":"2021-09-11T21:52:57","modified_gmt":"2021-09-11T19:52:57","slug":"huawei-exagear-x86_64-apps-on-arm64","status":"publish","type":"post","link":"https:\/\/threedots.ovh\/blog\/2021\/01\/huawei-exagear-x86_64-apps-on-arm64\/","title":{"rendered":"Huawei ExaGear: x86_64 apps on Arm64"},"content":{"rendered":"\n<p><em>Note: This post is only kept up for historical reasons. The current ExaGear EULA doesn&#8217;t allow using ExaGear outside of Huawei Kunpeng processors.<\/em><\/p>\n\n\n\n<p>ExaGear is a dynamic binary translation layer to run x86_32 and x86_64 applications on Arm 64-bit Linux systems.<\/p>\n\n\n\n<p>You can download it <a href=\"https:\/\/mirrors.huaweicloud.com\/kunpeng\/archive\/ExaGear\/ExaGear_V100R002C00.tar.gz\">here<\/a>. On an RPM-based distribution, just unpack the archive and install.<\/p>\n\n\n\n<p>A CentOS 7 rootfs is shipped, you might want to install vte-profile afterwards.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Hardware requirements<\/h4>\n\n\n\n<p>A 64-bit Arm CPU with floating point and SIMD extensions. If it can run a conventional Linux distribution, it&#8217;ll be able to run this.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Kernel requirements<\/h4>\n\n\n\n<p>You&#8217;ll have to install the p64k variant for systems with a 64KB page size set up (which ships with the x86_64 -&gt; arm64 translator only, not the x86_32 to arm64 one). Some applications might not work on such a system.<\/p>\n\n\n\n<p>You&#8217;ll also need a kernel with 48-bit VA space, 39-bit of VA space kernel configurations are not compatible with ExaGear.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Memory model<\/h4>\n\n\n\n<p>ExaGear does not follow TSO completely by default, using heuristics instead. This can be configured through \/etc\/exagear-x86_64.conf.<\/p>\n\n\n\n<p>SMO_MODE=fbase is the default, with SMO_SEVERITY=smart. For full compliance, you can run those commands:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo sed -i -e '\/EXAGEAR_SMO_MODE=\"\/s\/fbase\"\/all\"\/' \/etc\/exagear-x86_32.conf\nsudo sed -i -e '\/EXAGEAR_SMO_MODE=\"\/s\/fbase\"\/all\"\/' \/etc\/exagear-x86_64.conf<\/code><\/pre>\n\n\n\n<p>On Tegra K1 64-bit and Tegra Xavier, you&#8217;ll want to set SMO_MODE=none, as their CPU implements sequential consistency as the memory model. This setting provides a free performance boost with no downsides on that hardware.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Performance<\/h4>\n\n\n\n<p>For running your Docker containers or whatever on an Apple Silicon Mac too, this is a much faster solution than qemu-user.<\/p>\n\n\n\n<p>Some performance numbers on Tegra Xavier: <a href=\"https:\/\/browser.geekbench.com\/v5\/cpu\/compare\/4206324?baseline=4206183\">https:\/\/browser.geekbench.com\/v5\/cpu\/compare\/4206324?baseline=4206183<\/a>. (Geekbench arm64 Android compared to x86_64 Linux Geekbench results on the same hardware)<\/p>\n\n\n\n<p>Because ExaGear doesn&#8217;t implement the AES instructions, the scores for those is an outlier. Apart from that case, the results are pretty good.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Note: This post is only kept up for historical reasons. The current ExaGear EULA doesn&#8217;t allow using ExaGear outside of Huawei Kunpeng processors. ExaGear is a dynamic binary translation layer to run x86_32 and x86_64 applications on Arm 64-bit Linux systems. You can download it here. On an RPM-based distribution, just unpack the archive and&hellip;&nbsp;<a href=\"https:\/\/threedots.ovh\/blog\/2021\/01\/huawei-exagear-x86_64-apps-on-arm64\/\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Huawei ExaGear: x86_64 apps on Arm64<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[4],"tags":[],"class_list":["post-131","post","type-post","status-publish","format-standard","hentry","category-arm"],"_links":{"self":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":14,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":256,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/posts\/131\/revisions\/256"}],"wp:attachment":[{"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/threedots.ovh\/blog\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}