GPU_SELECTOR在SYCL DPC++
在我的Ubuntu 20.04版本中,我们安装了Intel One API DPC ++。版本是; Intel(R)一个API DPC ++/C ++编译器2022.1.0(2022.1.0.20220316)
我们有NVIDIA GPU。 (通过命令了解:
nvidia-smi
)我们有nvidia geforce ... on
我们正在尝试使用
gpu_selector选择GPU代码>方法。它给出了运行时错误,例如
cl_device_not_found
在DPC ++中。而cpu_selector
工作正常。
请检查以下方法并帮助我。感谢
程序:
#include<iosteam>
#include<CL/sycl.hpp>
#include<CL/sycl/device_selector.hpp>
int main()
{
cl::sycl::queue q(sycl::gpu_selector{});
std::cout<<"Running on"<<q.get_devicee().get_info<cl::sycl::info::device::name>();
return 0;
}
第二种方法
device d;
d = device(gpu_selector());
std::cout<<"Gpu info: "<<d.get_info<sycl::info::device::name();
3rd方法
sycl::device dev = sycl::gpu_selector().select_device();
std::cout<<"GPU info: "<<dev.get_info<sycl::info::device::name>()<<std::endl;<<dev.get_info<sycl::info::device::vendor()<<std::endl;
输出所有方法:
terminate called after throwing an instance of 'cl::sycl::runtime_error' intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.htmo -1 (CL_DEVICE_NOT_FOUND)
Aborted (core dumped)
In my Ubuntu 20.04 version, we have installed intel one API dpc++. The version is; Intel(R) one API DPC++/C++ Compiler 2022.1.0 (2022.1.0.20220316)
Where we have nvidia gpu. (Got to know by command:
nvidia-smi
) There we haveNVIDIA GeForce ... On
We are trying to select GPU using
gpu_selector
method. It is giving runtime error likeCL_DEVICE_NOT_FOUND
in dpc++. whereascpu_selector
is working fine.
Please check the below methods and help me. Thanks
Program:
#include<iosteam>
#include<CL/sycl.hpp>
#include<CL/sycl/device_selector.hpp>
int main()
{
cl::sycl::queue q(sycl::gpu_selector{});
std::cout<<"Running on"<<q.get_devicee().get_info<cl::sycl::info::device::name>();
return 0;
}
2nd Method
device d;
d = device(gpu_selector());
std::cout<<"Gpu info: "<<d.get_info<sycl::info::device::name();
3rd Method
sycl::device dev = sycl::gpu_selector().select_device();
std::cout<<"GPU info: "<<dev.get_info<sycl::info::device::name>()<<std::endl;<<dev.get_info<sycl::info::device::vendor()<<std::endl;
output for all the methods:
terminate called after throwing an instance of 'cl::sycl::runtime_error' intel.com/content/www/us/en/develop/articles/intel-oneapi-dpcpp-system-requirements.htmo -1 (CL_DEVICE_NOT_FOUND)
Aborted (core dumped)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论