hi all:
I want to use pocl to build a spirv file, and i thought the script "dogfood/vecadd3/prebuilt.sh" was what i need。
However some error occurs when running the "dogfood/vecadd3/prebuilt.sh" script。
**Error Info:**
Final POCL_DEBUG flags: FFFFFFFFFFFFFFFF
[2022-11-12 08:02:43.826648145]POCL: in fn pocl_init_devices at line 503:
| GENERAL | Installing SIGFPE handler...
[2022-11-12 08:02:43.826727399]POCL: in fn cl_int pocl_vortex_init(unsigned int, cl_device_id, const char) at line 236:
| WARNING | INIT dlcache DOTO delete
[2022-11-12 08:02:43.827492932]POCL: in fn POclCreateProgramWithIL at line 66:
| LLVM | SPIR-V binary detected, converting to LLVM SPIR
[2022-11-12 08:02:43.828395629]POCL: in fn pocl_run_command at line 1107:
| GENERAL | Launching: /opt/vortex/llvm-riscv/bin/llvm-spirv
[2022-11-12 08:02:43.844885781]POCL: in fn POclCreateProgramWithIL at line 118:
| GENERAL | Creating context from IL for 1 devices
[2022-11-12 08:02:43.844915612]POCL: in fn compile_and_link_program at line 571:
| LLVM | building program with options (null)
[2022-11-12 08:02:43.845069770]POCL: in fn compile_and_link_program at line 662:
| LLVM | LLVM-SPIR binary detected
[2022-11-12 08:02:43.845093391]POCL: in fn compile_and_link_program at line 679:
| WARNING | SPIR binary provided, but no spir in build options
[2022-11-12 08:02:43.845510064]POCL: in fn llvm::Module getKernelLibrary(cl_device_id) at line 894:
| LLVM | Using /opt/vortex/pocl/compiler/lib/../share/pocl/kernel-riscv32.bc as the built-in lib.
[2022-11-12 08:02:44.050439298]POCL: in fn int pocl_llvm_link_program(cl_program, unsigned int, char*, cl_uint, unsigned char*, size_t, void**, int, int) at line 675:
| ERROR | CL_LINK_PROGRAM_FAILURE Device address bits != SPIR binary triple address bits, device: riscv32 / module: @�g�^U
[2022-11-12 08:02:44.050488262]POCL: in fn compile_and_link_program at line 688:
| ERROR | CL_LINK_PROGRAM_FAILURE Failed to link SPIR program.bc
CL_LINK_PROGRAM_FAILURE in main on line 395
About my environment:
vortexgpgpu/pocl repo: commit-id 778ef491 @ master (newest)
vortexgpgpu/vortex-toolchain-prebuilt: commit-id c411fbb@master (about 2month ago)
I only change some tool path in the dogfood/vecadd3/prebuilt.sh, no others changes to your code。
The diff is as follows:
hi all: I want to use pocl to build a spirv file, and i thought the script "dogfood/vecadd3/prebuilt.sh" was what i need。 However some error occurs when running the "dogfood/vecadd3/prebuilt.sh" script。
Final POCL_DEBUG flags: FFFFFFFFFFFFFFFF [2022-11-12 08:02:43.826648145]POCL: in fn pocl_init_devices at line 503: | GENERAL | Installing SIGFPE handler... [2022-11-12 08:02:43.826727399]POCL: in fn cl_int pocl_vortex_init(unsigned int, cl_device_id, const char) at line 236: | WARNING | INIT dlcache DOTO delete [2022-11-12 08:02:43.827492932]POCL: in fn POclCreateProgramWithIL at line 66: | LLVM | SPIR-V binary detected, converting to LLVM SPIR [2022-11-12 08:02:43.828395629]POCL: in fn pocl_run_command at line 1107: | GENERAL | Launching: /opt/vortex/llvm-riscv/bin/llvm-spirv [2022-11-12 08:02:43.844885781]POCL: in fn POclCreateProgramWithIL at line 118: | GENERAL | Creating context from IL for 1 devices [2022-11-12 08:02:43.844915612]POCL: in fn compile_and_link_program at line 571: | LLVM | building program with options (null) [2022-11-12 08:02:43.845069770]POCL: in fn compile_and_link_program at line 662: | LLVM | LLVM-SPIR binary detected [2022-11-12 08:02:43.845093391]POCL: in fn compile_and_link_program at line 679: | WARNING | SPIR binary provided, but no spir in build options [2022-11-12 08:02:43.845510064]POCL: in fn llvm::Module getKernelLibrary(cl_device_id) at line 894: | LLVM | Using /opt/vortex/pocl/compiler/lib/../share/pocl/kernel-riscv32.bc as the built-in lib. [2022-11-12 08:02:44.050439298]POCL: in fn int pocl_llvm_link_program(cl_program, unsigned int, char*, cl_uint, unsigned char*, size_t, void**, int, int) at line 675: | ERROR | CL_LINK_PROGRAM_FAILURE Device address bits != SPIR binary triple address bits, device: riscv32 / module: @�g�^U [2022-11-12 08:02:44.050488262]POCL: in fn compile_and_link_program at line 688: | ERROR | CL_LINK_PROGRAM_FAILURE Failed to link SPIR program.bc CL_LINK_PROGRAM_FAILURE in main on line 395
About my environment: vortexgpgpu/pocl repo: commit-id 778ef491 @ master (newest) vortexgpgpu/vortex-toolchain-prebuilt: commit-id c411fbb@master (about 2month ago)
I only change some tool path in the dogfood/vecadd3/prebuilt.sh, no others changes to your code。 The diff is as follows:
compile_riscv_lx_spv() {
-RISCV_TOOLCHAIN_PATH=/home/blaise/dev/riscv-gnu-toolchain/release_linux64 -LLVM_PREFIX=/home/blaise/dev/llvm-riscv/releaseRV64 -POCL_CC_PATH=/home/blaise/dev/pocl/drops_rvlx64_cc -POCL_RT_PATH=/home/blaise/dev/pocl/drops_rvlx64_rt +RISCV_TOOLCHAIN_PATH=/opt/vortex/riscv-gnu-toolchain +LLVM_PREFIX=/opt/vortex/llvm-riscv +POCL_CC_PATH=/opt/vortex/pocl/compiler +POCL_RT_PATH=/opt/vortex/pocl/runtime