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

challenges build on graviton3 (ubuntu 20.04 and ubuntu 22.04) #176

Closed
sambercovici opened this issue Sep 30, 2023 · 9 comments
Closed

challenges build on graviton3 (ubuntu 20.04 and ubuntu 22.04) #176

sambercovici opened this issue Sep 30, 2023 · 9 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sambercovici
Copy link

sambercovici commented Sep 30, 2023

All was done on two graviton3 VMs in AWS one with ubuntu 20.04 and the other ubuntu 22.04 and on master branch.

for both did the following:
PREREQ:

BUILD:

  • cmake .. -DBOOST_ROOT=/home/ubuntu/src/vectorscan/build/boost_1_57_0/ -DCMAKE_BUILD_TYPE=Release -DFAT_RUNTIME=off -DBUILD_SVE2_BITPERM=off -DBUILD_SVE2=off -DBUILD_SVE=off
  • in both VMs cmake reported: -march=armv8.4-a+crypto+sha3+sm4+sve+rng+ssbs+i8mm+bf16 -mtune=zeus
  • make hs_runtime

ISSUE-1:
with ubuntu 20.04 (ubuntu 22.04 did not have this issue)

  • /usr/include/aarch64-linux-gnu/bits/hwcap.h is missing HWCAP2_SVE2 more specifically the HWCAP2 flags part the exists in /usr/include/aarch64-linux-gnu/asm/hwcap.h - I patched src/util/arch/arm/cpuid_inline.h and added #include <asm/hwcap.h> just before include <sys/auxv.h>

ISSUE-2:

  • FAT_RUNTIME=on fails on both environments
  • cmake .. -DBOOST_ROOT=/home/ubuntu/boost_1_57_0 -DCMAKE_BUILD_TYPE=Release -DFAT_RUNTIME=on -DBUILD_SVE2_BITPERM=off -DBUILD_SVE2=off -DBUILD_SVE=off
  • make hs_runtime
  • ubuntu 20.04: while Built target hs_exec_sve - cc1: error: invalid feature modifier ‘sve2’ in ‘-march=armv8-a+sve2’
    cc1: note: valid arguments are: fp simd crypto crc lse fp16 rcpc rdma dotprod aes sha2 sha3 sm4 fp16fml sve profile rng memtag sb ssbs predres; did you mean ‘sve’?
  • ubuntu 22.04: /home/ubuntu/src/vectorscan/src/util/arch/arm/simd_utils_sve.h:35:22: error: ACLE function ‘svptrue_b8’ requires ISA extension ‘sve’

ISSUE-3:

  • BUILD_SVE=on
  • cmake .. -DBOOST_ROOT=/home/ubuntu/boost_1_57_0 -DCMAKE_BUILD_TYPE=Release -DFAT_RUNTIME=off -DBUILD_SVE2_BITPERM=off -DBUILD_SVE2=off -DBUILD_SVE=on
  • ubuntu 20.04: cmake stops with CMake Error at CMakeLists.txt:362 (message): arm_sve.h is required to build for SVE.
  • ubuntu 22.04: compilation pass.
@sambercovici
Copy link
Author

Hi,

For ISSUUE-1, is the change (to also #include "/usr/include/aarch64-linux-gnu/asm/hwcap.h") is correct?

@markos markos self-assigned this Oct 3, 2023
@markos markos added the bug Something isn't working label Oct 3, 2023
@markos markos added this to the 5.4.11 milestone Oct 3, 2023
@markos
Copy link

markos commented Oct 3, 2023

question, why do you enable FAT_RUNTIME but disable SVE/SVE2? FAT_RUNTIME implicitly enables both.

However, the bug here is that SVE2 should implicitely enable SVE as well, for this reason this is an actual bug report.

ubuntu 22.04: /home/ubuntu/src/vectorscan/src/util/arch/arm/simd_utils_sve.h:35:22: error: ACLE function ‘svptrue_b8’ requires ISA extension ‘sve’

As a note, we don't plan to support Ubuntu 20.04 right now. It's already almost 3y old and there exists another LTS version which is also >1y old. We will continue to support so 20.04 for the near future. If there is enough demand we might add another configuration for 20.04 but so far no one else has asked. If you absolutely need 20.04 support, we might provide a support contract, in which case, please contact us.

@sambercovici
Copy link
Author

As you know, I am working to add Vectorscan to Envoyproxy.
The build container for Envoyproxy is based on ubuntu 20.04

@markos
Copy link

markos commented Oct 3, 2023

I see, we'll have to investigate how hard it is to support one more distro. The problem is that supporting one more distro means supporting it on all architectures (x86, arm, ppc64le) and all compilers, on all configurations (debug/release for all, sse/avx2/avx512/fat for x86, neon/sve/sve2/fat on arm, and plain vsx on ppc64le). Add to those the soon-to-be added ASAN builds, this is a significant effort. We cannot just support 20.04 on Arm. In any case, it would be ideal if you could switch to 22.04, at the moment we cannot promise 20.04, but we will consider it. Even if it happens, it will happen after the next release (5.4.11), which is expected by the end of this month.

@sambercovici
Copy link
Author

question, why do you enable FAT_RUNTIME but disable SVE/SVE2? FAT_RUNTIME implicitly enables both.

I started with only enabling FAT_RUNTIME and compiling on graviton3 + ubuntu 20.04. this failed
then tried to compile with enabling FAT_RUNTIME and compiling on graviton3 + ubuntu 22.04 which also failed
what you see is the result of enabling / disabling different flags.

@markos
Copy link

markos commented Oct 3, 2023

I mentioned that becasue in issue 2, I see that you enable FAT_RUNTIME but disable both SVE/SVE2.

@sambercovici
Copy link
Author

AFAIK, there is NO plan in Envoyproxy to move to build containers using ubuntu 22.04 anytime soon.
I was able to compile for basic Neon support by adding the include noted above.
Is this something that will work?

@markos
Copy link

markos commented Oct 3, 2023

FAT_RUNTIME for sure will not work on 20.04, as it requires to build both SVE and SVE2, but 20.04 does not have compiler SVE2 support. So if you need 20.04 you have to completely disable FAT, SVE, SVE2. In that case, yes, such a simple hack might work and I have no objections to include it. Actually, as these are 2 different issues, would you mind filing another one for Ubuntu 20.04 support and just mention this bug report?

@markos
Copy link

markos commented Oct 31, 2023

With #180 and #181 closed/merged, this is considered fixed.

@markos markos closed this as completed Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants