Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
649 Discussions

Segmentation fault when openmp_reduction finish

eton
Novice
254 Views

is there anyone can tell me why or how to deal with this error ?

Encountered a segment error while running the program in ` oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction`

build with readme's method.

 

 



[Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `./src/openmp_reduction'. Program terminated with signal SIGSEGV, Segmentation fault. #0 std::__1::__cxx_atomic_fetch_sub[abi:nn180000]<int>(std::__1::__cxx_atomic_base_impl<int>*, int, std::__1::memory_order) (__a=0x4, __delta=1, --Type <RET> for more, q to quit, c to continue without paging-- __order=std::__1::memory_order_seq_cst) at /netbatch/donb24676_00/dir/workspace/NIT/xmain-rel/LX/xmainefi2linux_release/ws/icsws/deploy/linux_release/bin/compiler/../../opt/compiler/include/c++/v1/__atomic/cxx_atomic_impl.h:462 warning: 462 /netbatch/donb24676_00/dir/workspace/NIT/xmain-rel/LX/xmainefi2linux_release/ws/icsws/deploy/linux_release/bin/compiler/../../opt/compiler/include/c++/v1/__atomic/cxx_atomic_impl.h: No such file or directory [Current thread is 1 (Thread 0x7f785401cfc0 (LWP 272003))] warning: File "/opt/intel/oneapi/compiler/2024.1/lib/libsycl.so.7.1.0-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$datadir/../../../..:/usr". To enable execution of this file add add-auto-load-safe-path /opt/intel/oneapi/compiler/2024.1/lib/libsycl.so.7.1.0-gdb.py line to your configuration file "/home/eton/.config/gdb/gdbinit". To completely disable this security protection add set auto-load safe-path / line to your configuration file "/home/eton/.config/gdb/gdbinit". For more information about this security protection see the "Auto-loading safe path" section in the GDB manual. E.g., run from the shell: info "(gdb)Auto-loading safe path" (gdb) bt #0 std::__1::__cxx_atomic_fetch_sub[abi:nn180000]<int>(std::__1::__cxx_atomic_base_impl<int>*, int, std::__1::memory_order) (__a=0x4, __delta=1, __order=std::__1::memory_order_seq_cst) at /netbatch/donb24676_00/dir/workspace/NIT/xmain-rel/LX/xmainefi2linux_release/ws/icsws/deploy/linux_release/bin/compiler/../../opt/compiler/include/c++/v1/__atomic/cxx_atomic_impl.h:462 #1 std::__1::__atomic_base<int, true>::fetch_sub[abi:nn180000](int, std::__1::memory_order) (this=0x4, __op=1, __m=std::__1::memory_order_seq_cst) at /netbatch/donb24676_00/dir/workspace/NIT/xmain-rel/LX/xmainefi2linux_release/ws/icsws/deploy/linux_release/bin/compiler/../../opt/compiler/include/c++/v1/__atomic/atomic_base.h:171 #2 __tgt_rtl_unregister_lib (Desc=0x402210 <openmp_offloading[descriptor]>) at /netbatch/donb24676_00/dir/workspace/NIT/xmain-rel/LX/xmainefi2linux_release/ws/icsws/llvm/openmp/libomptarget/plugins/opencl/src/rtl.cpp:4451 #3 0x00007f78532f193f in __tgt_unregister_lib (Desc=0x402210 <openmp_offloading[descriptor]>) at /netbatch/donb24676_00/dir/workspace/NIT/xmain-rel/LX/xmainefi2linux_release/ws/icsws/llvm/openmp/libomptarget/src/interface.cpp:116 #4 0x00007f785414a12a in _dl_call_fini (closure_map=closure_map@entry=0x7f785417c2f0) at ./elf/dl-call_fini.c:43 #5 0x00007f785414d764 in _dl_fini () at ./elf/dl-fini.c:78 #6 0x00007f7853c3d55d in __run_exit_handlers (status=0, listp=0x7f7853dd1820 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at ./stdlib/exit.c:116 #7 0x00007f7853c3d69a in __GI_exit (status=<optimized out>) at ./stdlib/exit.c:146 #8 0x00007f7853c26251 in __libc_start_call_main (main=main@entry=0x401640 <main>, argc=argc@entry=1, argv=argv@entry=0x7fff59570518) at ../sysdeps/nptl/libc_start_call_main.h:74 #9 0x00007f7853c26305 in __libc_start_main_impl (main=0x401640 <main>, argc=1, argv=0x7fff59570518, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff59570508) at ../csu/libc-start.c:360 #10 0x0000000000401231 in _start ()

ENV: 

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
eton@acr10d:~/00-src/60-learning/62-oneapi-intel/oneAPI-samples/DirectProgramming/C++/ParallelPatterns/openmp_reduction/build$ uname -a
Linux acr10d 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux

0 Kudos
1 Solution
eton
Novice
248 Views

when I remove `-fopenmp-targets=spir64`, the error gone.

View solution in original post

0 Kudos
2 Replies
eton
Novice
175 Views

cmake .. -GNinja && cmake --build . -j

 

$ LIBOMPTARGET_DEBUG=1 ./src/openmp_reduction
Libomptarget --> Init target library!
Libomptarget --> Callback to __tgt_register_ptask_services with handlers 0x00007f2f72aed580 0x00007f2f72aece40
OMPT --> Entering connectLibrary (libomp)
OMPT --> OMPT: Trying to load library libiomp5.so
OMPT --> OMPT: Trying to get address of connection routine ompt_libomp_connect
OMPT --> OMPT: Library connection handle = 0x7f2f72afea00
OMPT --> Exiting connectLibrary (libomp)
Libomptarget --> Loading RTLs...
Libomptarget --> Loading library 'libomptarget.rtl.level0.so'...
Target LEVEL_ZERO RTL --> Init Level0 plugin!
Target LEVEL_ZERO RTL --> ONEAPI_DEVICE_SELECTOR specified 0 root devices
Target LEVEL_ZERO RTL --> (Accept/Discard [T/F] DeviceID[.SubID[.CCSID]]) -2(all), -1(ignore)
Target LEVEL_ZERO RTL --> OMPT: Entering connectLibrary (libomptarget)
OMPT --> OMPT: Trying to load library libomptarget.so
OMPT --> OMPT: Trying to get address of connection routine ompt_libomptarget_connect
OMPT --> OMPT: Library connection handle = 0x7f2f7250abc0
OMPT --> Enter ompt_libomptarget_connect
OMPT --> Leave ompt_libomptarget_connect
Target LEVEL_ZERO RTL --> OMPT: Exiting connectLibrary (libomptarget)
Libomptarget --> Successfully loaded library 'libomptarget.rtl.level0.so'!
Target LEVEL_ZERO RTL --> Looking for Level0 devices...
Target LEVEL_ZERO RTL --> Error: findDevices:zeInit failed with error code 1879179264, ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE
Libomptarget --> No devices supported in this RTL
Libomptarget --> Loading library 'libomptarget.rtl.opencl.so'...
Target OPENCL RTL --> Init OpenCL plugin!
Target OPENCL RTL --> Target device type is set to GPU
Target OPENCL RTL --> OMPT: Entering connectLibrary (libomptarget)
OMPT --> OMPT: Trying to load library libomptarget.so
OMPT --> OMPT: Trying to get address of connection routine ompt_libomptarget_connect
OMPT --> OMPT: Library connection handle = 0x7f2f7250abc0
OMPT --> Enter ompt_libomptarget_connect
OMPT --> Leave ompt_libomptarget_connect
Target OPENCL RTL --> OMPT: Exiting connectLibrary (libomptarget)
Libomptarget --> Successfully loaded library 'libomptarget.rtl.opencl.so'!
Target OPENCL RTL --> Start initializing OpenCL
Target OPENCL RTL --> Platform OpenCL 3.0 CUDA 12.0.151 has 1 Devices
Target OPENCL RTL --> Warning: Extension clGetMemAllocInfoINTEL is not found.
Target OPENCL RTL --> Warning: Extension clHostMemAllocINTEL is not found.
Target OPENCL RTL --> Warning: Extension clDeviceMemAllocINTEL is not found.
Target OPENCL RTL --> Warning: Extension clSharedMemAllocINTEL is not found.
Target OPENCL RTL --> Warning: Extension clMemFreeINTEL is not found.
Target OPENCL RTL --> Warning: Extension clMemBlockingFreeINTEL is not found.
Target OPENCL RTL --> Warning: Extension clSetKernelArgMemPointerINTEL is not found.
Target OPENCL RTL --> Warning: Extension clEnqueueMemcpyINTEL is not found.
Target OPENCL RTL --> Warning: Extension clSetProgramSpecializationConstant is not found.
Target OPENCL RTL --> Warning: Extension clGetDeviceGlobalVariablePointerINTEL is not found.
Target OPENCL RTL --> Warning: Extension clGetKernelSuggestedLocalWorkSizeINTEL is not found.
Target OPENCL RTL --> Warning: Extension clGitsIndirectAllocationOffsets is not found.
Target OPENCL RTL --> Platform OpenCL 3.0 has 1 Devices
Target OPENCL RTL --> Extension clGetMemAllocInfoINTEL is found.
Target OPENCL RTL --> Extension clHostMemAllocINTEL is found.
Target OPENCL RTL --> Extension clDeviceMemAllocINTEL is found.
Target OPENCL RTL --> Extension clSharedMemAllocINTEL is found.
Target OPENCL RTL --> Extension clMemFreeINTEL is found.
Target OPENCL RTL --> Extension clMemBlockingFreeINTEL is found.
Target OPENCL RTL --> Extension clSetKernelArgMemPointerINTEL is found.
Target OPENCL RTL --> Extension clEnqueueMemcpyINTEL is found.
Target OPENCL RTL --> Extension clSetProgramSpecializationConstant is found.
Target OPENCL RTL --> Extension clGetDeviceGlobalVariablePointerINTEL is found.
Target OPENCL RTL --> Extension clGetKernelSuggestedLocalWorkSizeINTEL is found.
Target OPENCL RTL --> Warning: Extension clGitsIndirectAllocationOffsets is not found.
Libomptarget --> Registering RTL libomptarget.rtl.opencl.so supporting 2 devices!
Libomptarget --> Optional interface: __tgt_rtl_data_alloc_base
Libomptarget --> Optional interface: __tgt_rtl_data_realloc
Libomptarget --> Optional interface: __tgt_rtl_data_aligned_alloc
Libomptarget --> Optional interface: __tgt_rtl_get_device_name
Libomptarget --> Optional interface: __tgt_rtl_get_context_handle
Libomptarget --> Optional interface: __tgt_rtl_get_data_alloc_info
Libomptarget --> Optional interface: __tgt_rtl_requires_mapping
Libomptarget --> Optional interface: __tgt_rtl_manifest_data_for_region
Libomptarget --> Optional interface: __tgt_rtl_is_supported_device
Libomptarget --> Optional interface: __tgt_rtl_create_interop
Libomptarget --> Optional interface: __tgt_rtl_release_interop
Libomptarget --> Optional interface: __tgt_rtl_use_interop
Libomptarget --> Optional interface: __tgt_rtl_get_num_interop_properties
Libomptarget --> Optional interface: __tgt_rtl_get_interop_property_value
Libomptarget --> Optional interface: __tgt_rtl_get_interop_property_info
Libomptarget --> Optional interface: __tgt_rtl_get_interop_rc_desc
Libomptarget --> Optional interface: __tgt_rtl_is_accessible_addr_range
Libomptarget --> Optional interface: __tgt_rtl_notify_indirect_access
Libomptarget --> Optional interface: __tgt_rtl_is_private_arg_on_host
Libomptarget --> Optional interface: __tgt_rtl_set_function_ptr_map
Libomptarget --> Optional interface: __tgt_rtl_run_target_team_nd_region
Libomptarget --> Optional interface: __tgt_rtl_get_device_info
Libomptarget --> Optional interface: __tgt_rtl_get_device_from_ptr
Libomptarget --> Optional interface: __tgt_rtl_flush_queue
Libomptarget --> Optional interface: __tgt_rtl_sync_barrier
Libomptarget --> Optional interface: __tgt_rtl_async_barrier
Libomptarget --> Optional interface: __tgt_rtl_get_groups_shape
Libomptarget --> Optional interface: __tgt_rtl_get_mem_resources
Libomptarget --> Optional interface: __tgt_rtl_omp_alloc
Libomptarget --> Optional interface: __tgt_rtl_omp_free
Libomptarget --> Loading library 'libomptarget.rtl.x86_64.so'...
Libomptarget --> Successfully loaded library 'libomptarget.rtl.x86_64.so'!
Libomptarget --> Registering RTL libomptarget.rtl.x86_64.so supporting 4 devices!
Libomptarget --> Optional interface: __tgt_rtl_data_alloc_base
Libomptarget --> Optional interface: __tgt_rtl_requires_mapping
Libomptarget --> Optional interface: __tgt_rtl_set_function_ptr_map
Libomptarget --> Optional interface: __tgt_rtl_get_mem_resources
Libomptarget --> Optional interface: __tgt_rtl_omp_alloc
Libomptarget --> Optional interface: __tgt_rtl_omp_free
Libomptarget --> Optional interface: __tgt_rtl_notify_legacy_offload
Libomptarget --> RTLs loaded!
Target OPENCL RTL --> Target binary is a valid oneAPI OpenMP image.
Libomptarget --> Image 0x0000000000402400 is compatible with RTL libomptarget.rtl.opencl.so!
Libomptarget --> RTL 0x0000000002762790 has index 0!
Libomptarget --> Registering image 0x0000000000402400 with RTL libomptarget.rtl.opencl.so!
Libomptarget --> Done registering entries!
Number of steps is 1000000
Cpu Seq calc: PI =3.14 in 0.000332 seconds
Host OpenMP: PI =3.14 in 0.00257 seconds
success
Target OPENCL RTL --> Deinit OpenCL plugin!
Target OPENCL RTL --> Closed RTL successfully
Target LEVEL_ZERO RTL --> Deinit Level0 plugin!
Libomptarget --> Unloading target library!
Libomptarget --> Clearing Interop Table
Libomptarget --> Unregistered image 0x0000000000402400 from RTL 0x0000000002762790!
Libomptarget --> Done unregistering images!
Libomptarget --> Removing translation table for descriptor 0x00000000004023e0
Libomptarget --> Done unregistering library!
Segmentation fault (core dumped)

 

0 Kudos
eton
Novice
249 Views

when I remove `-fopenmp-targets=spir64`, the error gone.

0 Kudos
Reply