[Beignet] Sample program crash with beignet 0.3 on IVB

Zhigang Gong zhigang.gong at linux.intel.com
Tue Nov 26 17:59:08 PST 2013


The root cause of this is that the cl_khr_gl_sharing extension depends
on a specific mesa version:

92e6260c1960f78692417433206c38170ec1a625

You can find your mesa source code tree. It should be in ${HOME}/mesa.
Or you can check the CMakeCache.txt in your build directory to find
the following statement:

//Set to 1 if mesa source code is found, 0 otherwise
MESA_SOURCE_FOUND:STRING=1

//The mesa source directory which is needed for cl_khr_gl_sharing.
MESA_SOURCE_PREFIX:PATH=dir-to-your-mesa-source-code

You can enter the above mesa source code directory and checkout the above specific
version and rebuild and install mesa, then build beignet again.

If you don't want to use cl_khr_gl_sharing, you can just simply rename that
mesa source code directory to another name or use ccmake to set MESA_SOURCE_FOUND
to zero, then configure and regenerate the build files.
 MESA_SOURCE_FOUND                0


On Tue, Nov 26, 2013 at 11:11:16PM +0100, Robert Jobbagy wrote:
> Sry, It's Ubuntu package bug, I reported it :
> https://bugs.launchpad.net/ubuntu/+source/beignet/+bug/1255323
> 
> I tried master branch but I gave this knew error :
> 
> http://lists.freedesktop.org/archives/beignet/2013-August/001302.html
> 
> and I switch to opencl 1.2 branch and I gave this :
> 
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:
> In function ‘intel_get_gl_obj_from_texture’:
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:103:38:
> error: dereferencing pointer to incomplete type
>     obj = __mesa_lookup_texture(&intel->ctx, texture);
>                                       ^
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:109:42:
> error: dereferencing pointer to incomplete type
>     __mesa_test_texobj_completeness(&intel->ctx, obj);
>                                           ^
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:
> In function ‘intelAcquireTexture’:
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:145:4:
> warning: passing argument 2 of ‘intel_get_gl_obj_from_texture’ from
> incompatible pointer type [enabled by default]
>     obj = intel_get_gl_obj_from_texture(driver, intel, target, level,
> texture, face);
>     ^
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:96:1:
> note: expected ‘struct intel_context *’ but argument is of type ‘struct
> intel_context *’
>  intel_get_gl_obj_from_texture(void *driver,
>  ^
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:150:4:
> warning: passing argument 2 of ‘intel_setup_cl_region_from_mipmap_tree’
> from incompatible pointer type [enabled by default]
>     return intel_setup_cl_region_from_mipmap_tree(driver, intel, iobj->mt,
> level, 0, region);
>     ^
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:52:1:
> note: expected ‘struct intel_context *’ but argument is of type ‘struct
> intel_context *’
>  intel_setup_cl_region_from_mipmap_tree(void *driver,
>  ^
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:
> In function ‘intelReleaseTexture’:
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:163:4:
> warning: passing argument 2 of ‘intel_get_gl_obj_from_texture’ from
> incompatible pointer type [enabled by default]
>     obj = intel_get_gl_obj_from_texture(driver, intel, target, level,
> texture, face);
>     ^
> /home/evil85/Development/beignet_opencl_1_2/src/intel/intel_dri_resource_sharing.c:96:1:
> note: expected ‘struct intel_context *’ but argument is of type ‘struct
> intel_context *’
>  intel_get_gl_obj_from_texture(void *driver,
>  ^
> make[2]: *** [src/CMakeFiles/cl.dir/intel/intel_dri_resource_sharing.c.o]
> Error 1
> make[1]: *** [src/CMakeFiles/cl.dir/all] Error 2
> make: *** [all] Error 2
> 
> 
> what is missing ?
> 
> I used this dependencies packages :
> 
> libdrm-dev
>  2.4.46+git20130910.58d00888-0ubuntu0sarvatt
> libdrm-intel1:amd64
> 2.4.46+git20130910.58d00888-0ubuntu0sarvatt
> 
> llvm 3.2 and clang 3.2
> 
> and mesa 9.2.1
> 
> Thanks.
> 
> 
> 2013/11/26 Robert Jobbagy <jobbagy.robert at gmail.com>
> 
> > Hi guys,
> >
> > I use Ubuntu 13.10 with beignet 0.3 on IVB ( Intel HD 4000 ) and I used
> > this opencl sample program :
> > https://codeload.github.com/hpc12/tools/tar.gz/master
> > from http://wiki.tiker.net/OpenCLHowTo
> > and gave this error : fatal error: malformed or corrupted PCH file:
> > 'could not find file
> > '/build/buildd/beignet-0.3/obj-x86_64-linux-gnu/backend/src/ocl_stdlib.h'
> > referenced by AST file' 1 error generated. *** build of 'sum' on 'Intel HD
> > Graphics Family' said: *** (end of message) *** 'clBuildProgram' in
> > 'cl-helper.c' on line 470 failed with error 'invalid program'. Aborted
> > (core dumped)
> >
> >
> > What can I do ?
> >
> > Thanks your time.
> > --
> > Best Regards,
> >
> > Robert
> >
> 
> 
> 
> -- 
> Best Regards,
> 
> Robert

> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet



More information about the Beignet mailing list