Intel® High Level Design
Support for Intel® High Level Synthesis Compiler, DSP Builder, OneAPI for Intel® FPGAs, Intel® FPGA SDK for OpenCL™
708 Discussions

SEGFAULT with vector-add example when running on FPGA Emulator

alperro
Beginner
1,722 Views

I have tried to compile and run the vector-add example but I get segmentation fault when running on FPGA emulator.

It runs fine when running on CPU:

Running on device: Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz
Vector size: 10000
[0]: 0 + 0 = 0
[1]: 1 + 1 = 2
[2]: 2 + 2 = 4
...
[9999]: 9999 + 9999 = 19998
Vector add successfully completed on device.

while on emulator I get:

Running on device: Intel(R) FPGA Emulation Device
Vector size: 10000
Segmentation fault

Here is the backtrace.

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff443fe62 in Intel::OpenCL::TaskExecutor::TEDevice::on_scheduler_entry(bool, Intel::OpenCL::TaskExecutor::ArenaHandler&) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libtask_executor_emu.so.2022.15.12.0
Missing separate debuginfos, use: debuginfo-install glibc-2.17-324.el7_9.x86_64 zlib-1.2.7-19.el7_9.x86_64
(gdb) bt
#0 0x00007ffff443fe62 in Intel::OpenCL::TaskExecutor::TEDevice::on_scheduler_entry(bool, Intel::OpenCL::TaskExecutor::ArenaHandler&) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libtask_executor_emu.so.2022.15.12.0
#1 0x00007ffff3c3be08 in tbb::detail::r1::observer_list::do_notify_entry_observers (this=0x5, last=@0x7ffff7f5c090: 0x7, worker=144)
at /localdisk/ci/runner001/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/observer_proxy.cpp:199
#2 0x00007ffff3c55ba8 in notify_entry_observers (this=0x5, last=@0x7ffff7f5c090: 0x7, worker=<optimized out>)
at /localdisk/ci/runner001/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/observer_proxy.h:135
#3 tbb::detail::r1::nested_arena_context::nested_arena_context (this=0x5, td=..., nested_arena=..., slot_index=6975968)
at /localdisk/ci/runner001/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/arena.cpp:537
#4 0x00007ffff3c3e1a8 in tbb::detail::r1::task_arena_impl::execute (ta=..., d=...)
at /localdisk/ci/runner001/intel-innersource/001/_work/libraries.threading.infrastructure.onetbb-ci/libraries.threading.infrastructure.onetbb-ci/onetbb_source_code/src/tbb/arena.cpp:690
#5 0x00007ffff4445243 in Intel::OpenCL::TaskExecutor::immediate_command_list::LaunchExecutorTask(bool, Intel::OpenCL::Utils::SharedPtr<Intel::OpenCL::TaskExecutor::ITaskBase> const&) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libtask_executor_emu.so.2022.15.12.0
#6 0x00007ffff47a6dd6 in Intel::OpenCL::Framework::FrameworkProxy::ExecuteImmediate(Intel::OpenCL::Utils::SharedPtr<Intel::OpenCL::TaskExecutor::ITaskBase> const&) const ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libintelocl_emu.so
#7 0x00007ffff47f20be in Intel::OpenCL::Framework::BuildTask::Launch() () from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libintelocl_emu.so
#8 0x00007ffff47fdd62 in Intel::OpenCL::Framework::ProgramService::BuildProgram(Intel::OpenCL::Utils::SharedPtr<Intel::OpenCL::Framework::Program>&, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*) () from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libintelocl_emu.so
#9 0x00007ffff47d496a in Intel::OpenCL::Framework::Context::BuildProgram(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libintelocl_emu.so
#10 0x00007ffff47b7a49 in Intel::OpenCL::Framework::ContextModule::BuildProgram(_cl_program*, unsigned int, _cl_device_id* const*, char const*, void (*)(_cl_program*, void*), void*) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libintelocl_emu.so
#11 0x00007ffff476261c in clBuildProgram () from /sw/oneapi/compiler/2023.0.0/linux/lib/x64/libintelocl_emu.so
#12 0x00007ffff7219707 in _pi_result sycl::_V1::detail::plugin::call_nocheck<(sycl::_V1::detail::PiApiKind)42, _pi_program*, int, _pi_device* const*, char const*, decltype(nullptr), decltype(nullptr)>(_pi_program*, int, _pi_device* const*, char const*, decltype(nullptr), decltype(nullptr)) const () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#13 0x00007ffff721856c in sycl::_V1::detail::ProgramManager::build(std::unique_ptr<_pi_program, _pi_result (*)(_pi_program*)>, std::shared_ptr<sycl::_V1::detail::context_impl>, 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&, _pi_device* const&, unsigned int) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#14 0x00007ffff72132bb in sycl::_V1::detail::ProgramManager::getBuiltPIProgram(long, std::shared_ptr<sycl::_V1::detail::context_impl> const&, std::shared_ptr<sycl::_V1::detail::device_impl> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sycl::_V1::detail::program_impl const*, bool) () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#15 0x00007ffff7214832 in sycl::_V1::detail::ProgramManager::getOrCreateKernel(long, std::shared_ptr<sycl::_V1::detail::context_impl> const&, std::shared_ptr<sycl::_V1::detail::device_impl> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, sycl::_V1::detail::program_impl const*) () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#16 0x00007ffff72603e5 in sycl::_V1::detail::enqueueImpKernel(std::shared_ptr<sycl::_V1::detail::queue_impl> const&, sycl::_V1::detail::NDRDescT&, std::vector<sycl::_V1::detail::ArgDesc, std::allocator<sycl::_V1::detail::ArgDesc> >&, std::shared_ptr<sycl::_V1::detail::kernel_bundle_impl> const&, std::shared_ptr<sycl::_V1::detail::kernel_impl> const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, long const&, std::vector<_pi_event*, std::allocator<_pi_event*> >&, _pi_event**, std::function<void* (sycl::_V1::detail::AccessorImplHost*)> const&) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#17 0x00007ffff7263be2 in sycl::_V1::detail::ExecCGCommand::enqueueImp() () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#18 0x00007ffff724fcd9 in sycl::_V1::detail::Command::enqueue(sycl::_V1::detail::EnqueueResultT&, sycl::_V1::detail::BlockingT, std::vector<sycl::_V1::detail::Command*, std::allocator<sycl::_V1::detail::Command*> >&) () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#19 0x00007ffff726f4a2 in sycl::_V1::detail::Scheduler::addCG(std::unique_ptr<sycl::_V1::detail::CG, std::default_delete<sycl::_V1::detail::CG> >, std::shared_ptr<sycl::_V1::detail::queue_impl>) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#20 0x00007ffff72a71b2 in sycl::_V1::handler::finalize() () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#21 0x00007ffff72d487a in void sycl::_V1::detail::queue_impl::finalizeHandler<sycl::_V1::handler>(sycl::_V1::handler&, sycl::_V1::detail::CG::CGTYPE const&, sycl::_V1::event&) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#22 0x00007ffff72d44f1 in sycl::_V1::detail::queue_impl::submit_impl(std::function<void (sycl::_V1::handler&)> const&, std::shared_ptr<sycl::_V1::detail::queue_impl> const&, std::shared_ptr<sycl::_V1::detail::queue_impl> const&, std::shared_ptr<sycl::_V1::detail::queue_impl> const&, sycl::_V1::detail::code_location const&, std::function<void (bool, bool, sycl::_V1::event&)> const*) ()
from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#23 0x00007ffff72d3945 in sycl::_V1::detail::queue_impl::submit(std::function<void (sycl::_V1::handler&)> const&, std::shared_ptr<sycl::_V1::detail::queue_impl> const&, sycl::_V1::detail::code_location const&, std::function<void (bool, bool, sycl::_V1::event&)> const*) () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#24 0x00007ffff72d3905 in sycl::_V1::queue::submit_impl(std::function<void (sycl::_V1::handler&)>, sycl::_V1::detail::code_location const&) () from /sw/oneapi/compiler/2023.0.0/linux/lib/libsycl.so.6
#25 0x0000000000403e72 in submit<(lambda at /home/aperro/cache/oneAPI-samples-2023.0.0/DirectProgramming/DPC++/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp:72:14)> (this=0x7fffffffc838, CGF=...,
CodeLoc=...) at /sw/oneapi/compiler/2023.0.0/linux/bin-llvm/../include/sycl/queue.hpp:318
#26 VectorAdd(sycl::_V1::queue&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> > const&, std::vector<int, std::allocator<int> >&) (q=..., a_vector=..., b_vector=...,
sum_parallel=...) at /home/aperro/cache/oneAPI-samples-2023.0.0/DirectProgramming/DPC++/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp:72
#27 0x0000000000404b11 in main (argc=<optimized out>, argv=<optimized out>) at /home/aperro/cache/oneAPI-samples-2023.0.0/DirectProgramming/DPC++/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp:141

 

This is the sycl-ls output:

[opencl:acc:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device 1.2 [2022.15.12.0.01_081451]
[opencl:cpu:1] Intel(R) OpenCL, Intel(R) Xeon(R) CPU E5-2650 v4 @ 2.20GHz 3.0 [2022.15.12.0.01_081451]
 

I am using openAPI base toolkit 2023.0.0 and openAPI examples 2023.0.0 

Labels (1)
0 Kudos
6 Replies
BoonBengT_Intel
Moderator
1,673 Views

Hi @alperro,


Thank you for posting in Intel community forum and hope all is well.

May I know which vector_add example are you referring to? (Please do provide the link if possible)

And are you running the example locally or in Intel platform?

Hope to hear from you soon.


Best Wishes

BB


0 Kudos
BoonBengT_Intel
Moderator
1,619 Views

Hi @alperro,


Good day, just following up on the previous clarification.

By any chances did you managed to look into the it?

Hope to hear from you soon.


Best Wishes

BB


0 Kudos
alperro
Beginner
1,608 Views

Hello Boon Beng,

 

I was able to avoid the issue by using a different machine.
The broken configuration was using CentOS7 with  Xeon E5-2650 v4.
The working configuration is using CentOS8 Stream with Xeon Gold 6326.

 

 

This is the link to the example in question

https://github.com/oneapi-src/oneAPI-samples/tree/2023.0.0/DirectProgramming/DPC%2B%2B/DenseLinearAlgebra/vector-add

 

Best,

Alberto

0 Kudos
BoonBengT_Intel
Moderator
1,583 Views

Hi @alperro,


Noted with thanks on sharing of the workaround for the situation.

Seems to be some hardware or platform issues which might case the error.

Unfortunately the mention OS it was not part of the recommended/supported list. (references link here: https://www.intel.com/content/www/us/en/developer/articles/system-requirements/intel-oneapi-base-toolkit-system-requirements.html)


However definitely will be bringing this back to our internal team for further exploration for opportunities.

Good to know that you managed to overcome the situation, please do let us know if there if further clarification needed for this is situation.

Hope to hear from you soon.


Best Wishes

BB


0 Kudos
BoonBengT_Intel
Moderator
1,521 Views

Hi @alperro,


Greetings, just checking in to see if there is any further doubts in regards to this matter.

Hope your doubts have been clarified.


Best Wishes

BB


0 Kudos
BoonBengT_Intel
Moderator
1,497 Views

Hi @alperro,


Greetings, as we do not receive any further clarification/updates on the matter, hence would assume challenge are overcome. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. For new queries, please feel free to open a new thread and we will be right with you. Pleasure having you here.


Best Wishes

BB


p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 4/5 survey.


0 Kudos
Reply