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.
1663 Discussions

segmentation fault inside clBuildProgram (bug demo attached)

Noah_R_
Beginner
346 Views

I am experiencing a segmentation fault inside the call to clBuildProgram when using the Intel platform and Intel Xenon CPU.   This is for a relatively complex kernel / OpenCL program.  Simple kernels build fine.  I am not having any problem building the same source code on the Apple or NVIDIA platforms.

I am attaching a bug demonstration program with as simple kernel.  Please private message or email me for the offending kernel source code file.

g++ -o build_bug_demo opencl_program_build.cpp bugDemoSupport.cpp -I$OPENCL_INC_DIR -L$OPENCL_LIB_DIR -lOpenCL

# Here is what I see for the offending program source:
./build_bug_demo -p 2
Selected CL_PLATFORM_NAME: Intel(R) OpenCL
CL_DEVICE_NAME: Intel(R) Xeon(R) CPU           X5650  @ 2.67GHz
CL_DRIVER_VERSION: 1.2.0.92
Loading Source...
clCreateProgramWithSource...
clBuildProgram...
Stack dump:
0.    Running pass 'Intel OpenCL Vectorizer' on module 'Program'.
1.    Running pass 'Intel OpenCL VectorizerCore' on function '@__Vectorized_.sum_reduce_over_velocity_space_stage1'
2.    Running pass 'Predicator' on function '@__Vectorized_.sum_reduce_over_velocity_space_stage1'
Segmentation fault (core dumped)


 

 

 

 

 

 

 

0 Kudos
8 Replies
Robert_I_Intel
Employee
346 Views

Noah,

Sorry you are experiencing a problem with our OpenCL compiler. I will send you a private message.

Sincerely,

Robert

Viet_Hung_N_
Beginner
346 Views

I faced same problem as follow:

[common@localhost BenchmarkX264]$ Debug/BenchmarkX264 
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x264 [info]: OpenCL acceleration enabled with Intel(R) Corporation        Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz 
x264 [info]: Compiling OpenCL kernels...
Stack dump:
0.	Running pass 'Intel OpenCL Vectorizer' on module 'Program'.
1.	Running pass 'Intel OpenCL VectorizerCore' on function '@__Vectorized_.sum_inter_cost'
2.	Running pass 'PacketizeFunction' on function '@__Vectorized_.sum_inter_cost'
Segmentation fault (core dumped)

My platform is CentOS 7 x86_84. Please guide me or if you need more information, please tell me.

Robert_I_Intel
Employee
346 Views

If you need a quick workaround, you can turn off vectorization by CL_CONFIG_USE_VECTORIZER or by supplying a vector type in vec_type_hint. See https://software.intel.com/en-us/node/531302, https://software.intel.com/en-us/node/531303

Compiler team is looking for a more permanent solution.

Sergey_K_2
Beginner
346 Views

Hi,

I have the same problem

$ ./Release/Sibernetic 
Sibernetic: no arguments specified, run method executing
Configuration was loaded
 CL_PLATFORM_VERSION [0]: 	OpenCL 1.2 LINUX
CL_CONTEXT_PLATFORM [0]: CL_DEVICE_NAME [0]:	       Intel(R) Core(TM) i7-2700K CPU @ 3.50GHz

CL_CONTEXT_PLATFORM [0]: CL_DEVICE_TYPE [0]:	CPU
CL_CONTEXT_PLATFORM [0]: CL_DEVICE_MAX_WORK_GROUP_SIZE [0]: 	8192
CL_CONTEXT_PLATFORM [0]: CL_DEVICE_MAX_COMPUTE_UNITS [0]: 	8
CL_CONTEXT_PLATFORM [0]: CL_DEVICE_GLOBAL_MEM_SIZE [0]: 	0
CL_CONTEXT_PLATFORM [0]: CL_DEVICE_GLOBAL_MEM_CACHE_SIZE [0]:	262144
CL_CONTEXT_PLATFORM 0: CL_DEVICE_LOCAL_MEM_SIZE [0]:	32768
Stack dump:
0.	Running pass 'Intel OpenCL Vectorizer' on module 'main'.
1.	Running pass 'Intel OpenCL VectorizerCore' on function '@__Vectorized_.computeInteractionWithMembranes'
2.	Running pass 'Predicator' on function '@__Vectorized_.computeInteractionWithMembranes'
Segmentation fault (core dumped)

After I installed intel code builder for Ubuntu 14.04 x86_64.. Actually I don't remember such problem with other version of drivers or on other platforms AMD or NVIDIA. Source code you can find here 

 

LSolis
Beginner
346 Views

Hi everyone,

I am experiencing the same problem running the example for Linux "intel_ocl_gemm",  even though vectorization is off.

Is there any effective workaround for this issue? I attached my code. Notice that I have added the required debug flags for building the program:

[lvs@eredmithrim GEMM]$ gdb --args ./GEMM
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-47.el6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/wimi/lvs/ESA_Projects/bioinfo/docking_src/intel/intel_ocl_gemm/GEMM/GEMM...done.
(gdb) b 283
Breakpoint 1 at 0x40e6fa: /home/wimi/lvs/ESA_Projects/bioinfo/docking_src/intel/intel_ocl_gemm/GEMM/gemm.cpp:283. (2 locations)
(gdb) r
Starting program: /home/wimi/lvs/ESA_Projects/bioinfo/docking_src/intel/intel_ocl_gemm/GEMM/./GEMM 
Missing separate debuginfo for /usr/lib64/libOpenCL.so.1
Try: yum --enablerepo='*debug*' install /usr/lib/debug/.build-id/bc/f3fa717d4202742c8a899209eec04219b89f22.debug
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Platforms (1):
    [0] Intel(R) OpenCL [Selected]
Devices (1):
    [0] Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz [Selected]
[New Thread 0x7ffff4b74700 (LWP 17172)]
[New Thread 0x7ffff4773700 (LWP 17173)]
[New Thread 0x7fffeffff700 (LWP 17174)]
Build program options: "-DT=float -DTILE_SIZE_M=1 -DTILE_GROUP_M=16 -DTILE_SIZE_N=128 -DTILE_GROUP_N=1 -DTILE_SIZE_K=8 -g -s /home/wimi/lvs/ESA_Projects/bioinfo/docking_src/intel/intel_ocl_gemm/GEMM/gemm.cl"

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6000948 in ?? () from /opt/intel/opencl-1.2-5.2.0.10002/lib64/libOclCpuBackEnd.so
Missing separate debuginfos, use: debuginfo-install glibc-2.12-1.166.el6_7.7.x86_64 ncurses-libs-5.7-4.20090207.el6.x86_64 numactl-2.0.9-2.el6.x86_64 opencl-1.2-intel-cpu-5.2.0.10002-1.x86_64 zlib-1.2.3-29.el6.x86_64
(gdb) 

 

Robert_I_Intel
Employee
346 Views

Could you try our latest CPU runtime https://software.intel.com/en-us/articles/opencl-drivers#core_xeon

See if you experience the same issue. Thanks!

LSolis
Beginner
346 Views

Robert I. (Intel) wrote:

Could you try our latest CPU runtime https://software.intel.com/en-us/articles/opencl-drivers#core_xeon

See if you experience the same issue. Thanks!

I tried what you suggested (I installed opencl_runtime_16.1_x64_rh_5.2.0.10002), but I got the same result.

Any ideas on how to successfully debug kernels?

LSolis
Beginner
346 Views

Hi everyone,

I am able to debug kernel code. The trick to avoid that segmentation fault was to install a previous Intel OpenCL runtime, i.e. the 15.1 one. 

The latest runtime still produces segmentation fault on my CentOS 6.7 machine, as stated above.

I hope this helps.

Reply