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

can it run on arm /aarch64/ armv8l? #2613

Open
AndreV84 opened this issue May 28, 2022 · 23 comments
Open

can it run on arm /aarch64/ armv8l? #2613

AndreV84 opened this issue May 28, 2022 · 23 comments

Comments

@AndreV84
Copy link

AndreV84 commented May 28, 2022

it won't build on arm64

/opae-sdk-2.1.0-1/libraries/plugins/vfio/opae_vfio.c:664:2: error: implicit declaration of function ‘__builtin_cpu_init’; did you mean ‘__builtin_irint’? [-Werror=implicit-function-declaration]
  664 |  __builtin_cpu_init();
      |  ^~~~~~~~~~~~~~~~~~
      |  __builtin_irint
@tswhison
Copy link
Contributor

tswhison commented Jun 3, 2022

Hello, it seems that __builtin_cpu_init() is not available on your platform. It seems we should add a preprocessor check for __arm__, perhaps?

@AndreV84
Copy link
Author

AndreV84 commented Jun 3, 2022

@tswhison
how can it be added?

@tswhison
Copy link
Contributor

tswhison commented Jun 3, 2022

Could you try this branch? #2616

@AndreV84
Copy link
Author

AndreV84 commented Jun 3, 2022

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null sudo apt update sudo apt install gh


`~/opae-sdk$ gh pr checkout 2616
remote: Enumerating objects: 8, done.
remote: Counting objects: 100% (8/8), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 8 (delta 6), reused 8 (delta 6), pack-reused 0
Unpacking objects: 100% (8/8), 845 bytes | 70.00 KiB/s, done.
From https://github.com/OPAE/opae-sdk
 * [new branch]        tswhison/preproc -> origin/tswhison/preproc
Branch 'tswhison/preproc' set up to track remote branch 'tswhison/preproc' from 'origin'.
Switched to a new branch 'tswhison/preproc'
`

`32%] Built target board_a10gx
[ 32%] Building C object libraries/plugins/xfpga/CMakeFiles/xfpga.dir/hostif.c.o
/tmp/ccA665pN.s: Assembler messages:
/tmp/ccA665pN.s:2639: Error: unknown mnemonic `vmovdqu64' -- `vmovdqu64 (x24),%zmm0'
/tmp/ccA665pN.s:2639: Error: unknown mnemonic `vmovdqu64' -- `vmovdqu64 %zmm0,(x21)'
make[2]: *** [libraries/plugins/xfpga/CMakeFiles/xfpga.dir/build.make:188: libraries/plugins/xfpga/CMakeFiles/xfpga.dir/mmio.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
[ 32%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/nlb_cache_prime.cpp.o
[ 33%] Building C object libraries/libboard/board_common/CMakeFiles/board_common.dir/__/__/__/tests/framework/mock/opae_std.c.o
[ 33%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/nlb_stats.cpp.o
[ 34%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/nlb0.cpp.o
[ 34%] Linking C static library ../../../lib/libboard_common.a
[ 35%] Built target board_common
[ 35%] Building CXX object binaries/fpgadiag/CMakeFiles/eth_group.dir/src/eth_group.cpp.o
make[1]: *** [CMakeFiles/Makefile2:1719: libraries/plugins/xfpga/CMakeFiles/xfpga.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 35%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/nlb3.cpp.o
/tmp/ccqQ69yz.s: Assembler messages:
/tmp/ccqQ69yz.s:8616: Error: unknown mnemonic `vmovdqu64' -- `vmovdqu64 (x21),%zmm0'
/tmp/ccqQ69yz.s:8616: Error: unknown mnemonic `vmovdqu64' -- `vmovdqu64 %zmm0,(x0)'
make[2]: *** [libraries/plugins/vfio/CMakeFiles/opae-v.dir/build.make:90: libraries/plugins/vfio/CMakeFiles/opae-v.dir/opae_vfio.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1773: libraries/plugins/vfio/CMakeFiles/opae-v.dir/all] Error 2
[ 36%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/nlb7.cpp.o
[ 36%] Linking C static library ../../lib/libopae-c-archive.a
[ 36%] Built target opae-c-archive
[ 36%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/perf_counters.cpp.o
[ 36%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/diag_utils.cpp.o
[ 37%] Linking CXX shared library ../../lib/libopae-c++-nlb.so
[ 37%] Built target opae-c++-nlb
[ 37%] Linking CXX shared module ../../lib/pyopaeuio.cpython-38-aarch64-linux-gnu.so
[ 37%] Built target pyopaeuio
[ 38%] Linking CXX shared module ../../lib/eth_group.cpython-38-aarch64-linux-gnu.so
[ 38%] Built target eth_group
make: *** [Makefile:156: all] Error 2

`

@AndreV84
Copy link
Author

AndreV84 commented Jun 3, 2022

@tswhison
Error: unknown mnemonicvmovdqu64' -- vmovdqu64 (x21),%zmm0'
seems like in google/or-tools#820 (comment)

@tswhison
Copy link
Contributor

tswhison commented Jun 3, 2022

Ah yes. Thank you. I don't have an ARM test bench. We wouldn't be able to compile those instructions for non-x86 I think. I have updated the branch.

@AndreV84
Copy link
Author

AndreV84 commented Jun 4, 2022

maybe we can somehow patch the code to pass ther err, e.g. as in https://github.com/google/snappy/blob/main/snappy-stubs-internal.h#L70 ?

@tswhison
Copy link
Contributor

tswhison commented Jun 6, 2022

Right now, the code will return FPGA_NOT_SUPPORTED for the 512-bit calls on arm. Is that what you mean?

@AndreV84
Copy link
Author

AndreV84 commented Jun 6, 2022

not exactly
in my situation I was getting this error trying to build on aarch64
35%] Building CXX object binaries/fpgadiag/CMakeFiles/opae-c++-nlb.dir/src/nlb3.cpp.o /tmp/ccqQ69yz.s: Assembler messages: /tmp/ccqQ69yz.s:8616: Error: unknown mnemonicvmovdqu64' -- vmovdqu64 (x21),%zmm0' /tmp/ccqQ69yz.s:8616: Error: unknown mnemonic vmovdqu64' -- vmovdqu64 %zmm0,(x0)' make[2]: *** [libraries/plugins/vfio/CMakeFiles/opae-v.dir/build.make:90: libraries/plugins/vfio/CMakeFiles/opae-v.dir/opae_vfio.c.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:1773: libraries/plugins/vfio/CMakeFiles/opae-v.dir/all] Error 2'

@tswhison
Copy link
Contributor

tswhison commented Jun 6, 2022

I thought I had fixed that one. Could you try updating your branch for #2616?

@AndreV84
Copy link
Author

AndreV84 commented Jun 6, 2022

@tswhison Thank you for the update!
Seems I can build it on my aarch64 device
is there a simple test/ to try the board with it?
https://www.intel.com/content/dam/www/central-libraries/us/en/documents/intel-pac-with-arria-10-gx-product-brief.pdf

@tswhison
Copy link
Contributor

tswhison commented Jun 6, 2022

In order to run something, you'll need a driver so that the bit image can be configured. Please check at linux-dfl for the availability of a driver.

@AndreV84
Copy link
Author

AndreV84 commented Jun 6, 2022

could you extend what needs to be done after executing the step below, please?
git clone https://github.com/OPAE/linux-dfl

@tswhison
Copy link
Contributor

tswhison commented Jun 6, 2022

You'll need to check with the folks over at linux-dfl. I'm not sure whether an ARM driver exists, but they would know for certain.

@AndreV84
Copy link
Author

AndreV84 commented Jun 9, 2022

@tswhison
could you advise also how to build these on x86_64 that got installed intel dev stack environment but doesn't seem to have built sample binaries for opae-sdk

to build these guys?

usr/src/opae/samples$ ls
hello_events.c hello_fpga.c

@tswhison
Copy link
Contributor

tswhison commented Jun 9, 2022

Please find build instructions for hello_fpga here: https://opae.github.io/0.13.0/docs/fpga_api/quick_start/readme.html#building-a-sample-application

@AndreV84
Copy link
Author

AndreV84 commented Jun 9, 2022

@AndreV84
Copy link
Author

@tswhison do IO have to install linux-dfl if I used to install the dev stack

after installing the dev stack

after sourcing

. /home/$USER/inteldevstack/init_env.sh 
 sudo fpgasupdate $OPAE_PLATFORM_ROOT/hw/samples/nlb_mode_0/bin/\
 nlb_mode_0_unsigned.gbs
[2022-06-09 21:38:42,635] [ERROR   ] No suitable PAC found.
sudo ./hello_fpga 
Using OPAE C library version '1.1.2' build 'fa90f2cd'
Error enumerating accelerators: no driver available
Error no matching accelerator: not found

@AndreV84
Copy link
Author

[ 31.135966] dfl-fme-bridge dfl-fme-bridge.1.auto: fpga bridge [DFL FPGA FME Bridge] registered

@AndreV84
Copy link
Author

07:00.0 Processing accelerators: Intel Corporation Device 09c4 (rev ff)

@AndreV84
Copy link
Author

on 20.04 ubuntu the intel dev stack script won't run
will opae-sdk/ driver build from source?

@AndreV84
Copy link
Author

@tswhison trying to build linux-dfl according to opae-sdk tutorial
on x86_64 20.04 ubuntu
] fs/jffs2/scan.o CC [M] net/mac80211/vht.o CC [M] drivers/leds/leds-sgm3140.o CC drivers/acpi/acpica/exfield.o gcc: fatal error: Killed signal terminated program cc1 compilation terminated. gcc: fatal error: Killed signal terminated program cc1 compilation terminated. gcc: fatal error: Killed signal terminated program cc1 compilation terminated. gcc: fatal error: Killed signal terminated program cc1 compilation terminated. CC [M] drivers/video/backlight/88pm860x_bl.o

@tswhison
Copy link
Contributor

Could you please raise this at linux-dfl? They should be able to help with driver issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants