Skip to content

Commit

Permalink
[intel-npu] max memalloc quickfix for grext 1.8 windows drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
csoka committed Oct 29, 2024
1 parent 99f3a91 commit 0ce3f9c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/intel_npu/src/backend/src/zero_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ uint64_t ZeroDevice::getTotalMemSize() const {
// we are safe here, can return the value directly from driver
return query.total;
}
#if defined(_WIN32) || defined(__CYGWIN__)
// Special case for windows drivers with graph_extension v 1.8
if (_initStructs->isExtensionSupported(std::string("ZE_extension_graph_1_6"), ZE_MAKE_VERSION(1, 6))) {
// query here returns total system memory in KB, which we need to
// divide by 2 (OS limitation) and convert to bytes
return (query.total << 9);
}
#endif

// Default for older drivers: return 2GB
return LEGACY_MAX_MEM_ALLOC_SIZE_BYTES;
Expand Down

0 comments on commit 0ce3f9c

Please sign in to comment.