<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Sean,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Yes, we support those apis (you can find what we support from src/cl_api.c), but it seems there are some problems with the src/cl_khr_icd<a name="_MailEndCompose">.c.
I will send a patch about this and you can just remove the macro before this apis in cl_khr_icd.c and maybe they can work with pyopencl.<o:p></o:p></a></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">I see that your final target is to run on Android, and we have tried to build on Android and you can find the patchset here
</span><a href="https://lists.freedesktop.org/archives/beignet/2015-November/006638.html"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">https://lists.freedesktop.org/archives/beignet/2015-November/006638.html</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Xiuli<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><a name="_____replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Sean Lynch [mailto:seanl@literati.org]
<br>
<b>Sent:</b> Tuesday, March 29, 2016 9:41 PM<br>
<b>To:</b> Pan, Xiuli <xiuli.pan@intel.com><br>
<b>Cc:</b> beignet@lists.freedesktop.org<br>
<b>Subject:</b> RE: [Beignet] clCreateFromGLTexture working?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p>Thanks for the pointer to that file. That's helpful. I'm using ocl-icd to load Beignet, because the Beignet package on Arch requires "libcl" and assumes you will be using an ICD loader. If I try to use Beignet's libcl.so directly, PyOpenCL fails to load
with missing symbols for clCreateGLBuffer and friends. I think all the extension checking happens at compile time, not runtime, but with ocl-icd one would obviously need some runtime checking.<o:p></o:p></p>
<p>My goal is realtime raytracing, so having to copy back and forth to main memory is not an attractive option. Is there any other option available to me besides cl_khr_gl_sharing? I'd prefer not to have to use GLSL, but that's starting to look like my only
option. It may well be the better approach if I want any hope of having my code eventually run on Android anyway.<o:p></o:p></p>
<p>The docs claim clCreateFromGLTexture works[1], so they should probably be updated:<o:p></o:p></p>
<p>"Currently, the working APIs are clCreateFromGLTexture,clCreateFromGLTexture2D."<o:p></o:p></p>
<p>[1] <a href="https://www.freedesktop.org/wiki/Software/Beignet/">https://www.freedesktop.org/wiki/Software/Beignet/</a><o:p></o:p></p>
<div>
<p class="MsoNormal">On Mar 28, 2016 23:28, "Pan, Xiuli" <<a href="mailto:xiuli.pan@intel.com">xiuli.pan@intel.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi Sean,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">It seems we do not support API clCreateFromGLTexture in beignet, you can get what api we support from
the file src/cl_khr_icd.c.</span><a name="m_-188448345257385386__MailEndCompose"></a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">If PyOpenCL can run into this maybe there is something wrong with the device extension check either
for them or for beignet. I will recheck about this and give you a clear reply then.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Xiuli</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><a name="m_-188448345257385386______replyseparato"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
Beignet [mailto:</span><a href="mailto:beignet-bounces@lists.freedesktop.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">beignet-bounces@lists.freedesktop.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">]
<b>On Behalf Of </b>Sean Lynch<br>
<b>Sent:</b> Tuesday, March 29, 2016 2:15 PM<br>
<b>To:</b> </span><a href="mailto:beignet@lists.freedesktop.org" target="_blank"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">beignet@lists.freedesktop.org</span></a><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"><br>
<b>Subject:</b> [Beignet] clCreateFromGLTexture working?</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I'm getting a segfault with the following stack when trying to call clCreateFromGLTexture from PyOpenCL (which just got preliminary support for it):<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#0 0x0000000000000000 in ?? ()<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#1 0x00007f8b6af995bd in clCreateFromGLTexture () from /usr/lib/libOpenCL.so.1<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#2 0x00007f8b6b1f3a78 in create_from_gl_texture () from /home/seanl/project/voxel/pyenv/lib/python3.5/site-packages/pyopencl-2015.2.4-py3.5-linux-x86_64.egg/pyopencl/_<a href="http://cffi.cpython-35m-x86_64-linux-gnu.so" target="_blank">cffi.cpython-35m-x86_64-linux-gnu.so</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#3 0x00007f8b6b1cb10b in _cffi_f_create_from_gl_texture(_object*, _object*) () from /home/seanl/project/voxel/pyenv/lib/python3.5/site-packages/pyopencl-2015.2.4-py3.5-linux-x86_64.egg/pyopencl/_<a href="http://cffi.cpython-35m-x86_64-linux-gnu.so" target="_blank">cffi.cpython-35m-x86_64-linux-gnu.so</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#4 0x00007f8b75f755e9 in PyCFunction_Call () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#5 0x00007f8b75fed5f1 in PyEval_EvalFrameEx () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#6 0x00007f8b75fee9e2 in ?? () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#7 0x00007f8b75feeac3 in PyEval_EvalCodeEx () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#8 0x00007f8b75f58b98 in ?? () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#9 0x00007f8b75f2e0da in PyObject_Call () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#10 0x00007f8b75f44d64 in ?? () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#11 0x00007f8b75f2e0da in PyObject_Call () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#12 0x00007f8b75f8aa10 in ?? () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#13 0x00007f8b75f88de6 in ?? () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#14 0x00007f8b75f2e0da in PyObject_Call () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#15 0x00007f8b75fe74bc in PyEval_EvalFrameEx () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#16 0x00007f8b75fed942 in PyEval_EvalFrameEx () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#17 0x00007f8b75fee9e2 in ?? () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#18 0x00007f8b75feeac3 in PyEval_EvalCodeEx () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#19 0x00007f8b75feeaeb in PyEval_EvalCode () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#20 0x00007f8b7600dc64 in ?? () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#21 0x00007f8b76010175 in PyRun_FileExFlags () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#22 0x00007f8b760102e6 in PyRun_SimpleFileExFlags () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#23 0x00007f8b760270f4 in Py_Main () from /usr/lib/libpython3.5m.so.1.0<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">#24 0x0000000000400af7 in main ()<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Should this work with current Beignet master?<o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</body>
</html>