[Beignet] beignet git with llvm 3.7.1 + haswell (gen 7.5) failing

He Junyan junyan.he at inbox.com
Fri Jan 22 05:21:12 PST 2016


I think the correct steps to use FP64 should be:
1. Query the device using clGetDeviceInfo with CL_DEVICE_EXTENSIONS.
2. Check whether the extension string has "cl_khr_fp64"
3. If so, then you can enable DOUBLE support with
     #pragma OPENCL EXTENSION cl_khr_fp64 : enable
You can refer to the cl_check_double helper function in utests.

Haswell really could use double before, but not a full feature one.
Because of the hardware's limitation, the precision of double is
even lower than the float on PRE-HASWELL platforms. And double
division is also unavailable on HASWELL. So we decide to totally
disable double support on PRE-BDW platforms.

The better user experience is on our plan. We really should give
more useful prompt information and handle compiling error more
decently, rather than a simple ASSERT.


On Thu, Jan 21, 2016 at 06:50:36AM +0000, Song, Ruiling wrote:
> Date: Thu, 21 Jan 2016 06:50:36 +0000
> From: "Song, Ruiling" <ruiling.song at intel.com>
> To: Paulo Dias <paulo.miguel.dias at gmail.com>, "He, Junyan"
>  <junyan.he at intel.com>
> Cc: "beignet at lists.freedesktop.org" <beignet at lists.freedesktop.org>
> Subject: Re: [Beignet] beignet git with llvm 3.7.1 + haswell (gen 7.5)
>  failing
> 
> Yes, I agree with you. But at least as I know haswell hardware does not support double well.
> 
> Hi Junyan,
> 
> Can we handle it graciously? Do you have any idea?
> 
> Thanks!
> Ruiling
> 
> From: Paulo Dias [mailto:paulo.miguel.dias at gmail.com]
> Sent: Wednesday, January 20, 2016 8:37 PM
> To: Song, Ruiling <ruiling.song at intel.com>
> Cc: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] beignet git with llvm 3.7.1 + haswell (gen 7.5) failing
> 
> it does, but beignet should fail graciously with an error message then, not segfault. and it used to work even with haswell.
> 
> groo at hydra:~/devel/opencl/tools-master$ ./cl-demo 10000 10
> Choose platform:
> [0] Intel
> [1] Mesa
> Enter choice: 0
> Choose device:
> [0] Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile
> Enter choice: 0
> ---------------------------------------------------------------------
> NAME: Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile
> VENDOR: Intel
> PROFILE: FULL_PROFILE
> VERSION: OpenCL 1.2 beignet 1.2
> 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_image2d_from_buffer cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_motion_estimation
> DRIVER_VERSION: 1.2
> 
> Type: GPU
> EXECUTION_CAPABILITIES: Kernel Native
> GLOBAL_MEM_CACHE_TYPE: Read-Write (2)
> CL_DEVICE_LOCAL_MEM_TYPE: Global (2)
> SINGLE_FP_CONFIG: 0x6
> QUEUE_PROPERTIES: 0x2
> 
> VENDOR_ID: 32902
> MAX_COMPUTE_UNITS: 20
> MAX_WORK_ITEM_DIMENSIONS: 3
> MAX_WORK_GROUP_SIZE: 512
> PREFERRED_VECTOR_WIDTH_CHAR: 16
> PREFERRED_VECTOR_WIDTH_SHORT: 8
> PREFERRED_VECTOR_WIDTH_INT: 4
> PREFERRED_VECTOR_WIDTH_LONG: 2
> PREFERRED_VECTOR_WIDTH_FLOAT: 4
> PREFERRED_VECTOR_WIDTH_DOUBLE: 0
> MAX_CLOCK_FREQUENCY: 1000
> ADDRESS_BITS: 32
> MAX_MEM_ALLOC_SIZE: 1610612736
> IMAGE_SUPPORT: 1
> MAX_READ_IMAGE_ARGS: 128
> MAX_WRITE_IMAGE_ARGS: 8
> IMAGE2D_MAX_WIDTH: 8192
> IMAGE2D_MAX_HEIGHT: 8192
> IMAGE3D_MAX_WIDTH: 8192
> IMAGE3D_MAX_HEIGHT: 8192
> IMAGE3D_MAX_DEPTH: 2048
> MAX_SAMPLERS: 16
> MAX_PARAMETER_SIZE: 1024
> MEM_BASE_ADDR_ALIGN: 1024
> MIN_DATA_TYPE_ALIGN_SIZE: 128
> GLOBAL_MEM_CACHELINE_SIZE: 64
> GLOBAL_MEM_CACHE_SIZE: 8192
> GLOBAL_MEM_SIZE: 2147483648
> MAX_CONSTANT_BUFFER_SIZE: 134217728
> MAX_CONSTANT_ARGS: 8
> LOCAL_MEM_SIZE: 65536
> ERROR_CORRECTION_SUPPORT: 0
> PROFILING_TIMER_RESOLUTION: 80
> ENDIAN_LITTLE: 1
> AVAILABLE: 1
> COMPILER_AVAILABLE: 1
> MAX_WORK_GROUP_SIZES: 512 512 512
> ---------------------------------------------------------------------
> ASSERTION FAILED: 0
>   at file /build/beignet-4N2m2_/beignet-1.2.0~git201601200931.13f504c~padoka0/backend/src/backend/gen_encoder.cpp, function virtual void gbe::GenEncoder::handleDouble(gbe::GenEncoder*, uint32_t, gbe::GenRegister, gbe::GenRegister, gbe::GenRegister), line 634
> Trace/breakpoint trap (core dumped)
> 
> | Paulo Dias
> | paulo.miguel.dias at gmail.com<mailto:paulo.miguel.dias at gmail.com>
> 
> Tempora mutantur, nos et mutamur in illis.
> 
> On Mon, Jan 18, 2016 at 12:10 AM, Song, Ruiling <ruiling.song at intel.com<mailto:ruiling.song at intel.com>> wrote:
> 
> Haswell does not support double data type, and Beignet does not expose the extension. Looks like cl-demo use double data type?
> 
> 
> 
> Thanks!
> 
> Ruiling
> 
> 
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org<mailto:beignet-bounces at lists.freedesktop.org>] On Behalf Of Paulo Dias
> Sent: Saturday, January 16, 2016 5:25 AM
> To: beignet at lists.freedesktop.org<mailto:beignet at lists.freedesktop.org>
> Subject: [Beignet] beignet git with llvm 3.7.1 + haswell (gen 7.5) failing
> 
> hi all, beignet git compiled with llvm 3.7.1 will fail in a haswell (gen 7.5).
> 
> trace below:
> 
> groo at hydra:~/devel/opencl/tools-master$ gdb --args cl-demo 10000 10
> GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
> Copyright (C) 2015 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> and "show warranty" for details.
> This GDB was configured as "x86_64-linux-gnu".
> Type "show configuration" for configuration details.
> For bug reporting instructions, please see:
> <http://www.gnu.org/software/gdb/bugs/>.
> Find the GDB manual and other documentation resources online at:
> <http://www.gnu.org/software/gdb/documentation/>.
> For help, type "help".
> Type "apropos word" to search for commands related to "word"...
> Reading symbols from cl-demo...(no debugging symbols found)...done.
> (gdb) run
> Starting program: /home/groo/devel/opencl/tools-master/cl-demo 10000 10
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
> [New Thread 0x7fffed4d0700 (LWP 6204)]
> [New Thread 0x7fffecccf700 (LWP 6205)]
> [New Thread 0x7fffec4ce700 (LWP 6206)]
> [New Thread 0x7fffebccd700 (LWP 6207)]
> [New Thread 0x7fffeb4cc700 (LWP 6208)]
> [Thread 0x7fffeb4cc700 (LWP 6208) exited]
> [Thread 0x7fffebccd700 (LWP 6207) exited]
> [Thread 0x7fffec4ce700 (LWP 6206) exited]
> [Thread 0x7fffecccf700 (LWP 6205) exited]
> Choose platform:
> [0] Intel
> [1] Mesa
> Enter choice: 0
> Choose device:
> [0] Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile
> Enter choice: 0
> ---------------------------------------------------------------------
> NAME: Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile
> VENDOR: Intel
> PROFILE: FULL_PROFILE
> VERSION: OpenCL 1.2 beignet 1.2
> 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_image2d_from_buffer cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_motion_estimation
> DRIVER_VERSION: 1.2
> 
> Type: GPU
> EXECUTION_CAPABILITIES: Kernel Native
> GLOBAL_MEM_CACHE_TYPE: Read-Write (2)
> CL_DEVICE_LOCAL_MEM_TYPE: Global (2)
> SINGLE_FP_CONFIG: 0x6
> QUEUE_PROPERTIES: 0x2
> 
> VENDOR_ID: 32902
> MAX_COMPUTE_UNITS: 20
> MAX_WORK_ITEM_DIMENSIONS: 3
> MAX_WORK_GROUP_SIZE: 512
> PREFERRED_VECTOR_WIDTH_CHAR: 16
> PREFERRED_VECTOR_WIDTH_SHORT: 8
> PREFERRED_VECTOR_WIDTH_INT: 4
> PREFERRED_VECTOR_WIDTH_LONG: 2
> PREFERRED_VECTOR_WIDTH_FLOAT: 4
> PREFERRED_VECTOR_WIDTH_DOUBLE: 0
> MAX_CLOCK_FREQUENCY: 1000
> ADDRESS_BITS: 32
> MAX_MEM_ALLOC_SIZE: 1610612736
> IMAGE_SUPPORT: 1
> MAX_READ_IMAGE_ARGS: 128
> MAX_WRITE_IMAGE_ARGS: 8
> IMAGE2D_MAX_WIDTH: 8192
> IMAGE2D_MAX_HEIGHT: 8192
> IMAGE3D_MAX_WIDTH: 8192
> IMAGE3D_MAX_HEIGHT: 8192
> IMAGE3D_MAX_DEPTH: 2048
> MAX_SAMPLERS: 16
> MAX_PARAMETER_SIZE: 1024
> MEM_BASE_ADDR_ALIGN: 1024
> MIN_DATA_TYPE_ALIGN_SIZE: 128
> GLOBAL_MEM_CACHELINE_SIZE: 64
> GLOBAL_MEM_CACHE_SIZE: 8192
> GLOBAL_MEM_SIZE: 2147483648<tel:2147483648>
> MAX_CONSTANT_BUFFER_SIZE: 134217728
> MAX_CONSTANT_ARGS: 8
> LOCAL_MEM_SIZE: 65536
> ERROR_CORRECTION_SUPPORT: 0
> PROFILING_TIMER_RESOLUTION: 80
> ENDIAN_LITTLE: 1
> AVAILABLE: 1
> COMPILER_AVAILABLE: 1
> MAX_WORK_GROUP_SIZES: 512 512 512
> ---------------------------------------------------------------------
> ASSERTION FAILED: 0
>   at file /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/gen_encoder.cpp, function virtual void gbe::GenEncoder::handleDouble(gbe::GenEncoder*, uint32_t, gbe::GenRegister, gbe::GenRegister, gbe::GenRegister), line 634
> 
> Program received signal SIGTRAP, Trace/breakpoint trap.
> gbe::onFailedAssertion (msg=<optimized out>, file=<optimized out>, fn=<optimized out>, line=<optimized out>) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/sys/assert.cpp:76
> 76      /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/sys/assert.cpp: No such file or directory.
> (gdb) bt
> #0  gbe::onFailedAssertion (msg=<optimized out>, file=<optimized out>, fn=<optimized out>, line=<optimized out>) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/sys/assert.cpp:76
> #1  0x00007ffff397a337 in gbe::GenEncoder::ADD (this=<optimized out>, dest=..., src0=..., src1=...) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/gen_encoder.cpp:817
> #2  0x00007ffff39451d6 in gbe::GenContext::emitBinaryInstruction (this=0x7524b0, insn=...) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/gen_context.cpp:768
> #3  0x00007ffff39655ac in gbe::GenContext::emitInstructionStream (this=this at entry=0x7524b0) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/./backend/gen_insn_selection.hxx:80
> #4  0x00007ffff3965c9e in gbe::GenContext::emitCode (this=0x7524b0) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/gen_context.cpp:3215
> #5  0x00007ffff384c2c2 in gbe::Context::compileKernel (this=this at entry=0x7524b0) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/context.cpp:360
> #6  0x00007ffff3970cdb in gbe::GenProgram::compileKernel (this=<optimized out>, unit=..., name="sum", relaxMath=<optimized out>, profiling=<optimized out>)
>     at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/gen_program.cpp:194
> #7  0x00007ffff3850246 in gbe::Program::buildFromUnit (this=this at entry=0xc25960, unit=..., error="") at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/program.cpp:174
> #8  0x00007ffff38508f9 in gbe::Program::buildFromLLVMFile (this=this at entry=0xc25960, fileName=fileName at entry=0x0, module=module at entry=0xc0ecb0, error="", optLevel=optLevel at entry=1)
>     at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/program.cpp:152
> #9  0x00007ffff3971403 in gbe::genProgramNewFromLLVM (deviceID=2582, fileName=0x0, module=0xc0ecb0, llvm_ctx=0xc0e5e0, asm_file_name=<optimized out>, stringSize=1000, err=0xc1ca30 "", errSize=0xc13520, optLevel=1, options=0x0)
>     at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/gen_program.cpp:421
> #10 0x00007ffff385c5c3 in gbe::programNewFromSource (deviceID=2582, source=<optimized out>, stringSize=1000, options=0x0, err=0xc1ca30 "", errSize=0xc13520)
>     at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/backend/src/backend/program.cpp:896
> #11 0x00007ffff6f81270 in cl_program_build (p=p at entry=0xc13490, options=0x0) at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/src/cl_program.c:576
> #12 0x00007ffff6f784a6 in clBuildProgram (program=0xc13490, num_devices=<optimized out>, device_list=<optimized out>, options=<optimized out>, pfn_notify=0x0, user_data=0x0)
>     at /build/beignet-_o5G2i/beignet-1.2.0~git201601091733.fc410ee~padoka0/src/cl_api.c:956
> #13 0x000000000040376d in kernel_from_string ()
> #14 0x00000000004016f7 in main ()
> 
> | Paulo Dias
> | paulo.miguel.dias at gmail.com<mailto:paulo.miguel.dias at gmail.com>
> 
> Tempora mutantur, nos et mutamur in illis.
> 

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





More information about the Beignet mailing list