Created attachment 123255 [details]
Haswell GT2 (4770)
All compiled with gcc 5.3.1 (20160412) + debug flag / cmake option.
Running the attached source yields
#0 0x0000000000000000 in ?? ()
#1 0x00007ffff546d5b2 in cmrt_destroy_device (device=0x7ffff56a2480 <intel_hsw_gt2_device>) at beignet/src/cl_cmrt.cpp:101
#2 0x00007ffff54314fd in clReleaseDevice (device=0x7ffff56a2480 <intel_hsw_gt2_device>) at beignet/src/cl_api.c:282
#3 0x00007ffff79ab247 in clReleaseDevice (device=0x7ffff56a2480 <intel_hsw_gt2_device>) at ocl_icd_loader_gen.c:1154
#4 0x0000555555555840 in cl::detail::ReferenceHandler<_cl_device_id*>::release (device=0x7ffff56a2480 <intel_hsw_gt2_device>) at /usr/include/CL/cl.hpp:1573
#5 0x0000555555555ae8 in cl::detail::Wrapper<_cl_device_id*>::release (this=0x7fffffffcfa0) at /usr/include/CL/cl.hpp:1861
#6 0x0000555555555987 in cl::detail::Wrapper<_cl_device_id*>::~Wrapper (this=0x7fffffffcfa0, __in_chrg=<optimized out>) at /usr/include/CL/cl.hpp:1810
#7 0x0000555555555ff7 in cl::Device::~Device (this=0x7fffffffcfa0, __in_chrg=<optimized out>) at /usr/include/CL/cl.hpp:1907
#8 0x00005555555554bb in main () at test.cpp:14
No segfault with intel-opencl-runtime 16.1.
Hardly relevant but: I patched the kernel with the shared local memory patch (the variable name is no longer "flags" but "dispatch_flags").
Apart from the patch, the freedesktop wiki page for Beignet might also need an update since it mentions that the cause was supposed to be "fixed in Linux 4.2", but that doesn't appear to actually be the case?
After Linux 4.2, kernel enable ppgtt by default and will set the secure flag after command parser, so needn't this patch.
Can you pass all beignet utest without shared local memory patch?
Created attachment 123295 [details]
Seems the patch indeed makes no difference anymore. Attached is the utest log – all pass except for runtime_cmrt.
Alright, it's a cmrt issue. Recompiled beignet with cmrt 1.0.5 rather than git (d'uh) and it seems to work.
If the cmrt present at beignet's compilation has this commit (a small change to cmrt's pkgconfig file) applied, the segfault will occur. IOW, if it was reverted before compilation no crash occurs.
No apparent effect if beignet is run afterwards with a cmrt that has it applied.