[IE][VPU]: Check memory capacity after finding the corresponding device (#4314)
This issue relates to multi-device mode. While we are trying to allocate a graph on one of the devices we should check memory capacity only for the corresponding device, not for the last opened as far devices may have different memory capacity or the latest opened device may have still not sent its attributes (including memory capacity)
This commit is contained in:
parent
7454aa2d1a
commit
fff10ea93a
@ -1986,11 +1986,6 @@ ncStatus_t ncGraphAllocate(struct ncDeviceHandle_t * deviceHandle,
|
||||
struct _graphPrivate_t *g = graphHandle->private_data;
|
||||
|
||||
struct _devicePrivate_t *d = devices;
|
||||
if (graphBufferLength > d->dev_attr.max_memory) {
|
||||
mvLog(MVLOG_ERROR, "The graph file is bigger than the device memory");
|
||||
return NC_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
GLOBAL_LOCK();
|
||||
while (d) {
|
||||
if (d == deviceHandle->private_data)
|
||||
@ -2006,6 +2001,11 @@ ncStatus_t ncGraphAllocate(struct ncDeviceHandle_t * deviceHandle,
|
||||
}
|
||||
GLOBAL_UNLOCK();
|
||||
|
||||
if (graphBufferLength > d->dev_attr.max_memory) {
|
||||
mvLog(MVLOG_ERROR, "The graph file is bigger than the device memory");
|
||||
return NC_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
lockAllInferences();
|
||||
g->id = graphIdCount++;
|
||||
streamId_t streamId;
|
||||
|
Loading…
Reference in New Issue
Block a user