- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
I have a simple Pybind11-binding:
#include <CL/sycl.hpp>
#include <pybind11/pybind11.h>
int foo(int a)
{
sycl::queue q(sycl::gpu_selector_v);
sycl::buffer<int, 1> b(&a, sycl::range<1>(1));
q.submit([&](sycl::handler& cgh){
auto acc = b.get_access<sycl::access::mode::read_write>(cgh);
cgh.single_task<class foo>([=](){
acc[0] +=1;
});
});
//accessor
auto acc = b.get_access<sycl::access::mode::read>();
return acc[0];
}
PYBIND11_MODULE(test_binder, m) {
m.def("foo", &foo);
}
And a simple script to invoke:
import sys
binder_path = "..."
sys.path.append(binder_path)
from test_binder import *
print(foo(1))
The binder is built in a oneapi-sourced environment, and linked with:
-fsycl -sycl-std=2020 -std=c++20 -fsycl-unnamed-lambda -fPIC
(Cpp-executables built with the same flags are able to execute fine on the GPU.)
When running the `.py` script in the sourced environment, it works fine on the CPU. However, when openCL-devices are forced:
export ONEAPI_DEVICE_SELECTOR=opencl:*
I get the following error:
Traceback (most recent call last):
File "...py", line 8, in <module>
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)
Is it possible to keep the OpenCL-device exposed through the compiled Python-binder?
(AOT-compiling with -fsycl-targets did not resolve the issue)
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi,
Thanks for posting in Intel Communities.
Could you please provide the detailed steps you have followed to build your code?
Also please provide the below details:
OS & Hardware details
The compiler version being used
Could you please let us know why you are using OpenCL devices?
Also please try with a level_zero device and let us know if you observe the same issue.
ONEAPI_DEVICE_SELECTOR=level_zero:gpu
Thanks & Regards,
Noorjahan.
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi,
As you want to close this thread as mentioned in internal notes, we are going ahead and closing this issue.
If you need any additional information, please submit a new question as this thread will no longer be monitored.
Thanks & Regards,
Noorjahan.
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite