diff --git a/invokeai/backend/model_management/memory_snapshot.py b/invokeai/backend/model_management/memory_snapshot.py index 4f43affcf7..01f1328114 100644 --- a/invokeai/backend/model_management/memory_snapshot.py +++ b/invokeai/backend/model_management/memory_snapshot.py @@ -55,8 +55,10 @@ class MemorySnapshot: try: malloc_info = LibcUtil().mallinfo2() - except OSError: - # This is expected in environments that do not have the 'libc.so.6' shared library. + except (OSError, AttributeError): + # OSError: This is expected in environments that do not have the 'libc.so.6' shared library. + # AttributeError: This is expected in environments that have `libc.so.6` but do not have the `mallinfo2` (e.g. glibc < 2.33) + # TODO: Does `mallinfo` work? malloc_info = None return cls(process_ram, vram, malloc_info) diff --git a/tests/backend/model_management/test_libc_util.py b/tests/backend/model_management/test_libc_util.py index a517db4c90..e13a2fd3a2 100644 --- a/tests/backend/model_management/test_libc_util.py +++ b/tests/backend/model_management/test_libc_util.py @@ -11,7 +11,10 @@ def test_libc_util_mallinfo2(): # TODO: Set the expected result preemptively based on the system properties. pytest.xfail("libc shared library is not available on this system.") - info = libc.mallinfo2() + try: + info = libc.mallinfo2() + except AttributeError: + pytest.xfail("`mallinfo2` is not available on this system, likely due to glibc < 2.33.") assert info.arena > 0