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

192 views Asked by At

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.

1

There are 1 answers

5
aland On

As you observed, there are no dedicated aspect or property.

With Intel oneAPI, you can query (deprecated, but still working) info::device::host_unified_memory device property. I verified with oneAPI 2024.0 that it works for integrated and discreet Intel GPUs; and, based on the source code, it should work like this for NVIDIA and AMD GPUs too. But it is an implementation detail and is not guaranteed to behave like this in any future releases.

I don't see a way to do this with AdaptiveCpp / hipSYCL: the host_unified_memory property is always false for CUDA/HIP/OpenCL devices.

Another option with oneAPI is querying sycl::ext::intel::info::device::device_id property to get a PCI Device ID for Intel GPU. This can later be checked against the official device list. However, this will not work for NVIDIA or AMD GPUs. But, at this point, it might be easier to simply search the device name for keywords :)