use cgroup in "total_ram" report

Signed-off-by: bigcat88 <bigcat88@icloud.com>
This commit is contained in:
bigcat88 2025-06-15 08:30:00 +03:00
parent 290cfd16a2
commit 7eebd59c69
No known key found for this signature in database
GPG Key ID: 1F0BF0EC3CF22721

View File

@ -241,7 +241,7 @@ def _get_cgroup_value(p: Path):
_CGROUP_LIMIT_BYTES = _get_cgroup_value(_LIMIT_F)
total_vram = get_total_memory(get_torch_device()) / (1024 * 1024)
total_ram = psutil.virtual_memory().total / (1024 * 1024)
total_ram = (_CGROUP_LIMIT_BYTES or psutil.virtual_memory().total) / (1024 * 1024)
logging.info("Total VRAM {:0.0f} MB, total RAM {:0.0f} MB".format(total_vram, total_ram))
try: