Forums - SIGABRT signal when calling clBuildProgram

2 posts / 0 new
Last post
SIGABRT signal when calling clBuildProgram
potato19921025
Join Date: 25 Apr 22
Posts: 2
Posted: Sun, 2022-06-05 18:38

I have a opencl program that composed of one .cl file and 16 .h files, it runs perfectly on Nvidia/Intel/Arm Mali device without any problem.

When I tried to port it to my Xiaomi Mi 10, the program crashed at clBuildProgram with SIGABRT.

I have tried the OpenCL.so from the device and the adreno_opencl_ml_sdk_v2.2, same phenomenon. Android version 12. Platform 31.

I can comfirm that sony's example https://www.lantronix.com/blog/running-opencl-sample-application-open-q-... works on my device.

After many days of debuging, I found that when I reduced my code from so many .h files into only 3, the build can be passed. Even more ridiculous, there seems to be a limitation of the code lines. In the 4th .h file, deleting some functions would make the build pass, based on it, however, adding a particular lines of code would  bring the SIGABRT error , even it's just simple code like:

```

if (a>b) return 0;

```

At some point, this would fail:

```

if (a>0 || b>0 || c>0 || d>0) return 0;

```

This would pass:

```

if (a>0 || b>0) return 0;

```

This would fail:

```

if (a>0 || b>0) return 0;

if (c>0 || d>0) return 0;

```

As I delete some functions before this code block, they three would all pass the build.

Now I suspect there is a limitation of code in the Opencl linker. Anyone has the idea?

  • Up0
  • Down0
potato19921025
Join Date: 25 Apr 22
Posts: 2
Posted: Tue, 2022-06-07 10:31

By the way, same thing happens to lib32 and lib64.

The stack:

abort 0x00000072eb698a28
(anonymous namespace)::Verifier::runOnFunction(llvm::Function&) 0x00000071a9c45574
llvm::FPPassManager::runOnFunction(llvm::Function&) 0x00000071a9c35448
llvm::FPPassManager::runOnModule(llvm::Module&) 0x00000071a9c35758
llvm::MPPassManager::runOnModule(llvm::Module&) 0x00000071a9c359c0
llvm::PassManagerImpl::run(llvm::Module&) 0x00000071a9c3654c
clang::clanglib::RunARMPostLinkFixupPasses(llvm::Module&) 0x00000071aadd63ec
clang::clanglib::MinLinkCLRuntime(llvm::MemoryBuffer*, llvm::raw_ostream*) 0x00000071aadd5b84
(anonymous namespace)::BasicCompilation::link() 0x00000071aadf7018
cl_compiler_link_program 0x00000071aadf1eb8
cl_program_link_immediate 0x0000007221331cb8
cl_program_build_immediate 0x0000007221330d5c
cb_build_program 0x000000722133766c
qCLDrvAPI_clBuildProgram 0x0000007226fe2364
build_program cl_context.c:169
cl_context_build_program cl_context.c:234

update: I instantly succeed using Huwei P30 (Huawei chip) without changing any code, also succeed with Samsung phone.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.