OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1719 Discussions

Segmentation fault inside clBuildProgram

hvdijk
Beginner
613 Views

Hi,

 

I am trying to run code with the Intel CPU runtime for OpenCL installed from l_opencl_p_18.1.0.015.tgz and am experiencing a segmentation fault inside clBuildProgram that shows up with the attached program. It does not always segfault, sometimes it hangs instead, rarely it completes without reporting any error. When it segfaults, the output is:

 

Stack dump:
0. Running pass 'Function Pass Manager' on module 'main'.
1. Running pass 'X86 DAG->DAG Instruction Selection' on function ''
Segmentation fault

 

When I run this in gdb, the backtrace shows:

 

Thread 1 "main" received signal SIGSEGV, Segmentation fault.
0x00007fffe5173ef9 in llvm::DAGTypeLegalizer::DisintegrateMERGE_VALUES(llvm::SDNode*, unsigned int) () from /opt/intel/opencl_compilers_and_libraries_18.1.0.015/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
(gdb) bt
#0 0x00007fffe5173ef9 in llvm::DAGTypeLegalizer::DisintegrateMERGE_VALUES(llvm::SDNode*, unsigned int) ()
from /opt/intel/opencl_compilers_and_libraries_18.1.0.015/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#1 0x00007fffe51eb97c in llvm::DAGTypeLegalizer::ExpandRes_MERGE_VALUES(llvm::SDNode*, unsigned int, llvm::SDValue&, llvm::SDValue&) ()
from /opt/intel/opencl_compilers_and_libraries_18.1.0.015/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#2 0x00007fffffff6bb0 in ?? ()
#3 0x00007fffffff6ba0 in ?? ()
#4 0x0000555556e1c2b8 in ?? ()
#5 0x0000555500000000 in ?? ()
#6 0x0000000000000000 in ?? ()

 

The included hello.ll has been heavily reduced automatically to something that no longer makes sense, it has been reduced to the minimum that I could find to reproduce this particular segmentation fault. The generated hello.bc still passes spir_verifier's checks, which prints:

 

According to this SPIR Verifier, hello.bc is a valid SPIR module.

 

I am running on Ubuntu.

 

Is this a bug in the OpenCL runtime, some incompatibility with something on my system, or is there something invalid in the SPIR that I will need to take care to avoid, something that is not detected by the SPIR verifier?

 

Thank you,

Harald van Dijk

Labels (1)
0 Kudos
0 Replies
Reply