diff --git a/tinygrad/runtime/ops_amd.py b/tinygrad/runtime/ops_amd.py index 513dbf8e56..da4a10142e 100644 --- a/tinygrad/runtime/ops_amd.py +++ b/tinygrad/runtime/ops_amd.py @@ -579,7 +579,7 @@ class KFDIface: except OSError as e: if e.errno == errno.EINVAL and (flags & kfd.KFD_IOC_ALLOC_MEM_FLAGS_VRAM) and cpu_access: raise MemoryError("Cannot allocate host-visible VRAM. Ensure the resizable BAR option is enabled on your system.") from e - if e.errno == errno.ENOMEM: raise MemoryError("Cannot allocate memory: no memory is available.") from e + if e.errno == errno.ENOMEM: raise MemoryError(f"Cannot allocate {size} bytes: no memory is available.") from e raise if not (flags & kfd.KFD_IOC_ALLOC_MEM_FLAGS_USERPTR):