You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to get number of Intel GPUs without dpctl? #1256
I have a question about get device count of Intel GPUs.
By using dpctl, I can easily get count with len(dpctl.get_devices("level_zero", "gpu"))
However, using this API should import dpctl,
If I don't want to import dpctl, how can I get the device count?
Like Nvidia GPU detection: by check the driver list in folder /proc/driver/nvidia/gpus
Dpctl uses the dpcpp SYCL runtime, so the count of devices correlate to what the SYCL runtime exposes. For example, you can have a Nvidia GPU on your system, but it will not be counted as a device unless you specially build dpcpp and dpctl with Nvidia support (ref #1124).
If you do not want to use dpctl, then you can use sycl-ls to get the list of devices that are supported by your SYCL runtime. I do not recommend looking at driver directories as dpcpp can support different types of drivers: opencl, level_zero, cuda, rocm (last two need separate plugins).
Activity
diptorupd commentedon Jun 20, 2023
Dpctl uses the dpcpp SYCL runtime, so the count of devices correlate to what the SYCL runtime exposes. For example, you can have a Nvidia GPU on your system, but it will not be counted as a device unless you specially build dpcpp and dpctl with Nvidia support (ref #1124).
If you do not want to use dpctl, then you can use
sycl-lsto get the list of devices that are supported by your SYCL runtime. I do not recommend looking at driver directories as dpcpp can support different types of drivers: opencl, level_zero, cuda, rocm (last two need separate plugins).diptorupd commentedon Jun 20, 2023
Converting the issue to a discussion.