<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re:DPCPP-SYCL cannot find GPU target from Python (Pybind11) in Intel® oneAPI DPC++/C++ Compiler</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-SYCL-cannot-find-GPU-target-from-Python-Pybind11/m-p/1469341#M2953</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;As you want to close this thread as mentioned in internal notes, we are going ahead and closing this issue.&lt;/P&gt;&lt;P&gt;If you need any additional information, please submit a new question as this thread will no longer be monitored.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Noorjahan.&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 24 Mar 2023 07:32:22 GMT</pubDate>
    <dc:creator>NoorjahanSk_Intel</dc:creator>
    <dc:date>2023-03-24T07:32:22Z</dc:date>
    <item>
      <title>DPCPP-SYCL cannot find GPU target from Python (Pybind11)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-SYCL-cannot-find-GPU-target-from-Python-Pybind11/m-p/1466563#M2922</link>
      <description>&lt;P&gt;I have a simple Pybind11-binding:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#include &amp;lt;CL/sycl.hpp&amp;gt;
#include &amp;lt;pybind11/pybind11.h&amp;gt;

int foo(int a)
{
sycl::queue q(sycl::gpu_selector_v);
sycl::buffer&amp;lt;int, 1&amp;gt; b(&amp;amp;a, sycl::range&amp;lt;1&amp;gt;(1));
q.submit([&amp;amp;](sycl::handler&amp;amp; cgh){
auto acc = b.get_access&amp;lt;sycl::access::mode::read_write&amp;gt;(cgh);
cgh.single_task&amp;lt;class foo&amp;gt;([=](){
acc[0] +=1;
});
});
//accessor
auto acc = b.get_access&amp;lt;sycl::access::mode::read&amp;gt;();
return acc[0];
}

PYBIND11_MODULE(test_binder, m) {
m.def("foo", &amp;amp;foo);
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And a simple script to invoke:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;import sys

binder_path = "..."
sys.path.append(binder_path)

from test_binder import *

print(foo(1))&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;The binder is built in a oneapi-sourced environment, and linked with:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;-fsycl -sycl-std=2020 -std=c++20 -fsycl-unnamed-lambda -fPIC&lt;/LI-CODE&gt;
&lt;P&gt;&lt;BR /&gt;(Cpp-executables built with the same flags are able to execute fine on the GPU.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When running the `.py` script in the sourced environment, it works fine on the CPU. However, when openCL-devices are forced:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;export ONEAPI_DEVICE_SELECTOR=opencl:*&lt;/LI-CODE&gt;
&lt;P&gt;I get the following error:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Traceback (most recent call last):
File "...py", line 8, in &amp;lt;module&amp;gt;
print(foo(1))
RuntimeError: No device of requested type available. Please check https://software.intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.html -1 (PI_ERROR_DEVICE_NOT_FOUND)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is it possible to keep the OpenCL-device exposed through the compiled Python-binder?&lt;/P&gt;
&lt;P&gt;(AOT-compiling with -fsycl-targets did not resolve the issue)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 12:22:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-SYCL-cannot-find-GPU-target-from-Python-Pybind11/m-p/1466563#M2922</guid>
      <dc:creator>Jonas5</dc:creator>
      <dc:date>2023-03-16T12:22:39Z</dc:date>
    </item>
    <item>
      <title>Re:DPCPP-SYCL cannot find GPU target from Python (Pybind11)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-SYCL-cannot-find-GPU-target-from-Python-Pybind11/m-p/1467043#M2923</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for posting in Intel Communities.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please provide the detailed steps you have followed to build your code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also please provide the below details:&lt;/P&gt;&lt;P&gt;OS &amp;amp; Hardware details&lt;/P&gt;&lt;P&gt;The compiler version being used&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please let us know why you are using OpenCL devices?&lt;/P&gt;&lt;P&gt;Also please try with a level_zero device and let us know if you observe the same issue.&lt;/P&gt;&lt;P&gt;&lt;EM&gt; ONEAPI_DEVICE_SELECTOR=level_zero:gpu&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt; Noorjahan.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Mar 2023 12:44:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-SYCL-cannot-find-GPU-target-from-Python-Pybind11/m-p/1467043#M2923</guid>
      <dc:creator>NoorjahanSk_Intel</dc:creator>
      <dc:date>2023-03-17T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re:DPCPP-SYCL cannot find GPU target from Python (Pybind11)</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-SYCL-cannot-find-GPU-target-from-Python-Pybind11/m-p/1469341#M2953</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;As you want to close this thread as mentioned in internal notes, we are going ahead and closing this issue.&lt;/P&gt;&lt;P&gt;If you need any additional information, please submit a new question as this thread will no longer be monitored.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Noorjahan.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Mar 2023 07:32:22 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-DPC-C-Compiler/DPCPP-SYCL-cannot-find-GPU-target-from-Python-Pybind11/m-p/1469341#M2953</guid>
      <dc:creator>NoorjahanSk_Intel</dc:creator>
      <dc:date>2023-03-24T07:32:22Z</dc:date>
    </item>
  </channel>
</rss>

