Merge pull request #36 from Disty0/main

OpenVINO add VRAM size
pull/37/head
Vladimir Mandic 2023-09-28 17:12:11 -04:00 committed by GitHub
commit 34ada0db1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -191,6 +191,16 @@ def get_memory():
mem.update({ 'utilization': torch.cuda.utilization() }) # do this one separately as it may fail
except Exception:
pass
else:
try:
from openvino.runtime import Core as OpenVINO_Core
from modules.intel.openvino import get_device as get_raw_openvino_device
openvino_core = OpenVINO_Core()
mem.update({
'gpu': { 'total': gb(openvino_core.get_property(get_raw_openvino_device(), 'GPU_DEVICE_TOTAL_MEM_SIZE')) },
})
except Exception:
pass
return mem