vortexgpgpu / vortex

https://vortex.cc.gatech.edu/
Apache License 2.0
1.2k stars 255 forks source link

Unable to compile OpenCl kernels, undefined symbol: _ZN4llvm24DisableABIBreakingChecksE #8

Closed avl-bsuir closed 3 years ago

avl-bsuir commented 3 years ago

Hi! We are developing deep-NN framework for RISC-V-based GPGPU and using your project as a target machine. However, we have faced some issues regarding OpenCl kernels. When we try to compile any kernel, pocl fires the following error:

symbol lookup error: /opt/pocl/compiler/lib/libOpenCL.so.2: undefined symbol: _ZN4llvm24DisableABIBreakingChecksE

It is easy to reproduce if one removes kernel.pocl from opencl tests. The full log is here:

root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# pwd 
/vortexgpgpu/vortex/benchmarks/opencl/vecadd
root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# ls
Makefile  README  kernel.cl  kernel.pocl  main.cc  vecadd  vecadd.dump
root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# rm kernel.pocl 
root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# make 
LLVM_PREFIX=/opt/llvm-riscv POCL_DEBUG=all LD_LIBRARY_PATH=/opt/llvm-riscv/lib:/opt/pocl/compiler/lib /opt/pocl/compiler/bin/poclcc -LLCFLAGS "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+m,+f -float-abi=hard -code-model=small" -CFLAGS "-v -O3 --sysroot=/opt/riscv-gnu-toolchain/riscv32-unknown-elf --gcc-toolchain=/opt/riscv-gnu-toolchain -march=rv32imf -mabi=ilp32f -I/vortexgpgpu/vortex/runtime/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" -LDFLAGS "-Wl,-Bstatic,-T/vortexgpgpu/vortex/runtime/linker/vx_link.ld -Wl,--gc-sections /vortexgpgpu/vortex/runtime/libvortexrt.a -lm" -o kernel.pocl kernel.cl
/opt/pocl/compiler/bin/poclcc: symbol lookup error: /opt/pocl/compiler/lib/libOpenCL.so.2: undefined symbol: _ZN4llvm24DisableABIBreakingChecksE
Makefile:32: recipe for target 'kernel.pocl' failed
make: *** [kernel.pocl] Error 127

Can anyone suggest workarounds for this issues? May be there is a combination of stable vortex and pocl versions that works nicely together and can compile OpenCl1.2?

Thank you, Anton.

tinebp commented 3 years ago

Hi, This error is not caused by POCL, it is an ABI coming from your LLVM build.Here are the instructions we use for building the compiler toolchainhttps://github.gatech.edu/casl/pocl/blob/master/README.vortex

thanks,-Blaise On Tuesday, March 9, 2021, 04:06:51 AM EST, avl-bsuir notifications@github.com wrote:

Hi! We are developing deep-NN framework for RISC-V-based GPGPU and using your project as a target machine. However, we have faced some issues regarding OpenCl kernels. When we try to compile any kernel, pocl fires the following error: symbol lookup error: /opt/pocl/compiler/lib/libOpenCL.so.2: undefined symbol: _ZN4llvm24DisableABIBreakingChecksE

It is easy to reproduce if one removes kernel.pocl from opencl tests. The full log is here: root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# pwd /vortexgpgpu/vortex/benchmarks/opencl/vecadd root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# ls Makefile README kernel.cl kernel.pocl main.cc vecadd vecadd.dump root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# rm kernel.pocl root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# make LLVM_PREFIX=/opt/llvm-riscv POCL_DEBUG=all LD_LIBRARY_PATH=/opt/llvm-riscv/lib:/opt/pocl/compiler/lib /opt/pocl/compiler/bin/poclcc -LLCFLAGS "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+m,+f -float-abi=hard -code-model=small" -CFLAGS "-v -O3 --sysroot=/opt/riscv-gnu-toolchain/riscv32-unknown-elf --gcc-toolchain=/opt/riscv-gnu-toolchain -march=rv32imf -mabi=ilp32f -I/vortexgpgpu/vortex/runtime/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" -LDFLAGS "-Wl,-Bstatic,-T/vortexgpgpu/vortex/runtime/linker/vx_link.ld -Wl,--gc-sections /vortexgpgpu/vortex/runtime/libvortexrt.a -lm" -o kernel.pocl kernel.cl /opt/pocl/compiler/bin/poclcc: symbol lookup error: /opt/pocl/compiler/lib/libOpenCL.so.2: undefined symbol: _ZN4llvm24DisableABIBreakingChecksE Makefile:32: recipe for target 'kernel.pocl' failed make: *** [kernel.pocl] Error 127

Can anyone suggest workarounds for this issues? May be there is a combination of stable vortex and pocl versions that works nicely together and can compile OpenCl1.2?

Thank you, Anton.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tinebp commented 3 years ago

You could also use our pre-built toolchain from here: vortexgpgpu/vortex-toolchain-prebuilt

|

vortexgpgpu/vortex-toolchain-prebuilt

Contribute to vortexgpgpu/vortex-toolchain-prebuilt development by creating an account on GitHub. |

|

|

-Blaise On Tuesday, March 9, 2021, 04:06:51 AM EST, avl-bsuir notifications@github.com wrote:

Hi! We are developing deep-NN framework for RISC-V-based GPGPU and using your project as a target machine. However, we have faced some issues regarding OpenCl kernels. When we try to compile any kernel, pocl fires the following error: symbol lookup error: /opt/pocl/compiler/lib/libOpenCL.so.2: undefined symbol: _ZN4llvm24DisableABIBreakingChecksE

It is easy to reproduce if one removes kernel.pocl from opencl tests. The full log is here: root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# pwd /vortexgpgpu/vortex/benchmarks/opencl/vecadd root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# ls Makefile README kernel.cl kernel.pocl main.cc vecadd vecadd.dump root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# rm kernel.pocl root@localhost:/vortexgpgpu/vortex/benchmarks/opencl/vecadd# make LLVM_PREFIX=/opt/llvm-riscv POCL_DEBUG=all LD_LIBRARY_PATH=/opt/llvm-riscv/lib:/opt/pocl/compiler/lib /opt/pocl/compiler/bin/poclcc -LLCFLAGS "-O3 -march=riscv32 -target-abi=ilp32f -mcpu=generic-rv32 -mattr=+m,+f -float-abi=hard -code-model=small" -CFLAGS "-v -O3 --sysroot=/opt/riscv-gnu-toolchain/riscv32-unknown-elf --gcc-toolchain=/opt/riscv-gnu-toolchain -march=rv32imf -mabi=ilp32f -I/vortexgpgpu/vortex/runtime/include -fno-rtti -fno-exceptions -ffreestanding -nostartfiles -fdata-sections -ffunction-sections" -LDFLAGS "-Wl,-Bstatic,-T/vortexgpgpu/vortex/runtime/linker/vx_link.ld -Wl,--gc-sections /vortexgpgpu/vortex/runtime/libvortexrt.a -lm" -o kernel.pocl kernel.cl /opt/pocl/compiler/bin/poclcc: symbol lookup error: /opt/pocl/compiler/lib/libOpenCL.so.2: undefined symbol: _ZN4llvm24DisableABIBreakingChecksE Makefile:32: recipe for target 'kernel.pocl' failed make: *** [kernel.pocl] Error 127

Can anyone suggest workarounds for this issues? May be there is a combination of stable vortex and pocl versions that works nicely together and can compile OpenCl1.2?

Thank you, Anton.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

avl-bsuir commented 3 years ago

Hi! Thank you for you prompt reply. Unfortunately, the link you provided is not public. And we get the error referred when we use pre-built toolchain from https://github.com/vortexgpgpu/vortex-toolchain-prebuilt

Thank you, Anton.

tinebp commented 3 years ago

Hi,

This repository is public: https://github.com/vortexgpgpu/vortex-toolchain-prebuilt We are currently using this as part of our Travis regression testing. https://travis-ci.org/github/vortexgpgpu/vortex

-Blaise

On Wednesday, March 10, 2021, 08:18:22 AM EST, avl-bsuir <notifications@github.com> wrote:  

Hi! Thank you for you prompt reply. Unfortunately, the link you provided is not public. And we get the error referred when we use pre-built toolchain from https://github.com/vortexgpgpu/vortex-toolchain-prebuilt

Thank you, Anton.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or unsubscribe.

avl-bsuir commented 3 years ago

Thank you a lot, did not noticed, that pre-builts were updated. Now everything works just fine.

Closing.