<p dir="ltr">I'll check it tonight.<br>
--<br>
-Igor Gnatenko</p>
<div class="gmail_quote">On Sep 1, 2014 4:59 PM, "David Liebman" <<a href="mailto:david.c.liebman@gmail.com">david.c.liebman@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I now have the patched version installed on my laptop. I ran the 'sum' program and it didn't work. I will include the output of the 'sum' program below, but it is the same as in previous emails. One thing to note about the 'sum' program is that it does ask for the user to input which platform you're using (iow, 'Intel(R) HD Graphics IvyBridge M GT2').<br>

<br>
I also tried the beignet 'utest' folder's 'utest_run' program. My results were terrible. Only 25 out of 665 passed.<br>
<br>
Finally I even tried my PyOpenCL program which failed as it has been doing all along.<br>
<br>
I think there is still a problem. I am willing to try most anything to see if I can get this to work. My kernel is 3.16.1-301.fc21.x86_64. I saw on the beignet web site that if you're using 4th generation intel products that you'd need to install a special patch for your kernel. Do I need to consider doing something like that? My processor is described as 'Intel Core i5-3210M CPU' and the OS reports the GPU as 'Intel Ivybridge Mobile'.<br>

<br>
Below is some test program output:<br>
<br>
$ ./cl-demo 1000 10<br>
Choose platform:<br>
[0] Intel<br>
Enter choice: 0<br>
Choose device:<br>
[0] Intel(R) HD Graphics IvyBridge M GT2<br>
Enter choice: 0<br>
------------------------------<u></u>------------------------------<u></u>---------<br>
NAME: Intel(R) HD Graphics IvyBridge M GT2<br>
VENDOR: Intel<br>
PROFILE: FULL_PROFILE<br>
VERSION: OpenCL 1.2 beignet 0.9<br>
EXTENSIONS: cl_khr_global_int32_base_<u></u>atomics cl_khr_global_int32_extended_<u></u>atomics cl_khr_local_int32_base_<u></u>atomics cl_khr_local_int32_extended_<u></u>atomics cl_khr_byte_addressable_store cl_khr_icd<br>

DRIVER_VERSION: 0.9<br>
<br>
Type: GPU<br>
EXECUTION_CAPABILITIES: Kernel Native<br>
GLOBAL_MEM_CACHE_TYPE: Read-Write (2)<br>
CL_DEVICE_LOCAL_MEM_TYPE: Global (2)<br>
SINGLE_FP_CONFIG: 0x6<br>
QUEUE_PROPERTIES: 0x2<br>
<br>
VENDOR_ID: 358<br>
MAX_COMPUTE_UNITS: 16<br>
MAX_WORK_ITEM_DIMENSIONS: 3<br>
MAX_WORK_GROUP_SIZE: 1024<br>
PREFERRED_VECTOR_WIDTH_CHAR: 8<br>
PREFERRED_VECTOR_WIDTH_SHORT: 8<br>
PREFERRED_VECTOR_WIDTH_INT: 4<br>
PREFERRED_VECTOR_WIDTH_LONG: 2<br>
PREFERRED_VECTOR_WIDTH_FLOAT: 4<br>
PREFERRED_VECTOR_WIDTH_DOUBLE: 0<br>
MAX_CLOCK_FREQUENCY: 1000<br>
ADDRESS_BITS: 32<br>
MAX_MEM_ALLOC_SIZE: 268435456<br>
IMAGE_SUPPORT: 1<br>
MAX_READ_IMAGE_ARGS: 128<br>
MAX_WRITE_IMAGE_ARGS: 8<br>
IMAGE2D_MAX_WIDTH: 8192<br>
IMAGE2D_MAX_HEIGHT: 8192<br>
IMAGE3D_MAX_WIDTH: 8192<br>
IMAGE3D_MAX_HEIGHT: 8192<br>
IMAGE3D_MAX_DEPTH: 2048<br>
MAX_SAMPLERS: 16<br>
MAX_PARAMETER_SIZE: 1024<br>
MEM_BASE_ADDR_ALIGN: 1024<br>
MIN_DATA_TYPE_ALIGN_SIZE: 128<br>
GLOBAL_MEM_CACHELINE_SIZE: 128<br>
GLOBAL_MEM_CACHE_SIZE: 8192<br>
GLOBAL_MEM_SIZE: 1073741824<br>
MAX_CONSTANT_BUFFER_SIZE: 524288<br>
MAX_CONSTANT_ARGS: 8<br>
LOCAL_MEM_SIZE: 65536<br>
ERROR_CORRECTION_SUPPORT: 0<br>
PROFILING_TIMER_RESOLUTION: 80<br>
ENDIAN_LITTLE: 1<br>
AVAILABLE: 1<br>
COMPILER_AVAILABLE: 1<br>
MAX_WORK_GROUP_SIZES: 1024 1024 1024<br>
------------------------------<u></u>------------------------------<u></u>---------<br>
*** Kernel compilation resulted in non-empty log message.<br>
*** Set environment variable CL_HELPER_PRINT_COMPILER_<u></u>OUTPUT=1 to see more.<br>
*** NOTE: this may include compiler warnings and other important messages<br>
***   about your code.<br>
*** Set CL_HELPER_NO_COMPILER_OUTPUT_<u></u>NAG=1 to disable this message.<br>
0.000039 s<br>
0.309593 GB/s<br>
BAD 1!<br>
Aborted (core dumped)<br>
<br>
<br>
$ cd ~/workspace/beignet/build/<u></u>utest<br>
$ . setenv.sh<br>
$ ./utest_run<br>
<br>
...(lots of output here)...<br>
<br>
summary:<br>
----------<br>
  total: 665<br>
  run: 665<br>
  pass: 25<br>
  fail: 638<br>
  pass rate: 0.040601<br>
<br>
$ ./arrays_opencl.py<br>
('a', array([ 0.], dtype=float32))<br>
('b', array([ 0.], dtype=float32))<br>
('c', array([ 0.], dtype=float32))<br>
1 0.063902<br>
('a', array([ 0.,  1.], dtype=float32))<br>
('b', array([ 0.,  1.], dtype=float32))<br>
('c', array([ 0.,  0.], dtype=float32))<br>
2 0.005048<br>
('a', array([ 0.,  1.,  2.], dtype=float32))<br>
('b', array([ 0.,  1.,  2.], dtype=float32))<br>
('c', array([ 0.,  0.,  0.], dtype=float32))<br>
3 0.004393<br>
<br>
<br>
<br>
On 08/31/2014 08:59 PM, Zhigang Gong wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I double checked and there is not anything missed in the patch. The patch<br>
is to fix a error related "undefined symbol xxx". It seems that you haven't<br>
met such an error from the beginning. I just doubt whether the PyOpenCL was<br>
really using beignet. My suggestion is to do something to check which<br>
platform/device the PyOpenCL is really using.<br>
<br>
You may also need to try to run the beignet's utest according to the README's<br>
instruction and see whether it work well.<br>
<br>
On Sat, Aug 30, 2014 at 01:13:30PM -0400, David Liebman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
maybe there's a change that you made that somehow didn't show up in<br>
the patch? An edited header file or another c file??? You obviously<br>
have a working copy. Your output is right. (!!)<br>
<br>
On 08/30/2014 10:25 AM, David Liebman wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
today I removed the beignet package from my system and downloaded<br>
the beignet source from this location:<br>
git://<a href="http://anongit.freedesktop.org/beignet" target="_blank">anongit.freedesktop.org/<u></u>beignet</a><br>
I applied the patch cleanly and built/installed the package.<br>
Everything went well while building it. Unfortunately the PyOpenCL<br>
program doesn't work any better with the patched version of<br>
Beignet.<br>
<br>
('a', array([ 0.], dtype=float32))<br>
('b', array([ 0.], dtype=float32))<br>
('c', array([ 0.], dtype=float32))<br>
1 0.010353<br>
('a', array([ 0.,  1.], dtype=float32))<br>
('b', array([ 0.,  1.], dtype=float32))<br>
('c', array([ 0.,  0.], dtype=float32))<br>
2 0.002883<br>
('a', array([ 0.,  1.,  2.], dtype=float32))<br>
('b', array([ 0.,  1.,  2.], dtype=float32))<br>
('c', array([ 0.,  0.,  0.], dtype=float32))<br>
3 0.002828<br>
<br>
I'm still getting zeros for 'c'. I recompiled PyOpenCL and tried<br>
again. No luck.<br>
<br>
On 08/30/2014 09:17 AM, Zhigang Gong wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This should be a generic requirement for some applications and I think<br>
PyOpenCL should be supported by<br>
beignet. This patch should be pushed into the upstream repo after got<br>
reviewed.  And if you can test it locally<br>
and let us know whether it fix your issue. It will be helpful.<br>
<br>
As to whether this could be merged into the fedora 21 release, I think<br>
Igor may have official answer.<br>
BTW, we are going to release a new fix version 0.9.3 in the coming<br>
week after LLVM 3.5 released.<br>
This patch should be included in 0.9.3.<br>
<br>
Igor, is it possible to get the 0.9.3  into the Fedora 21 release?<br>
<br>
Thanks,<br>
Zhigang Gong<br>
<br>
<br>
On Sat, Aug 30, 2014 at 8:46 PM, David Liebman<br>
<<a href="mailto:david.c.liebman@gmail.com" target="_blank">david.c.liebman@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 08/30/2014 04:47 AM, Zhigang Gong wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Just got some time to try you example with PyOpenCL. And it seems that<br>
PyOpenCL depends on<br>
a function which we haven't implemented. After apply the following<br>
patch, I can run your example<br>
correctly. The output is as below:<br>
gongzg@gongzg-MBA:~/Downloads$ python test.py<br>
('a', array([ 0.], dtype=float32))<br>
('b', array([ 0.], dtype=float32))<br>
('c', array([ 0.], dtype=float32))<br>
1 0.010514<br>
('a', array([ 0.,  1.], dtype=float32))<br>
('b', array([ 0.,  1.], dtype=float32))<br>
('c', array([ 0.,  2.], dtype=float32))<br>
2 0.004235<br>
('a', array([ 0.,  1.,  2.], dtype=float32))<br>
('b', array([ 0.,  1.,  2.], dtype=float32))<br>
('c', array([ 0.,  2.,  4.], dtype=float32))<br>
3 0.004166<br>
<br>
<br>
  From 81c9e5cf70ec01197833f8722f6aa1<u></u>6632a5f1a4 Mon Sep 17<br>
00:00:00 2001<br>
From: Zhigang Gong <<a href="mailto:zhigang.gong@linux.intel.com" target="_blank">zhigang.gong@linux.intel.com</a>><br>
Date: Sat, 30 Aug 2014 16:34:44 +0800<br>
Subject: [PATCH] Runtime: Implement<br>
clGetExtensionFunctionAddressF<u></u>orPlatform.<br>
<br>
It seems that this function is required for PyOpenCL.<br>
<br>
Signed-off-by: Zhigang Gong <<a href="mailto:zhigang.gong@linux.intel.com" target="_blank">zhigang.gong@linux.intel.com</a>><br>
---<br>
   src/cl_api.c     | 19 +++++++++++++++++--<br>
   src/cl_khr_icd.c |  2 +-<br>
   2 files changed, 18 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/src/cl_api.c b/src/cl_api.c<br>
index 177a7e8..b463128 100644<br>
--- a/src/cl_api.c<br>
+++ b/src/cl_api.c<br>
@@ -3156,8 +3156,8 @@ error:<br>
     if (strcmp(#x, func_name) == 0)       \<br>
       return (void *)x;<br>
<br>
-void*<br>
-<u></u>clGetExtensionFunctionAddress(<u></u>const char *func_name)<br>
+static void*<br>
+internal_<u></u>clGetExtensionFunctionAddress(<u></u>const char *func_name)<br>
   {<br>
     if (func_name == NULL)<br>
       return NULL;<br>
@@ -3180,6 +3180,21 @@ clGetExtensionFunctionAddress(<u></u>const char<br>
*func_name)<br>
     return NULL;<br>
   }<br>
<br>
+void*<br>
+<u></u>clGetExtensionFunctionAddress(<u></u>const char *func_name)<br>
+{<br>
+  return internal_<u></u>clGetExtensionFunctionAddress(<u></u>func_name);<br>
+}<br>
+<br>
+void*<br>
+<u></u>clGetExtensionFunctionAddressF<u></u>orPlatform(cl_platform_id platform,<br>
+                              const char *func_name)<br>
+{<br>
+  if (UNLIKELY(platform != NULL && platform != intel_platform))<br>
+    return NULL;<br>
+  return internal_<u></u>clGetExtensionFunctionAddress(<u></u>func_name);<br>
+}<br>
+<br>
   #undef EXTFUNC<br>
<br>
   cl_int<br>
diff --git a/src/cl_khr_icd.c b/src/cl_khr_icd.c<br>
index 6d49db0..50a0898 100644<br>
--- a/src/cl_khr_icd.c<br>
+++ b/src/cl_khr_icd.c<br>
@@ -154,7 +154,7 @@ struct _cl_icd_dispatch const<br>
cl_khr_icd_dispatch = {<br>
     clEnqueueMigrateMemObjects,<br>
     clEnqueueMarkerWithWaitList,<br>
     clEnqueueBarrierWithWaitList,<br>
-  CL_1_2_NOTYET(<u></u>clGetExtensionFunctionAddressF<u></u>orPlatform),<br>
+  clGetExtensionFunctionAddressF<u></u>orPlatform,<br>
     CL_GL_INTEROP(<u></u>clCreateFromGLTexture),<br>
     (void *) NULL,<br>
     (void *) NULL,<br>
</blockquote>
This is great. Thank you greatly for the patch. Now, should I<br>
be waiting for<br>
a new beignet package from fedora, or should I 'roll my own' and start<br>
compiling from source, adding the patch myself? I would love<br>
this to make it<br>
to the fedora 21 release, but I don't know what that would<br>
take. What is<br>
normal procedure? Is there a need for this method in the<br>
general community,<br>
or am I the only one who's interested in this feature?<br>
<br>
-Dave L.<br>
</blockquote></blockquote></blockquote>
______________________________<u></u>_________________<br>
Beignet mailing list<br>
<a href="mailto:Beignet@lists.freedesktop.org" target="_blank">Beignet@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/beignet" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/beignet</a><br>
</blockquote></blockquote>
<br>
______________________________<u></u>_________________<br>
Beignet mailing list<br>
<a href="mailto:Beignet@lists.freedesktop.org" target="_blank">Beignet@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/beignet" target="_blank">http://lists.freedesktop.org/<u></u>mailman/listinfo/beignet</a><br>
</blockquote></div>