Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

Best way to detect compatible GPU availability

aag
Novice
805 Views

Is there a way to determine GPU availability, using the API? Alternatively, is there a way to use HETERO plugin in a way that won't lead to exception when GPU isn't available?

At present, creating a HETERO plugin (HETERO: GPU, CPU), and then calling plugin.loadNetwork leads to an exception being thrown:

Exception in loadNetwork Cannot find plugin to use :Tried load plugin : clDNNPlugin, error: Plugin clDNNPlugin cannot be loaded: cannot load plugin: clDNNPlugin from : Cannot load library 'libclDNNPlugin.so': /usr/lib/x86_64-linux-gnu/libOpenCL.so.1: version `OPENCL_2.0' not fou

Ideally, we wouldn't event attempt to use HETERO plugin, if there's no GPU available; but there's no API to detect that, as far as I can see. Better yet, HETERO plugin should be able to deal with GPU not being there, and fall back to CPU-only.

Thanks for any ideas/direction.

 

0 Kudos
5 Replies
Shubha_R_Intel
Employee
805 Views

Dear Alex A.,

All you have to do is check the result of executableNetwork = ie.LoadNetwork(network, deviceName);. If there is a problem with your GPU, then this API will return an error.

Thanks,

Shubha

 

 

 

0 Kudos
aag
Novice
805 Views

That is exactly what we're doing now, however, it is suboptimal: there's no way (to the best of my understanding) to distinguish "no GPU" error from any other errors, so any debug/error logging when GPU isn't present will be similar to that of legitimate errors.

Additionally, it seems that LoadNetwork dumps quite a bit of output to stdout -

"layer1 is GPU
layer2 is CPU
etc"

which happens before LoadNetwork errors out.

 

Shubha R. (Intel) wrote:

Dear Alex A.,

All you have to do is check the result of executableNetwork = ie.LoadNetwork(network, deviceName);. If there is a problem with your GPU, then this API will return an error.

Thanks,

Shubha

 

 

 

0 Kudos
Shubha_R_Intel
Employee
805 Views

Dear Alex A.,

OpenCL APIs undoubtedly have a better way to detect GPUs. You might check on the OpenCL forum

But within OpenVino, what I suggested is really the only way. The developers are working on API enhancements though, so in the future this might change.

Thanks for your patience,

Shubha

0 Kudos
om77
New Contributor I
805 Views

Hi Alex,

We had a similar request and decided to use OpenCL to detect GPU.

It still needs to have something (like API ncDeviceCreate in NCS SDK) to detect unplugged Myriad.

I agree with you that an exception generation during ie.LoadNetwork is not acceptable way.

0 Kudos
Shubha_R_Intel
Employee
805 Views

Dear om77,

Yep, we hear you. The OpenVino developers do realize that the API needs enhancement. But glad you found the OpenCL method to help you out (as I suggested also to Alex).

Thanks,

Shubha

0 Kudos
Reply