Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*
595 Discussions

SYCL GPU device query - Is the GPU device is discrete or integtated?

amimar2
Novice
850 Views

I write a SYCL application for which I need to distinguish between GPU discrete devices and GPU integrated devices. Is there any way, directly or indirectly, to know if the GPU device I selected (for example: by gpu_selector()) is discrete GPU or integrated GPU? I did not find an aspect for this.

0 Kudos
1 Solution
VaishnaviV_Intel
Moderator
758 Views

Hi,

 

Thanks for your patience and understanding.

PCI ID can be used to determine whether the GPU is integrated or discrete.

Please find the attachment for the sample code(code.zip).

This code snippet will print the PCI Device id.  

For example, the PCI ID of Intel® Data Center GPU Max 1100 is 0BDA. Complete list can be found here.

VaishnaviV_Intel_0-1700200518683.png

 

From this ID we can easily detect the type of the GPU. For this, a custom device selector can be used:

class DiscreteSelector : public sycl::device_selector {
public:
    int operator()(const sycl::device &dev) const override {
        string dg2_name = "OBDA"; //ID of the discrete gpu
        string device_name = dev.get_info<sycl::info::device::name>();
        return device_name == dg2_name ? 1 : -1;
    }
}; 

 

If you still have any issues, please let us know.

 

Thanks & Regards,

Vankudothu Vaishnavi.

 

View solution in original post

0 Kudos
3 Replies
VaishnaviV_Intel
Moderator
789 Views

Hi,

 

Thanks for posting on Intel communities.

We're looking into your question and will get back to you soon.

 

Thanks & Regards,

Vankudothu Vaishnavi.

 

0 Kudos
VaishnaviV_Intel
Moderator
759 Views

Hi,

 

Thanks for your patience and understanding.

PCI ID can be used to determine whether the GPU is integrated or discrete.

Please find the attachment for the sample code(code.zip).

This code snippet will print the PCI Device id.  

For example, the PCI ID of Intel® Data Center GPU Max 1100 is 0BDA. Complete list can be found here.

VaishnaviV_Intel_0-1700200518683.png

 

From this ID we can easily detect the type of the GPU. For this, a custom device selector can be used:

class DiscreteSelector : public sycl::device_selector {
public:
    int operator()(const sycl::device &dev) const override {
        string dg2_name = "OBDA"; //ID of the discrete gpu
        string device_name = dev.get_info<sycl::info::device::name>();
        return device_name == dg2_name ? 1 : -1;
    }
}; 

 

If you still have any issues, please let us know.

 

Thanks & Regards,

Vankudothu Vaishnavi.

 

0 Kudos
VaishnaviV_Intel
Moderator
700 Views

Hi,


Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel. 


Thanks & Regards,

Vankudothu Vaishnavi.


0 Kudos
Reply