GPU_SELECTOR在SYCL DPC++

发布于 2025-02-08 18:12:48 字数 1611 浏览 2 评论 0原文

在我的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 have NVIDIA GeForce ... On

  • We are trying to select GPU using gpu_selector method. It is giving runtime error like CL_DEVICE_NOT_FOUND in dpc++. whereas cpu_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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文