0
votes

The OpenCL clGetDeviceInfo function returns a device vendor identifier when called with CL_DEVICE_VENDOR_ID. For CL_DEVICE_VENDOR_ID, the OpenCL spec states: "A unique device vendor identifier. An example of a unique device identifier could be the PCIe ID".

On this system, the Intel and AMD GPUs are both returning their PCIe ID (0x8086 and 0x1002 respectively. So, the question is: do all OpenCL devices return their PCIe IDs as their "unique device vendor identifier"? If so, are the PCIe vendor IDs listed in a header file somewhere?

2
I think it's defined in the vendor provided OpenCL shared library.zindarod

2 Answers

1
votes

do all OpenCL devices return their PCIe IDs

The answer is no. It's very easy on x86 where you're almost guaranteed to have a PCI bus, and only 3 possible vendors; but in the ARM world, many (most?) don't have a PCI bus at all, and there is no official way to get any sort of vendor ID (at least AFAIK).

1
votes

According to the standard, there is no guarantee for it to be an PCIe device ID, so I wouldn't count on it. I'd expect it from hardware vendor's implementations, but not from open source implementations like PoCL. Even if all implementations currently did, the next one might not and your code would stop being portable.

In a Linux environment, you can use lspci and lspci -n to query your computer's device's, the latter just showing the IDs instead of names. The data seems to come from this file according to the manpage /usr/share/hwdata/pci.ids.

Hope that helps.