doe300 / VC4C

Compiler for the VC4CL OpenCL implementation
MIT License
118 stars 37 forks source link

Compilation Error: Normalizer: Lowering copy with more than 1 entry is not yet implemented #154

Open NetherStar64 opened 3 years ago

NetherStar64 commented 3 years ago

Some programs, like e.g. VanityGen++ Ocl throw a compilation error Like:

clBuildProgram: CL_BUILD_PROGRAM_FAILURE
Build log:
Compilation error:
        Normalizer: Lowering copy with more than 1 entry is not yet implemented: copy i32 32 entries from (c) i8* @modulus into (p) i8* %bn_mod_inverse.1967513926.%tmp.247 (guarded)
[E] Wed Mar 31 18:46:00 2021: (c) i8* @modulus - read-only register <8 x i32> SIMD vector -> (p) i8* %bn_mod_inverse.1967513926.%tmp.247 - read-write memory access via VPM
[E] Wed Mar 31 18:46:00 2021:  (1) /usr/local/lib/libVC4CC.so.1.2 : vc4c::CompilationError::CompilationError(vc4c::CompilationStep, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0xf4 [0xf7047fd0]
[E] Wed Mar 31 18:46:00 2021:  (2) /usr/local/lib/libVC4CC.so.1.2 : +0xc109b8 [0xf741b9b8]
[E] Wed Mar 31 18:46:00 2021:  (3) /usr/local/lib/libVC4CC.so.1.2 : vc4c::normalization::mapMemoryAccess(vc4c::Method&, vc4c::InstructionWalker, vc4c::intermediate::MemoryInstruction*, vc4c::tools::SmallSortedPointerSet<vc4c::normalization::MemoryInfo const*> const&, vc4c::tools::SmallSortedPointerSet<vc4c::normalization::MemoryInfo const*> const&)+0x30c [0xf741a7e4]
[E] Wed Mar 31 18:46:00 2021:  (4) /usr/local/lib/libVC4CC.so.1.2 : vc4c::normalization::mapMemoryAccess(vc4c::Module const&, vc4c::Method&, vc4c::Configuration const&)+0x508 [0xf73d8fb8]
[E] Wed Mar 31 18:46:00 2021:  (5) /usr/local/lib/libVC4CC.so.1.2 : vc4c::normalization::Normalizer::normalizeMethod(vc4c::Module&, vc4c::Method&) const+0x3c0 [0xf7433478]
[E] Wed Mar 31 18:46:00 2021:  (6) /usr/local/lib/libVC4CC.so.1.2 : +0xc273fc [0xf74323fc]
[E] Wed Mar 31 18:46:00 2021:  (7) /usr/local/lib/libVC4CC.so.1.2 : +0xc2a82c [0xf743582c]
[E] Wed Mar 31 18:46:00 2021:  (8) /usr/local/lib/libVC4CC.so.1.2 : std::function<void (vc4c::Method* const&)>::operator()(vc4c::Method* const&) const+0x54 [0xf7050c54]
[E] Wed Mar 31 18:46:00 2021:  (9) /usr/local/lib/libVC4CC.so.1.2 : vc4c::ThreadPool::scheduleAll<vc4c::Method*, std::vector<vc4c::Method*, std::allocator<vc4c::Method*> > >(std::vector<vc4c::Method*, std::allocator<vc4c::Method*> > const&, std::function<void (vc4c::Method* const&)> const&, logging::Logger*)::{lambda()#1}::operator()() const+0x2c [0xf704ee3c]
[E] Wed Mar 31 18:46:00 2021:  (10) /usr/local/lib/libVC4CC.so.1.2 : std::_Function_handler<void (), vc4c::ThreadPool::scheduleAll<vc4c::Method*, std::vector<vc4c::Method*, std::allocator<vc4c::Method*> > >(std::vector<vc4c::Method*, std::allocator<vc4c::Method*> > const&, std::function<void (vc4c::Method* const&)> const&, logging::Logger*)::{lambda()#1}>::_M_invoke(std::_Any_data const&)+0x24 [0xf70525bc]
[E] Wed Mar 31 18:46:00 2021:  (11) /usr/local/lib/libVC4CC.so.1.2 : std::function<void ()>::operator()() const+0x40 [0xf7098064]
[E] Wed Mar 31 18:46:00 2021:  (12) /usr/local/lib/libVC4CC.so.1.2 : +0x8b60f4 [0xf70c10f4]
[E] Wed Mar 31 18:46:00 2021:  (13) /usr/local/lib/libVC4CC.so.1.2 : +0x8b834c [0xf70c334c]
[E] Wed Mar 31 18:46:00 2021:  (14) /usr/local/lib/libVC4CC.so.1.2 : +0x8b8010 [0xf70c3010]
[E] Wed Mar 31 18:46:00 2021:  (15) /usr/local/lib/libVC4CC.so.1.2 : +0x8b7d90 [0xf70c2d90]
[E] Wed Mar 31 18:46:00 2021:  (16) /usr/local/lib/libVC4CC.so.1.2 : +0x8b8788 [0xf70c3788]
[E] Wed Mar 31 18:46:00 2021:  (17) /usr/local/lib/libVC4CC.so.1.2 : +0x8b83e8 [0xf70c33e8]
[E] Wed Mar 31 18:46:00 2021:  (18) /usr/local/lib/libVC4CC.so.1.2 : std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const+0x48 [0xf70c5760]
[E] Wed Mar 31 18:46:00 2021:  (19) /usr/local/lib/libVC4CC.so.1.2 : std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)+0x28 [0xf70c4c8c]
[E] Wed Mar 31 18:46:00 2021:  (20) /usr/local/lib/libVC4CC.so.1.2 : void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)+0xb0 [0xf70c7734]
[E] Wed Mar 31 18:46:00 2021:  (21) /usr/local/lib/libVC4CC.so.1.2 : std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)+0x64 [0xf70c6540]
[E] Wed Mar 31 18:46:00 2021:  (22) /usr/local/lib/libVC4CC.so.1.2 : std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#1}::operator()() const+0x70 [0xf70c51f0]
[E] Wed Mar 31 18:46:00 2021:  (23) /usr/local/lib/libVC4CC.so.1.2 : std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#2}::operator()() const+0x30 [0xf70c522c]
[E] Wed Mar 31 18:46:00 2021:  (24) /usr/local/lib/libVC4CC.so.1.2 : std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#2}::_FUN()+0x10 [0xf70c524c]
[E] Wed Mar 31 18:46:00 2021:  (25) /lib/arm-linux-gnueabihf/libpthread.so.0 : +0xf158 [0xf7a57158]
[E] Wed Mar 31 18:46:00 2021:  (26) /usr/local/lib/libVC4CC.so.1.2 : +0x8b8e88 [0xf70c3e88]
[E] Wed Mar 31 18:46:00 2021:  (27) /usr/local/lib/libVC4CC.so.1.2 : void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)+0xac [0xf70c5334]
[E] Wed Mar 31 18:46:00 2021:  (28) /usr/local/lib/libVC4CC.so.1.2 : std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool)+0xa4 [0xf70c4720]
[E] Wed Mar 31 18:46:00 2021:  (29) /usr/local/lib/libVC4CC.so.1.2 : +0x8b7df4 [0xf70c2df4]
[E] Wed Mar 31 18:46:00 2021:  (30) /usr/local/lib/libVC4CC.so.1.2 : std::packaged_task<void ()>::operator()()+0x40 [0xf70c63b4]
[E] Wed Mar 31 18:46:00 2021:  (31) /usr/local/lib/libVC4CC.so.1.2 : vc4c::ThreadPool::workerTask(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x194 [0xf70c1460]
[E] Wed Mar 31 18:46:00 2021:  (32) /usr/local/lib/libVC4CC.so.1.2 : +0x8b5e78 [0xf70c0e78]
[E] Wed Mar 31 18:46:00 2021:  (33) /usr/local/lib/libVC4CC.so.1.2 : +0x8b6eb0 [0xf70c1eb0]
[E] Wed Mar 31 18:46:00 2021:  (34) /usr/local/lib/libVC4CC.so.1.2 : +0x8b6ac4 [0xf70c1ac4]
[E] Wed Mar 31 18:46:00 2021:  (35) /usr/local/lib/libVC4CC.so.1.2 : +0x8b8318 [0xf70c3318]
[E] Wed Mar 31 18:46:00 2021:  (36) /usr/local/lib/libVC4CC.so.1.2 : +0x8b7fbc [0xf70c2fbc]
[E] Wed Mar 31 18:46:00 2021:  (37) /usr/local/lib/libVC4CC.so.1.2 : +0x8b7d60 [0xf70c2d60]
[E] Wed Mar 31 18:46:00 2021:  (38) /lib/arm-linux-gnueabihf/libstdc++.so.6 : +0x9d9b0 [0xf673a9b0]
[E] Wed Mar 31 18:46:05 2021: Compiler threw exception: Normalizer: Lowering copy with more than 1 entry is not yet implemented: copy i32 32 entries from (c) i8* @modulus into (p) i8* %bn_mod_inverse.1967513926.%tmp.247 (guarded)
Device: VideoCore IV GPU
Vendor: Broadcom (14e4)
Driver: 0.4.9999
Profile: EMBEDDED_PROFILE
Version: OpenCL 1.2 VC4CL 0.4.9999 (842d444)
Max compute units: 1
Max workgroup size: 12
Global memory: 79691776
Max allocation: 79691776
Available OpenCL platforms:
0: [doe300] OpenCL for the Raspberry Pi VideoCore IV GPU
  0: [Broadcom] VideoCore IV GPU

I don't remember where I seen this error too, but multiple Ocl programs throw this error

doe300 commented 3 years ago

Can you by any chance give me a full OpenCL C kernel source for which this error occurs? Or a simple reproduces command and a quick guide as to how to set it up?

NetherStar64 commented 3 years ago

@doe300 https://github.com/exploitagency/vanitygen-plus Is the Repository, clone and then make oclvanitygen (I don't remember if you need to install any dependencies first) Then when you try to generate an Adress with e.g. sudo ./oclvanitygen -C BTC 1234 it throws an error.

doe300 commented 3 years ago

Sorry for the late reply.

I did fix this particular issue, but the kernel compiled is far too complex for the VC4C compiler to handle it, so now it will just fail later in the build.