Weird clinfo ouput @ FreeBSD-11.0/Intel GPU

Submitted by Rebecca N. Palmer on Oct. 18, 2016, 6:58 a.m.

Details

Message ID 7b462caf-2985-d2b8-c21c-c4f80e13592f@zoho.com
State New
Headers show
Series "Weird clinfo ouput @ FreeBSD-11.0/Intel GPU" ( rev: 1 ) in Beignet

Not browsing as part of any series.

Commit Message

Rebecca N. Palmer Oct. 18, 2016, 6:58 a.m.
> builtin_kernel_block_motion_estimate_intel()    [SUCCESS]
> runtime_climage_from_boname()Unresolved symbol:
> _Z22__gen_ocl_write_imagef11ocl_image2dDv2_iDv4_f
> Aborting...

That message is from backend/src/llvm/llvm_gen_backend.hpp:97, and means 
it can't find that function (in its internal list, not the actual 
library files): possibly a name demangling problem?

To find out, try this:

Patch hide | download patch | download mbox

--- a/backend/src/llvm/llvm_gen_backend.hpp
+++ b/backend/src/llvm/llvm_gen_backend.hpp
@@ -80,12 +80,13 @@  namespace gbe
     gbe::map<std::string, OCLInstrinsic> map;
     OCLInstrinsic find(const std::string symbol) const {
       auto it = map.find(symbol);
+      std::string realFnName, stripName;
+      int status;

       if (it == map.end()) {
-        int status;
         char *realName = abi::__cxa_demangle(symbol.c_str(), NULL, NULL, &status);
         if (status == 0) {
-          std::string realFnName(realName), stripName;
+          realFnName=std::string(realName);
           stripName = realFnName.substr(0, realFnName.find("("));
           it = map.find(stripName);
         }
@@ -94,7 +95,7 @@  namespace gbe
       // FIXME, should create a complete error reporting mechanism
       // when found error in beignet managed passes including Gen pass.
       if (it == map.end()) {
-        std::cerr << "Unresolved symbol: " << symbol << std::endl;
+        std::cerr << "Unresolved symbol: " << symbol << " " << realFnName << " " << stripName << " " << status << std::endl;
         std::cerr << "Aborting..." << std::endl;
         return GEN_OCL_NOT_FOUND;
       }

Comments

> possibly a name demangling problem?
> To find out, try this

The result is:


platform number 1
platform_profile "FULL_PROFILE"
platform_name "Intel Gen OCL Driver"
platform_vendor "Intel"
platform_version "OpenCL 1.2 beignet 1.2"
platform_extensions "cl_khr_global_int32_base_atomics
cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics
cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store
cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_spir cl_khr_icd
cl_intel_accelerator cl_intel_motion_estimation cl_intel_subgroups"
Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (3, 7, 5)
See README.md or http://www.freedesktop.org/wiki/Software/Beignet/
Beignet: Warning - overriding self-test failure
device_profile "FULL_PROFILE"
device_name "Intel(R) HD Graphics Haswell GT1 Server"
device_vendor "Intel"
device_version "OpenCL 1.2 beignet 1.2"
device_extensions "cl_khr_global_int32_base_atomics
cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics
cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store
cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_spir cl_khr_icd
cl_intel_accelerator cl_intel_motion_estimation cl_intel_subgroups"
device_opencl_c_version "OpenCL C 1.2 beignet 1.2"
23 image formats are supported
[CL_R CL_UNORM_INT8]
[CL_R CL_UNORM_INT16]
[CL_R CL_SIGNED_INT8]
[CL_R CL_SIGNED_INT16]
[CL_R CL_SIGNED_INT32]
[CL_R CL_UNSIGNED_INT8]
[CL_R CL_UNSIGNED_INT16]
[CL_R CL_UNSIGNED_INT32]
[CL_R CL_HALF_FLOAT]
[CL_R CL_FLOAT]
[CL_RG CL_UNORM_INT8]
[CL_RG CL_UNSIGNED_INT8]
[CL_RGBA CL_UNORM_INT8]
[CL_RGBA CL_UNORM_INT16]
[CL_RGBA CL_SIGNED_INT8]
[CL_RGBA CL_SIGNED_INT16]
[CL_RGBA CL_SIGNED_INT32]
[CL_RGBA CL_UNSIGNED_INT8]
[CL_RGBA CL_UNSIGNED_INT16]
[CL_RGBA CL_UNSIGNED_INT32]
[CL_RGBA CL_HALF_FLOAT]
[CL_RGBA CL_FLOAT]
[CL_BGRA CL_UNORM_INT8]
builtin_kernel_block_motion_estimate_intel()    [SUCCESS]
runtime_climage_from_boname() Can't open Display, skipping.
    [SUCCESS]
compiler_overflow_add_ulong4()    [SUCCESS]
compiler_overflow_add_uint4()    [SUCCESS]
compiler_overflow_add_ushort4()    [SUCCESS]
compiler_overflow_add_uchar4()    [SUCCESS]
compiler_overflow_sub_uint4()    [SUCCESS]
compiler_bsort()    [SUCCESS]
compiler_math_3op_float()    [SUCCESS]
compiler_math_3op_half()No cl_khr_fp16, Skip!    [SUCCESS]
compiler_mix()Unresolved symbol: _Z13__gen_ocl_lrpfff   8
Aborting...
Unresolved symbol: _Z13__gen_ocl_lrpfff   8
Aborting...
    [FAILED]
    Error: error calling clBuildProgram with error CL_BUILD_PROGRAM_FAILURE

  at file
/usr/ports/lang/beignet/work/Beignet-1.2.0-Source/utests/utest_helper.cpp,
function cl_kernel_init, line 267
builtin_local_linear_id()Not OpenCL 2.0 device, Beignet extension test!
[SUCCESS]
builtin_global_linear_id()Not OpenCL 2.0 device, Beignet extension test!
[SUCCESS]
compiler_sub_group_shuffle_xor()    [SUCCESS]
compiler_sub_group_shuffle_up()    [SUCCESS]
compiler_sub_group_shuffle_down()    [SUCCESS]
compiler_sub_group_shuffle()    [SUCCESS]
compiler_get_sub_group_local_id()    [SUCCESS]
compiler_get_max_sub_group_size()    [SUCCESS]
runtime_use_host_ptr_image()    [SUCCESS]
runtime_alloc_host_ptr_buffer()    [SUCCESS]
runtime_use_host_ptr_buffer()    [SUCCESS]
vload_test_uchar()    [SUCCESS]
vload_test_char()    [SUCCESS]
vload_test_ushort()    [SUCCESS]
vload_test_short()    [SUCCESS]
vload_test_uint()    [SUCCESS]
vload_test_int()    [SUCCESS]
vload_test_float()    [SUCCESS]
compiler_assignment_operation_in_if()    [SUCCESS]
compiler_constant_expr()    [SUCCESS]
compiler_fill_image_2d_array()    [SUCCESS]
compiler_fill_image_1d_array()    [SUCCESS]
compare_image_2d_and_1d_array()Unresolved symbol: _Z14__gen_ocl_fminff   8
Aborting...
Unresolved symbol: _Z14__gen_ocl_fmaxff   8
Aborting...
Unresolved symbol: _Z14__gen_ocl_fminff   8
Aborting...
Unresolved symbol: _Z14__gen_ocl_fmaxff   8
Aborting...
    [FAILED]
    Error: error calling clBuildProgram with error CL_BUILD_PROGRAM_FAILURE

  at file
/usr/ports/lang/beignet/work/Beignet-1.2.0-Source/utests/utest_helper.cpp,
function cl_kernel_init, line 267
image_from_buffer()    [SUCCESS]
image_1D_buffer()    [SUCCESS]
builtin_kernel_max_global_size()    [SUCCESS]
enqueue_fill_buf()    [SUCCESS]
test_printf()Warning: Have a int parameter for %f like specifier, take care
of it


And then it hung the OS.

--
Igor
That looks like abi::__cxa_demangle is sometimes failing completely
(and possibly inconsistently, given that it's failing on a different
symbol this time).  Given that it only happens on FreeBSD, possibly
a libc++ (LLVM) vs libstdc++ (GCC) issue??